org.netbeans.modules.jellytools.platform/3 3.13

org.netbeans.jellytools.nodes
Class Node

java.lang.Object
  extended by org.netbeans.jellytools.nodes.Node
Direct Known Subclasses:
HTMLNode, UnrecognizedNode

public class Node
extends Object

Ancestor class for all nodes.

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);
 


Field Summary
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 Summary
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
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

treeOperator

protected org.netbeans.jemmy.operators.JTreeOperator treeOperator
JTreeOperator of tree where node lives


treePath

protected TreePath treePath
TreePath of node


stringPath

protected String stringPath
Path of node names representing this node.

Constructor Detail

Node

public Node(org.netbeans.jemmy.operators.JTreeOperator treeOperator,
            String treePath)
creates new Node instance

Parameters:
treeOperator - JTreeOperator of tree where node lives
treePath - String tree path of node

Node

public Node(org.netbeans.jemmy.operators.JTreeOperator treeOperator,
            String treePath,
            String indexes)
creates new Node instance

Parameters:
treeOperator - JTreeOperator of tree where node lives
treePath - String tree path of node
indexes - String list of indexes of nodes in each level

Node

public Node(Node parent,
            String treeSubPath)
creates new Node instance

Parameters:
parent - parent Node
treeSubPath - String tree sub-path from parent

Node

public Node(Node parent,
            int childIndex)
creates new Node instance

Parameters:
parent - parent Node
childIndex - int index of child under parent node

Node

public Node(org.netbeans.jemmy.operators.JTreeOperator treeOperator,
            TreePath path)
creates new Node instance

Parameters:
treeOperator - JTreeOperator of tree where node lives
path - TreePath of node
Method Detail

setComparator

public void setComparator(org.netbeans.jemmy.operators.Operator.StringComparator comparator)
Sets comparator for this node. Comparator is used for all methods after this method is called.

Parameters:
comparator - new comparator to be set (e.g. new Operator.DefaultStringComparator(true, true); to search string item exactly and case sensitive)

getComparator

public org.netbeans.jemmy.operators.Operator.StringComparator getComparator()
Gets comparator for this node instance.

Returns:
comparator for this node instance.

tree

public org.netbeans.jemmy.operators.JTreeOperator tree()
getter for JTreeOperator of tree where node lives

Returns:
JTreeOperator of tree where node lives

getTreePath

public TreePath getTreePath()
Getter for TreePath of node.

Returns:
TreePath of node

getText

public String getText()
getter for node text

Returns:
String node text

getPath

public String getPath()
getter for node path

Returns:
String node path

getParentPath

public String getParentPath()
getter for path of parent node

Returns:
String path of parent node

getOpenideNode

public Object getOpenideNode()
Returns Object instance which represents org.openide.nodes.Node for this jellytools node.

Returns:
Object instance which represents org.openide.nodes.Node

callPopup

public org.netbeans.jemmy.operators.JPopupMenuOperator callPopup()
calls popup menu on node

Returns:
JPopupMenuOperator

performMenuAction

public void performMenuAction(String menuPath)
performs action on node through main menu

Parameters:
menuPath - main menu path of action

performPopupAction

public void performPopupAction(String popupPath)
performs action on node through popup menu

Parameters:
popupPath - popup menu path of action

performAPIAction

public void performAPIAction(String systemActionClass)
performs action on node through API menu

Parameters:
systemActionClass - String class name of SystemAction (use null value if API mode is not supported)

performMenuActionNoBlock

public void performMenuActionNoBlock(String menuPath)
performs action on node through main menu

Parameters:
menuPath - main menu path of action

performPopupActionNoBlock

public void performPopupActionNoBlock(String popupPath)
performs action on node through popup menu

Parameters:
popupPath - popup menu path of action

performAPIActionNoBlock

public void performAPIActionNoBlock(String systemActionClass)
performs action on node through API menu

Parameters:
systemActionClass - String class name of SystemAction (use null value if API mode is not supported)

select

public void select()
selects node


addSelectionPath

public void addSelectionPath()
adds node into set of selected nodes


isLeaf

public boolean isLeaf()
tests if node is leaf

Returns:
boolean true when node does not have children

getChildren

public String[] getChildren()
returns list of names of children

Returns:
String[] list of names of children

isLink

public boolean isLink()
determines if current node is link

Returns:
boolean true if node is link

isPresent

public boolean isPresent()
verifies if node is still present. It expands parent path of the node during verification.

Returns:
boolean true when node is still present

verifyPopup

public void verifyPopup(String popupPath)
verifies node's popup path for presence (without invocation)

Parameters:
popupPath - String popup path

verifyPopup

public void verifyPopup(String[] popupPaths)
verifies node's popup paths for presence (without invocation)

Parameters:
popupPaths - String[] popup paths

expand

public void expand()
Expands current node to see children


collapse

public void collapse()
Collapse current node to hide children


waitExpanded

public void waitExpanded()
Waits for node to be expanded


waitCollapsed

public void waitCollapsed()
Waits for node to be collapsed


isExpanded

public boolean isExpanded()
Informs if current node is expanded

Returns:
boolean true when node is expanded

isCollapsed

public boolean isCollapsed()
Informs if current node is collapsed

Returns:
boolean true when node is collapsed

verifyPopup

public void verifyPopup(Action[] actions)
verifies node's popup paths (of all actions) for presence (without invocation)

Parameters:
actions - array of actions to be verified

isChildPresent

public boolean isChildPresent(String childName)
Checks whether child with specified name is present under this node.

Parameters:
childName - name of child node
Returns:
true if child is present; false otherwise

waitChildNotPresent

public void waitChildNotPresent(String childName)
Waits until child with specified name is not present under this node. It can throw TimeoutExpiredException, if child is still present.

Parameters:
childName - name of child node

waitNotPresent

public void waitNotPresent()
Waits until this node is no longer present. It can throw TimeoutExpiredException, if the node is still present.


org.netbeans.modules.jellytools.platform/3 3.13

Built on May 22 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.