public void addSelectionPathTo(final Object element) {
   DefaultMutableTreeNode node = myAbstractTreeBuilder.getNodeForElement(element);
   if (node != null) {
     final JTree tree = getTree();
     final TreePath path = new TreePath(node.getPath());
     if (node == tree.getModel().getRoot() && !tree.isExpanded(path)) tree.expandPath(path);
     tree.addSelectionPath(path);
   }
 }
Пример #2
0
 public ActionCallback expand(DefaultMutableTreeNode node) {
   myTree.expandPath(new TreePath(node.getPath()));
   return new ActionCallback.Done();
 }