Provides a set of classes to manipulate nodes in JTree components.
Nodes should help to easier testing of nodes in JTree components.
The
most frequent usage in IDE is in the Projects or Files view but nodes
can be used
in any component which includes a JTree instance. Nodes are also used
as
parameters for action's performing.
In this package are predefined specialized nodes for common objects in
IDE.
You can use them with combination of generic node instances as you
like.
Simple example looks like this:
// Finds Source Packages node under My
Project node in Projects view
SourcePackagesNode sourceNode = new
Node(new SourcePackagesNode("My Project"));
// Finds child with given path
Node node = new Node(sourceNode,
"org.netbeans.jellytools.nodes|Node.java");
// Performs action on node
new OpenAction().performAPI(node);
Items in a node path are separated by "|" character and searching
(exact match, case sensitivity) is driven by current string comparator.
Root node must not be included in search path. To get root node
instance you need to
supply empty search path or use a getter method:
Node rootNode = new Node(treeOperator, "");
|