|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jidesoft.tree.TreeUtils
public class TreeUtils
Constructor Summary | |
---|---|
TreeUtils()
|
Method Summary | |
---|---|
static void |
expandAll(JTree tree)
Expands the visible rows in a JTree. |
static void |
expandAll(JTree tree,
boolean expand)
Expands the tree completely. |
static void |
expandAll(JTree tree,
TreePath parent,
boolean expand)
Expands the tree completely. |
static Object |
findTreeNode(JTree tree,
Object userObject)
Finds the TreeNode that has the user object as passed in. |
static Object |
findTreeNode(JTree tree,
TreePath parent,
Object userObject)
Finds the TreeNode that has the user object as passed in starting from a tree path. |
static int |
getLeafCount(TreeModel treeModel)
Gets the leaf node count. |
static int |
getLeafCount(TreeModel treeModel,
Object node)
Gets the leaf node count. |
static boolean |
isDescendant(TreePath path1,
TreePath path2)
|
static void |
loadExpansionState(JTree tree,
int row,
String expansionState)
|
static void |
loadExpansionStateByTreePath(JTree tree,
Enumeration<TreePath> enumeration)
Restore the expansion state of a JTree. |
static void |
loadSelection(JTree tree,
TreePath[] selected)
Restore the selection in JTree. |
static String |
saveExpansionState(JTree tree,
int row)
|
static Enumeration<TreePath> |
saveExpansionStateByTreePath(JTree tree)
Save the expansion state of a tree. |
static TreePath[] |
saveSelection(JTree tree)
Save the selection of the JTree as an array of integer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TreeUtils()
Method Detail |
---|
public static TreePath[] saveSelection(JTree tree)
tree
- the JTree
public static void loadSelection(JTree tree, TreePath[] selected)
tree
- the JTreeselected
- an int array created by saveSelection(javax.swing.JTree)
.public static Enumeration<TreePath> saveExpansionStateByTreePath(JTree tree)
tree
- the JTree
public static void loadExpansionStateByTreePath(JTree tree, Enumeration<TreePath> enumeration)
tree
- the JTreeenumeration
- an Enumeration of expansion state. You can get it using saveExpansionStateByTreePath(javax.swing.JTree)
.public static boolean isDescendant(TreePath path1, TreePath path2)
public static String saveExpansionState(JTree tree, int row)
public static void loadExpansionState(JTree tree, int row, String expansionState)
tree
- the JTreerow
- the row indexexpansionState
- the expansion statepublic static void expandAll(JTree tree)
expandAll(javax.swing.JTree, boolean)
with a true
parameter.
tree
- the JTreepublic static void expandAll(JTree tree, boolean expand)
tree
- the treeexpand
- expand or collapsepublic static void expandAll(JTree tree, TreePath parent, boolean expand)
tree
- the treeparent
- the parent tree path. Only tree paths under this parent tree path will be expanded or collapsed.expand
- expand or collapsepublic static Object findTreeNode(JTree tree, Object userObject)
tree
- the treeuserObject
- the user object to match with the tree node's user object.
public static Object findTreeNode(JTree tree, TreePath parent, Object userObject)
tree
- the treeparent
- the parent tree path. Only tree paths under this parent tree path will be searched.userObject
- the user object to match with the tree node's user object.
public static int getLeafCount(TreeModel treeModel)
treeModel
- the TreeModel.
public static int getLeafCount(TreeModel treeModel, Object node)
treeModel
- the TreeModelnode
- the tree node
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |