public void setItemExpanded(TreeItem item, boolean expanded) { if (expanded) { expandPath(new TreePath(item.getPath())); } else { collapsePath(new TreePath(item.getPath())); } }
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); }
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())); }