Merge branches 'evagl/included-from' and 'master' of git.labs.intellij.net:idea/community

This commit is contained in:
Aleksandr Samofalov
2016-04-04 18:37:46 +03:00
2 changed files with 17 additions and 6 deletions
@@ -127,7 +127,7 @@ public class NewErrorTreeViewPanel extends JPanel implements DataProvider, Occur
myMessagePanel = new JPanel(new BorderLayout());
myErrorViewStructure = new ErrorViewStructure(project, canHideWarnings());
myErrorViewStructure = createErrorViewStructure(project, canHideWarnings());
DefaultMutableTreeNode root = new DefaultMutableTreeNode();
root.setUserObject(myErrorViewStructure.createDescriptor(myErrorViewStructure.getRootElement(), null));
final DefaultTreeModel treeModel = new DefaultTreeModel(root);
@@ -180,6 +180,10 @@ public class NewErrorTreeViewPanel extends JPanel implements DataProvider, Occur
EditSourceOnDoubleClickHandler.install(myTree);
}
protected ErrorViewStructure createErrorViewStructure(Project project, boolean canHideWarnings) {
return new ErrorViewStructure(project, canHideWarnings);
}
@Override
public void dispose() {
myIsDisposed = true;
@@ -25,6 +25,8 @@ import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.DefaultActionGroup;
import com.intellij.ide.errorTreeView.NewErrorTreeViewPanel;
import javax.swing.*;
public class ErrorViewFactoryImpl implements ErrorViewFactory {
public ErrorTreeView createErrorTreeView(Project project,
String helpId,
@@ -52,12 +54,17 @@ public class ErrorViewFactoryImpl implements ErrorViewFactory {
}
public void close() {
ContentManager contentManager = contentManagerProvider.getParentContent();
Content content = contentManager.getContent(this);
if (content != null) {
contentManager.removeContent(content, true);
}
removeFromContentManager(contentManagerProvider.getParentContent(), this);
}
};
}
public static void removeFromContentManager(ContentManager contentManager, ErrorTreeView view) {
if (view instanceof JComponent) {
Content content = contentManager.getContent((JComponent)view);
if (content != null) {
contentManager.removeContent(content, true);
}
}
}
}