public final class TreeUtils
extends java.lang.Object
| Constructor and Description |
|---|
TreeUtils() |
| Modifier and Type | Method and Description |
|---|---|
static TreeState |
getTreeState(javax.swing.JTree tree)
Returns tree expansion and selection states.
|
static TreeState |
getTreeState(javax.swing.JTree tree,
boolean saveSelection)
Returns tree expansion and selection states.
|
static <E extends javax.swing.tree.DefaultMutableTreeNode> |
optimizeNodes(java.util.List<E> nodes)
Optimizes list of nodes by removing those which already have their parent node in the list.
|
static void |
setTreeState(javax.swing.JTree tree,
TreeState treeState)
Restores tree expansion and selection states.
|
static void |
setTreeState(javax.swing.JTree tree,
TreeState treeState,
boolean restoreSelection)
Restores tree expansion and selection states.
|
static void |
updateAllVisibleNodes(javax.swing.JTree tree)
Updates visual representation of all visible tree nodes.
|
public static TreeState getTreeState(javax.swing.JTree tree)
tree - tree to processpublic static TreeState getTreeState(javax.swing.JTree tree, boolean saveSelection)
tree - tree to processsaveSelection - whether to save selection states or notpublic static void setTreeState(javax.swing.JTree tree,
TreeState treeState)
tree - tree to processtreeState - tree expansion and selection statespublic static void setTreeState(javax.swing.JTree tree,
TreeState treeState,
boolean restoreSelection)
tree - tree to processtreeState - tree expansion and selection statesrestoreSelection - whether to restore selection states or notpublic static <E extends javax.swing.tree.DefaultMutableTreeNode> void optimizeNodes(java.util.List<E> nodes)
nodes - nodes list to optimizepublic static void updateAllVisibleNodes(javax.swing.JTree tree)
tree - tree to update visible nodes for