mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-64871 (Inspection result viewer screws up sorting)
This commit is contained in:
@@ -428,10 +428,10 @@ public class InspectionResultsView extends JPanel implements Disposable, Occuren
|
||||
private void addTool(InspectionTool tool, HighlightDisplayLevel errorLevel, boolean groupedBySeverity) {
|
||||
final InspectionTreeNode parentNode = getToolParentNode(tool.getGroupDisplayName().length() > 0 ? tool.getGroupDisplayName() : InspectionProfileEntry.GENERAL_GROUP_NAME, errorLevel, groupedBySeverity);
|
||||
tool.createToolNode(myProvider, parentNode, myGlobalInspectionContext.getUIOptions().SHOW_STRUCTURE);
|
||||
regsisterActionShortcuts(tool);
|
||||
registerActionShortcuts(tool);
|
||||
}
|
||||
|
||||
private void regsisterActionShortcuts(InspectionTool tool) {
|
||||
private void registerActionShortcuts(InspectionTool tool) {
|
||||
final QuickFixAction[] fixes = tool.getQuickFixes(null);
|
||||
if (fixes != null) {
|
||||
for (QuickFixAction fix : fixes) {
|
||||
@@ -465,8 +465,7 @@ public class InspectionResultsView extends JPanel implements Disposable, Occuren
|
||||
}
|
||||
clearTree();
|
||||
boolean resultsFound = buildTree();
|
||||
myTree.sort();
|
||||
myTree.restoreExpantionAndSelection();
|
||||
myTree.restoreExpansionAndSelection();
|
||||
return resultsFound;
|
||||
}
|
||||
|
||||
|
||||
@@ -212,26 +212,22 @@ public class InspectionTree extends Tree {
|
||||
}
|
||||
}
|
||||
|
||||
public void restoreExpantionAndSelection() {
|
||||
restoreExpantion();
|
||||
public void restoreExpansionAndSelection() {
|
||||
restoreExpansionStatus((InspectionTreeNode)getModel().getRoot());
|
||||
if (mySelectionPath != null) {
|
||||
mySelectionPath.restore();
|
||||
}
|
||||
}
|
||||
|
||||
private void restoreExpantion() {
|
||||
restoreExpantionStatus((InspectionTreeNode)getModel().getRoot());
|
||||
}
|
||||
|
||||
|
||||
private void restoreExpantionStatus(InspectionTreeNode node) {
|
||||
private void restoreExpansionStatus(InspectionTreeNode node) {
|
||||
if (myExpandedUserObjects.contains(node.getUserObject())) {
|
||||
sortChildren(node);
|
||||
TreeNode[] pathToNode = node.getPath();
|
||||
expandPath(new TreePath(pathToNode));
|
||||
Enumeration children = node.children();
|
||||
while (children.hasMoreElements()) {
|
||||
InspectionTreeNode childNode = (InspectionTreeNode)children.nextElement();
|
||||
restoreExpantionStatus(childNode);
|
||||
restoreExpansionStatus(childNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -300,10 +296,6 @@ public class InspectionTree extends Tree {
|
||||
}
|
||||
}
|
||||
|
||||
public void sort() {
|
||||
sortChildren(getRoot());
|
||||
}
|
||||
|
||||
private static void sortChildren(InspectionTreeNode node) {
|
||||
final List<TreeNode> children = TreeUtil.childrenToArray(node);
|
||||
Collections.sort(children, InspectionResultsViewComparator.getInstance());
|
||||
|
||||
Reference in New Issue
Block a user