/** Expand a tree path */ public void expandPath (TreePath path) { getTreePathSupport().expandPath (path); }
private void expandNode(DefaultMutableTreeNode treeNode, boolean recursive, int level) { if (treeNode.getAllowsChildren()) { if (treeNode.getChildCount() == 0) { TreePath path = new TreePath(treeNode.getPath()); mdl.getTreePathSupport().expandPath(path); } if (recursive && level <= MAX_LEVELS_TO_EXPAND) { for (int childIndex = 0; childIndex < treeNode.getChildCount(); childIndex++) { DefaultMutableTreeNode child = (DefaultMutableTreeNode) treeNode.getChildAt(childIndex); expandNode(child, recursive, level + 1); } } } }
private void expandNode(DefaultMutableTreeNode treeNode, boolean recursive, int level) { if (treeNode.getAllowsChildren()) { if (treeNode.getChildCount() == 0) { TreePath path = new TreePath(treeNode.getPath()); mdl.getTreePathSupport().expandPath(path); } if (recursive && level <= MAX_LEVELS_TO_EXPAND) { for (int childIndex = 0; childIndex < treeNode.getChildCount(); childIndex++) { DefaultMutableTreeNode child = (DefaultMutableTreeNode) treeNode.getChildAt(childIndex); expandNode(child, recursive, level + 1); } } } }
getTreePathSupport().expandPath(path);