void (final boolean expand) { final TreePath path = getSelectedPath(); final AbstractTreeNode<?> element = getLast(path); if (element == null) return; if (myModel.isLeaf(path.getLastPathComponent())) { if (element.canNavigate()) { element.navigate(true); } return; } if (!expand) return; if (!myTable.getTree().isExpanded(path)) { myTable.getTree().expandPath(path); } else { myTable.getTree().collapsePath(path); } }