public class Node extends Object
Nodes should help to easier testing of JTree's. The most frequent usage in IDE is in file views but nodes can be used in any component which includes a JTree instance. Nodes are also used as parameters for action's performing.
Example:
Node node = new Node(new SourcePackagesNode("My Project"), "org.netbeans.jellytools.nodes|Node.java"); System.out.println(node.getText()); new OpenAction().performAPI(node);
Modifier and Type | Field and Description |
---|---|
protected String |
stringPath
Path of node names representing this node.
|
protected org.netbeans.jemmy.operators.JTreeOperator |
treeOperator
JTreeOperator of tree where node lives
|
protected TreePath |
treePath
TreePath of node
|
Constructor and Description |
---|
Node(org.netbeans.jemmy.operators.JTreeOperator treeOperator,
String treePath)
creates new Node instance
|
Node(org.netbeans.jemmy.operators.JTreeOperator treeOperator,
String treePath,
String indexes)
creates new Node instance
|
Node(org.netbeans.jemmy.operators.JTreeOperator treeOperator,
TreePath path)
creates new Node instance
|
Node(Node parent,
int childIndex)
creates new Node instance
|
Node(Node parent,
String treeSubPath)
creates new Node instance
|
Modifier and Type | Method and Description |
---|---|
void |
addSelectionPath()
adds node into set of selected nodes
|
org.netbeans.jemmy.operators.JPopupMenuOperator |
callPopup()
calls popup menu on node
|
void |
collapse()
Collapse current node to hide children
|
void |
expand()
Expands current node to see children
|
String[] |
getChildren()
returns list of names of children
|
org.netbeans.jemmy.operators.Operator.StringComparator |
getComparator()
Gets comparator for this node instance.
|
Object |
getOpenideNode()
Returns Object instance which represents org.openide.nodes.Node for this
jellytools node.
|
String |
getParentPath()
getter for path of parent node
|
String |
getPath()
getter for node path
|
String |
getText()
getter for node text
|
TreePath |
getTreePath()
Getter for TreePath of node.
|
boolean |
isChildPresent(String childName)
Checks whether child with specified name is present under this node.
|
boolean |
isCollapsed()
Informs if current node is collapsed
|
boolean |
isExpanded()
Informs if current node is expanded
|
boolean |
isLeaf()
tests if node is leaf
|
boolean |
isLink()
determines if current node is link
|
boolean |
isPresent()
verifies if node is still present.
|
void |
performAPIAction(String systemActionClass)
performs action on node through API menu
|
void |
performAPIActionNoBlock(String systemActionClass)
performs action on node through API menu
|
void |
performMenuAction(String menuPath)
performs action on node through main menu
|
void |
performMenuActionNoBlock(String menuPath)
performs action on node through main menu
|
void |
performPopupAction(String popupPath)
performs action on node through popup menu
|
void |
performPopupActionNoBlock(String popupPath)
performs action on node through popup menu
|
void |
select()
selects node
|
void |
setComparator(org.netbeans.jemmy.operators.Operator.StringComparator comparator)
Sets comparator for this node.
|
org.netbeans.jemmy.operators.JTreeOperator |
tree()
getter for JTreeOperator of tree where node lives
|
void |
verifyPopup(Action[] actions)
verifies node's popup paths (of all actions) for presence (without
invocation)
|
void |
verifyPopup(String popupPath)
verifies node's popup path for presence (without invocation)
|
void |
verifyPopup(String[] popupPaths)
verifies node's popup paths for presence (without invocation)
|
void |
waitChildNotPresent(String childName)
Waits until child with specified name is not present under this node.
|
void |
waitCollapsed()
Waits for node to be collapsed
|
void |
waitExpanded()
Waits for node to be expanded
|
void |
waitNotPresent()
Waits until this node is no longer present.
|
protected org.netbeans.jemmy.operators.JTreeOperator treeOperator
protected TreePath treePath
protected String stringPath
public Node(org.netbeans.jemmy.operators.JTreeOperator treeOperator, String treePath)
treeOperator
- JTreeOperator of tree where node livestreePath
- String tree path of nodepublic Node(org.netbeans.jemmy.operators.JTreeOperator treeOperator, String treePath, String indexes)
treeOperator
- JTreeOperator of tree where node livestreePath
- String tree path of nodeindexes
- String list of indexes of nodes in each levelpublic Node(Node parent, String treeSubPath)
parent
- parent NodetreeSubPath
- String tree sub-path from parentpublic Node(Node parent, int childIndex)
parent
- parent NodechildIndex
- int index of child under parent nodepublic Node(org.netbeans.jemmy.operators.JTreeOperator treeOperator, TreePath path)
treeOperator
- JTreeOperator of tree where node livespath
- TreePath of nodepublic void setComparator(org.netbeans.jemmy.operators.Operator.StringComparator comparator)
comparator
- new comparator to be set (e.g. new
Operator.DefaultStringComparator(true, true); to search string item
exactly and case sensitive)public org.netbeans.jemmy.operators.Operator.StringComparator getComparator()
public org.netbeans.jemmy.operators.JTreeOperator tree()
public TreePath getTreePath()
public String getText()
public String getPath()
public String getParentPath()
public Object getOpenideNode()
public org.netbeans.jemmy.operators.JPopupMenuOperator callPopup()
public void performMenuAction(String menuPath)
menuPath
- main menu path of actionpublic void performPopupAction(String popupPath)
popupPath
- popup menu path of actionpublic void performAPIAction(String systemActionClass)
systemActionClass
- String class name of SystemAction (use null
value if API mode is not supported)public void performMenuActionNoBlock(String menuPath)
menuPath
- main menu path of actionpublic void performPopupActionNoBlock(String popupPath)
popupPath
- popup menu path of actionpublic void performAPIActionNoBlock(String systemActionClass)
systemActionClass
- String class name of SystemAction (use null
value if API mode is not supported)public void select()
public void addSelectionPath()
public boolean isLeaf()
public String[] getChildren()
public boolean isLink()
public boolean isPresent()
public void verifyPopup(String popupPath)
popupPath
- String popup pathpublic void verifyPopup(String[] popupPaths)
popupPaths
- String[] popup pathspublic void expand()
public void collapse()
public void waitExpanded()
public void waitCollapsed()
public boolean isExpanded()
public boolean isCollapsed()
public void verifyPopup(Action[] actions)
actions
- array of actions to be verifiedpublic boolean isChildPresent(String childName)
childName
- name of child nodepublic void waitChildNotPresent(String childName)
childName
- name of child nodepublic void waitNotPresent()