Ejemplo n.º 1
0
 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();
       restoreExpansionStatus(childNode);
     }
   }
 }
Ejemplo n.º 2
0
 @Override
 public void treeWillExpand(TreeExpansionEvent event) throws ExpandVetoException {
   final InspectionTreeNode node = (InspectionTreeNode) event.getPath().getLastPathComponent();
   final Object userObject = node.getUserObject();
   // TODO: never re-sort
   if (node.isValid() && !myExpandedUserObjects.contains(userObject)) {
     sortChildren(node);
     nodeStructureChanged(node);
   }
   myExpandedUserObjects.add(userObject);
   // Smart expand
   if (node.getChildCount() == 1) {
     ApplicationManager.getApplication()
         .invokeLater(
             new Runnable() {
               @Override
               public void run() {
                 expandPath(new TreePath(node.getPath()));
               }
             });
   }
 }
Ejemplo n.º 3
0
 @Override
 public void treeWillCollapse(TreeExpansionEvent event) throws ExpandVetoException {
   InspectionTreeNode node = (InspectionTreeNode) event.getPath().getLastPathComponent();
   myExpandedUserObjects.remove(node.getUserObject());
 }