Exemple #1
0
 public void setItemExpanded(TreeItem item, boolean expanded) {
   if (expanded) {
     expandPath(new TreePath(item.getPath()));
   } else {
     collapsePath(new TreePath(item.getPath()));
   }
 }
Exemple #2
0
 public void expandPath(TreePath path) {
   for (Object node : path.getPath()) {
     TreeItem parentItem = (TreeItem) node;
     if (parentItem != path.getLastPathComponent()
         && !isExpanded(new TreePath(parentItem.getPath()))) {
       return;
     }
   }
   super.expandPath(path);
 }
Exemple #3
0
 public void setCurrentItem(TreeItem item) {
   /*
   System.out.println("zefds");
   for(Object node : item.getPath()){
       TreeItem parentItem = (TreeItem) node;
       System.out.println(parentItem.getText());
       if(parentItem != item){
           parentItem.setExpanded(true);
       }
   }*/
   setSelectionPath(new TreePath(item.getPath()));
 }