|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jubula.rc.swing.swing.implclasses.AbstractSwingImplClass
org.eclipse.jubula.rc.swing.swing.implclasses.JTreeImplClass
public class JTreeImplClass
This class implements actions on the Swing JTree.
Field Summary | |
---|---|
static int |
NO_PRE_ASCEND
Constant for no pre-ascend |
Fields inherited from class org.eclipse.jubula.rc.swing.swing.implclasses.AbstractSwingImplClass |
---|
INDEX_LIST_SEP_CHAR, POS_UNI_PERCENT, POS_UNIT_PIXEL, RENDERER_FALLBACK_TEXT_GETTER_METHOD_1, RENDERER_FALLBACK_TEXT_GETTER_METHOD_2, VALUE_SEPARATOR |
Constructor Summary | |
---|---|
JTreeImplClass()
|
Method Summary | |
---|---|
void |
gdClick(int count,
int button)
Clicks the tree. |
void |
gdCollapse(java.lang.String pathType,
int preAscend,
java.lang.String treePath,
java.lang.String operator)
Collapses the JTree. |
void |
gdCollapseByIndices(java.lang.String pathType,
int preAscend,
java.lang.String indexPath)
Collapses the tree. |
void |
gdDragByIndexPath(int mouseButton,
java.lang.String modifier,
java.lang.String pathType,
int preAscend,
java.lang.String indexPath)
Drags the node of the given indexPath. |
void |
gdDragByTextPath(int mouseButton,
java.lang.String modifier,
java.lang.String pathType,
int preAscend,
java.lang.String treePath,
java.lang.String operator)
Drags the node of the given treePath. |
void |
gdDropByIndexPath(java.lang.String pathType,
int preAscend,
java.lang.String indexPath,
int delayBeforeDrop)
Drops the before dragged object on the given indexPath. |
void |
gdDropByTextPath(java.lang.String pathType,
int preAscend,
java.lang.String treePath,
java.lang.String operator,
int delayBeforeDrop)
Drops the before dragged object on the given treePath. |
void |
gdExpand(java.lang.String pathType,
int preAscend,
java.lang.String treePath,
java.lang.String operator)
Expands the JTree. |
void |
gdExpandByIndices(java.lang.String pathType,
int preAscend,
java.lang.String indexPath)
Expands the tree. |
void |
gdMove(java.lang.String direction,
int distance,
int clickCount)
Selects a node relative to the currently selected node. |
void |
gdPopupByIndexPathAtIndexNode(java.lang.String treeIndexPath,
java.lang.String popupIndexPath)
Deprecated. will be removed! |
void |
gdPopupByIndexPathAtSelectedNode(java.lang.String indexPath)
Deprecated. will be removed! |
void |
gdPopupByIndexPathAtTextNode(java.lang.String treeTextPath,
java.lang.String operator,
java.lang.String popupIndexPath)
Deprecated. will be removed! |
void |
gdPopupByTextPathAtIndexNode(java.lang.String treeIndexPath,
java.lang.String popupTextPath)
Deprecated. will be removed! |
void |
gdPopupByTextPathAtSelectedNode(java.lang.String textPath)
Deprecated. will be removed! |
void |
gdPopupByTextPathAtTextNode(java.lang.String treeTextPath,
java.lang.String operator,
java.lang.String popupIndexPath)
Deprecated. will be removed! |
void |
gdSelect(java.lang.String pathType,
int preAscend,
java.lang.String treePath,
java.lang.String operator,
int clickCount,
int button,
java.lang.String extendSelection)
Selects the node at the end of the treepath . |
void |
gdSelectByIndices(java.lang.String pathType,
int preAscend,
java.lang.String indexPath,
int clickCount,
int button,
java.lang.String extendSelection)
Selects the last node of the path given by indexPath |
java.lang.String |
gdStoreSelectedNodeValue(java.lang.String variable)
|
java.lang.String |
gdStoreValueAtMousePosition(java.lang.String variable)
|
void |
gdVerifyPath(java.lang.String pathType,
int preAscend,
java.lang.String treePath,
java.lang.String operator,
boolean exists)
Tests whether the given treePath exists or not |
void |
gdVerifyPathByIndices(java.lang.String pathType,
int preAscend,
java.lang.String treePath,
boolean exists)
Tests whether the given treePath exists or not |
void |
gdVerifySelectedValue(java.lang.String selection)
Verifies whether the first selection in the tree has a rendered text that is equal to selection . |
void |
gdVerifySelectedValue(java.lang.String pattern,
java.lang.String operator)
Verifies whether the first selection in the tree has a rendered text that is equal to pattern . |
void |
gdVerifyTextAtMousePosition(java.lang.String pattern,
java.lang.String operator)
|
javax.swing.JComponent |
getComponent()
|
protected java.lang.String |
getText()
Get a String representation of the "text" of the component. |
java.lang.String[] |
getTextArrayFromComponent()
Returns a descriptive text array that represents the given gui component. |
void |
setComponent(java.lang.Object graphicsComponent)
Set the component the methods this implementation class implements have to work with. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NO_PRE_ASCEND
Constructor Detail |
---|
public JTreeImplClass()
Method Detail |
---|
public void setComponent(java.lang.Object graphicsComponent)
graphicsComponent
- the component from the AUT control
affects
the AUT.public javax.swing.JComponent getComponent()
getComponent
in class AbstractSwingImplClass
IBaseImplementationClass.setComponent(Object)
public void gdExpand(java.lang.String pathType, int preAscend, java.lang.String treePath, java.lang.String operator) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
Expands the JTree. Any node defined by the passed tree path is expanded, if it is collapsed. The node is expanded by performing a double click onto the node. If the node is already expanded, the JTree is left unchanged. The tree path is a slash-seperated list of nodes that specifies a valid top-down path in the JTree.
An example: Say the passed tree path isanimals/birds/kakadu
.
To get a valid expansion, the JTree has to look as follows:
animals | - -- birds | - -- kakadu
animals
is the JTree's root node, if the root node has
been set to visible by calling JTree#setRootVisible(true)
,
or it is one of the root node's children, if the root node has been set
to invisible by calling JTree#setRootVisible(false)
.
It is important to know that the tree path entries have to match the rendered node texts, but not the underlying user object data etc.
pathType
- whether the path is relative or absolutepreAscend
- Relative traversals will start this many parent nodes
above the current node. Absolute traversals ignore this
parameter.treePath
- The tree path.operator
- If regular expressions are used to determine the tree path
org.eclipse.jubula.rc.common.exception.StepExecutionException
- If the tree path is invalid or the double click fails.public void gdExpandByIndices(java.lang.String pathType, int preAscend, java.lang.String indexPath) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
gdExpand(String, int, String, String)
, but
expects an enumeration of indices representing the top-down tree path.
Any index is the node's position at the current tree level.
pathType
- whether the path is relative or absolutepreAscend
- Relative traversals will start this many parent nodes
above the current node. Absolute traversals ignore this
parameter.indexPath
- The index path
org.eclipse.jubula.rc.common.exception.StepExecutionException
- If the tree path is invalid or the double-click fails.public void gdCollapse(java.lang.String pathType, int preAscend, java.lang.String treePath, java.lang.String operator) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
pathType
- whether the path is relative or absolutepreAscend
- Relative traversals will start this many parent nodes
above the current node. Absolute traversals ignore this
parameter.treePath
- The tree path.operator
- Whether regular expressions are used to determine the tree path.
"matches"
for regex, "equals"
for simple matching.
org.eclipse.jubula.rc.common.exception.StepExecutionException
- If the tree path is invalid or the double click to collapse
the node fails.public void gdCollapseByIndices(java.lang.String pathType, int preAscend, java.lang.String indexPath) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
gdCollapse(String, int, String, String)
,
but expects an enumeration of indices representing the top-down tree
path. Any index is the node's position at the current tree level.
pathType
- whether the path is relative or absolutepreAscend
- Relative traversals will start this many parent nodes
above the current node. Absolute traversals ignore this
parameter.indexPath
- The index path
org.eclipse.jubula.rc.common.exception.StepExecutionException
- If the tree path is invalid or the double-click to collapse
the node fails.public void gdMove(java.lang.String direction, int distance, int clickCount) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
direction
- the direction to move.
directions:
UP - Navigates through parents
DOWN - Navigates through children
NEXT - Navigates to next sibling
PREVIOUS - Navigates to previous siblingdistance
- the distance to moveclickCount
- the click count to select the new cell.
org.eclipse.jubula.rc.common.exception.StepExecutionException
- if any error occurspublic void gdSelect(java.lang.String pathType, int preAscend, java.lang.String treePath, java.lang.String operator, int clickCount, int button, java.lang.String extendSelection) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
treepath
.
pathType
- whether the path is relative or absolutepreAscend
- Relative traversals will start this many parent nodes
above the current node. Absolute traversals ignore this
parameter.treePath
- The tree path.operator
- If regular expressions are used to match the tree pathclickCount
- the click countbutton
- what mouse button should be usedextendSelection
- Whether this selection extends a previous
selection.
org.eclipse.jubula.rc.common.exception.StepExecutionException
- If the tree path is invalid, if the
double-click to expand the node fails, or if the selection is invalid.public void gdSelectByIndices(java.lang.String pathType, int preAscend, java.lang.String indexPath, int clickCount, int button, java.lang.String extendSelection) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
indexPath
pathType
- whether the path is relative or absolutepreAscend
- Relative traversals will start this many parent nodes
above the current node. Absolute traversals ignore this
parameter.indexPath
- the index pathclickCount
- the number of times to clickbutton
- what mouse button should be usedextendSelection
- Whether this selection extends a previous
selection.
org.eclipse.jubula.rc.common.exception.StepExecutionException
- if indexPath
is not a valid
pathpublic void gdVerifySelectedValue(java.lang.String selection) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
selection
.
selection
- The selection to verify
org.eclipse.jubula.rc.common.exception.StepExecutionException
- If no node is selected or the verification fails.public void gdVerifySelectedValue(java.lang.String pattern, java.lang.String operator) throws org.eclipse.jubula.rc.common.exception.StepExecutionException
pattern
.
pattern
- The expected textoperator
- The operator to use when comparing the expected and
actual values.
org.eclipse.jubula.rc.common.exception.StepExecutionException
- If no node is selected or the verification fails.public void gdVerifyPath(java.lang.String pathType, int preAscend, java.lang.String treePath, java.lang.String operator, boolean exists)
pathType
- whether the path is relative or absolutepreAscend
- Relative traversals will start this many parent nodes
above the current node. Absolute traversals ignore this
parameter.treePath
- the path to checkoperator
- the RegEx operatorexists
- if true, the verify succeeds if the path DOES exist.
If false, the verify succeeds if the path DOES NOT exist.public void gdVerifyPathByIndices(java.lang.String pathType, int preAscend, java.lang.String treePath, boolean exists)
pathType
- whether the path is relative or absolutepreAscend
- Relative traversals will start this many parent nodes
above the current node. Absolute traversals ignore this
parameter.treePath
- the path to checkexists
- if true, the verify succeeds if the path DOES exist.
If false, the verify succeeds if the path DOES NOT exist.public void gdClick(int count, int button)
gdClick
in class AbstractSwingImplClass
count
- Number of mouse clicksbutton
- Pressed buttonpublic void gdPopupByIndexPathAtSelectedNode(java.lang.String indexPath)
indexPath
- the index pathpublic void gdPopupByTextPathAtSelectedNode(java.lang.String textPath)
textPath
- the pathpublic void gdPopupByIndexPathAtIndexNode(java.lang.String treeIndexPath, java.lang.String popupIndexPath)
treeIndexPath
- path to the nodepopupIndexPath
- path to the menu itempublic void gdPopupByTextPathAtIndexNode(java.lang.String treeIndexPath, java.lang.String popupTextPath)
treeIndexPath
- path to the nodepopupTextPath
- path to the menu itempublic void gdPopupByIndexPathAtTextNode(java.lang.String treeTextPath, java.lang.String operator, java.lang.String popupIndexPath)
treeTextPath
- path to the nodeoperator
- if the path uses regular expressionspopupIndexPath
- path to the menu itempublic void gdPopupByTextPathAtTextNode(java.lang.String treeTextPath, java.lang.String operator, java.lang.String popupIndexPath)
treeTextPath
- path to the nodeoperator
- if the path uses regular expressionspopupIndexPath
- path to the menu itempublic void gdDragByTextPath(int mouseButton, java.lang.String modifier, java.lang.String pathType, int preAscend, java.lang.String treePath, java.lang.String operator)
mouseButton
- the mouse button to press.modifier
- the modifier to press.pathType
- whether the path is relative or absolutepreAscend
- Relative traversals will start this many parent nodes
above the current node. Absolute traversals ignore this
parameter.treePath
- The tree path.operator
- If regular expressions are used to match the tree pathpublic void gdDropByTextPath(java.lang.String pathType, int preAscend, java.lang.String treePath, java.lang.String operator, int delayBeforeDrop)
pathType
- whether the path is relative or absolutepreAscend
- Relative traversals will start this many parent nodes
above the current node. Absolute traversals ignore this
parameter.treePath
- The tree path.operator
- If regular expressions are used to match the tree pathdelayBeforeDrop
- the amount of time (in milliseconds) to wait
between moving the mouse to the drop point and
releasing the mouse buttonpublic void gdDragByIndexPath(int mouseButton, java.lang.String modifier, java.lang.String pathType, int preAscend, java.lang.String indexPath)
mouseButton
- the mouse button to press.modifier
- the modifier to press.pathType
- whether the path is relative or absolutepreAscend
- Relative traversals will start this many parent nodes
above the current node. Absolute traversals ignore this
parameter.indexPath
- The index path.public void gdDropByIndexPath(java.lang.String pathType, int preAscend, java.lang.String indexPath, int delayBeforeDrop)
pathType
- whether the path is relative or absolutepreAscend
- Relative traversals will start this many parent nodes
above the current node. Absolute traversals ignore this
parameter.indexPath
- The index path.delayBeforeDrop
- the amount of time (in milliseconds) to wait
between moving the mouse to the drop point and
releasing the mouse buttonpublic java.lang.String[] getTextArrayFromComponent()
protected java.lang.String getText()
AbstractSwingImplClass
getText
in class AbstractSwingImplClass
AbstractSwingImplClass.getText()
public void gdVerifyTextAtMousePosition(java.lang.String pattern, java.lang.String operator)
public java.lang.String gdStoreSelectedNodeValue(java.lang.String variable)
public java.lang.String gdStoreValueAtMousePosition(java.lang.String variable)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |