public class TreeExpansionHandler
extends java.lang.Object
implements javax.swing.event.TreeExpansionListener, javax.swing.event.TreeModelListener
Modifier and Type | Field and Description |
---|---|
protected java.util.Set |
expanded
A set with the tree nodes, which are expanded.
|
protected javax.swing.JTree |
tree
The tree.
|
Constructor and Description |
---|
TreeExpansionHandler(javax.swing.JTree tree)
Create a tree expansion handler for a given tree.
|
Modifier and Type | Method and Description |
---|---|
protected IFuture |
handlePath(javax.swing.tree.TreePath path)
Check if an action (e.g.
|
void |
handleTreeStructureChanged(javax.swing.event.TreeModelEvent event,
javax.swing.tree.TreePath root,
int i)
Handle each node in the subtree.
|
boolean |
isExpanded(javax.swing.tree.TreePath path)
Test if a path is expanded or should be.
|
static boolean |
isTreeExpanded(javax.swing.JTree tree,
javax.swing.tree.TreePath path)
Test if a tree node is expanded or should be.
|
void |
treeCollapsed(javax.swing.event.TreeExpansionEvent event)
Called whenever an item in the tree has been collapsed.
|
void |
treeExpanded(javax.swing.event.TreeExpansionEvent event)
Called whenever an item in the tree has been expanded.
|
void |
treeNodesChanged(javax.swing.event.TreeModelEvent event)
Invoked after a node (or a set of siblings) has changed in some way.
|
void |
treeNodesInserted(javax.swing.event.TreeModelEvent event)
Invoked after nodes have been inserted into the tree.
|
void |
treeNodesRemoved(javax.swing.event.TreeModelEvent event)
Invoked after nodes have been removed from the tree.
|
void |
treeStructureChanged(javax.swing.event.TreeModelEvent event)
Invoked after the tree has drastically changed structure from a
given node down.
|
protected javax.swing.JTree tree
protected java.util.Set expanded
public TreeExpansionHandler(javax.swing.JTree tree)
public void treeExpanded(javax.swing.event.TreeExpansionEvent event)
treeExpanded
in interface javax.swing.event.TreeExpansionListener
public void treeCollapsed(javax.swing.event.TreeExpansionEvent event)
treeCollapsed
in interface javax.swing.event.TreeExpansionListener
public void treeNodesChanged(javax.swing.event.TreeModelEvent event)
treeNodesChanged
in interface javax.swing.event.TreeModelListener
public void treeNodesInserted(javax.swing.event.TreeModelEvent event)
treeNodesInserted
in interface javax.swing.event.TreeModelListener
public void treeNodesRemoved(javax.swing.event.TreeModelEvent event)
treeNodesRemoved
in interface javax.swing.event.TreeModelListener
public void treeStructureChanged(javax.swing.event.TreeModelEvent event)
treeStructureChanged
in interface javax.swing.event.TreeModelListener
public void handleTreeStructureChanged(javax.swing.event.TreeModelEvent event, javax.swing.tree.TreePath root, int i)
protected IFuture handlePath(javax.swing.tree.TreePath path)
public boolean isExpanded(javax.swing.tree.TreePath path)
public static boolean isTreeExpanded(javax.swing.JTree tree, javax.swing.tree.TreePath path)