コード例 #1
0
 public void expandAll() {
   ResourceTreeModel model = (ResourceTreeModel) tree.getModel();
   if (model != null) {
     ResourceTreeFolder root = (ResourceTreeFolder) model.getRoot();
     processAllNodes(tree, new TreePath(root), true);
   }
 }
コード例 #2
0
 public void collapseAll() {
   ResourceTreeModel model = (ResourceTreeModel) tree.getModel();
   if (model != null) {
     ResourceTreeFolder root = (ResourceTreeFolder) model.getRoot();
     processAllNodes(tree, new TreePath(root), false);
     tree.expandPath(new TreePath(root)); // virtual root node is always expanded
   }
 }