IBM Rational Functional Tester
Version 8.1.1000
IBM Rational Functional Tester Proxy SDK Reference

Project Version 2.3

com.rational.test.ft.domain.java.swt
Class TreeProxy

java.lang.Object   extended by com.rational.test.ft.sys.RegisteredObject       extended by com.rational.test.ft.domain.ProxyTestObject
          extended by com.rational.test.ft.domain.java.JavaProxy
              extended by com.rational.test.ft.domain.java.JavaGuiProxy
                  extended by com.rational.test.ft.domain.java.swt.ControlProxy
                      extended by com.rational.test.ft.domain.java.swt.ScrollableProxy
                          extended by com.rational.test.ft.domain.java.swt.ScrollableSwtGraphicalSubitemProxy
                              extended by com.rational.test.ft.domain.java.swt.TreeProxy
All Implemented Interfaces:
IChannelObject, IDataDriven, IProxyBase, IPropertyFilter, com.rational.test.ft.object.interfaces.IGraphical, com.rational.test.ft.object.interfaces.IGraphicalSubitem, com.rational.test.ft.object.interfaces.IScrollable, com.rational.test.ft.object.interfaces.ISubitem

public class TreeProxy
extends ScrollableSwtGraphicalSubitemProxy
implements com.rational.test.ft.object.interfaces.ISubitem

This is the proxy class for org.eclipse.swt.widgets.Tree.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.rational.test.ft.domain.java.swt.ControlProxy
ControlProxy.ChildEnumerator, ControlProxy.ImmediateChildEnumerator
 
Field Summary
 
Fields inherited from class com.rational.test.ft.domain.java.swt.ControlProxy
childrenEnumerated, CLASSINDEX, CLASSINDEXWEIGHT, clickArgs, currentMethod, GROUPTEXT, GROUPTEXTWEIGHT, HANDLE, MAPPABLECLASSINDEX, MAPPABLECLASSINDEXWEIGHT, MAX_NAME, predownScreenRect, PRIORLABEL, PRIORLABELWEIGHT, TOOLTIPTEXT, TOOLTIPTEXTWEIGHT
 
Fields inherited from class com.rational.test.ft.domain.java.JavaGuiProxy
LEFT, preDownState, processMouseEventHandler, ROLEINDEX, ROLEINDEXWEIGHT, TESTDATA_SPECIALFRAMESTATE, TESTDATA_SPECIALFRAMESTATE_DESCRIPTION, topLevelWindow
 
Fields inherited from class com.rational.test.ft.domain.java.JavaProxy
debug, uniqueId
 
Fields inherited from class com.rational.test.ft.domain.ProxyTestObject
BROWSERTABTESTOBJECT_CLASSNAME, BROWSERTESTOBJECT_CLASSNAME, COLORDIALOGTESTOBJECT_CLASSNAME, CROSSDOMAINCONTAINER_CLASSNAME, DOCUMENTTESTOBJECT_CLASSNAME, DOMAINTESTOBJECT_CLASSNAME, ECLIPSETOPLEVELTESTOBJECT_CLASSNAME, EMBEDDEDBROWSERTESTOBJECT_CLASSNAME, FILEDIALOGTESTOBJECT_CLASSNAME, FRAMESUBITEMTESTOBJECT_CLASSNAME, FRAMETESTOBJECT_CLASSNAME, GEFEDITPARTTESTOBJECT_CLASSNAME, GUISUBITEMTESTOBJECT_CLASSNAME, GUITESTOBJECT_CLASSNAME, INTERNALFRAMETESTOBJECT_CLASSNAME, MESSAGEBOXTESTOBJECT_CLASSNAME, PALETTEGUISUBITEMTESTOBJECT_CLASSNAME, PROCESSTESTOBJECT_CLASSNAME, SCROLLSUBITEMTESTOBJECT_CLASSNAME, SCROLLTESTOBJECT_CLASSNAME, SELECTGUISUBITEMTESTOBJECT_CLASSNAME, SELECTSCROLLGUISUBITEMTESTOBJECT_CLASSNAME, SHELLTESTOBJECT_CLASSNAME, STATELESSGUISUBITEMTESTOBJECT_CLASSNAME, SUBITEMTESTOBJECT_CLASSNAME, TABITEMTESTOBJECT_CLASSNAME, TESTOBJECT_CLASSNAME, TEXTGUISUBITEMTESTOBJECT_CLASSNAME, TEXTGUITESTOBJECT_CLASSNAME, TEXTSCROLLTESTOBJECT_CLASSNAME, TEXTSELECTGUISUBITEMTESTOBJECT_CLASSNAME, TOGGLEGUITESTOBJECT_CLASSNAME, TOGGLETESTOBJECT_CLASSNAME, TOPLEVELSUBITEMTESTOBJECT_CLASSNAME, TOPLEVELTESTOBJECT_CLASSNAME, TRACKBARTESTOBJECT_CLASSNAME, vomClippedRectangle
 
Fields inherited from class com.rational.test.ft.sys.RegisteredObject
theTestObject
 
Fields inherited from interface com.rational.test.ft.domain.IDataDriven
INCLUDE_ALL, INCLUDE_JUSTOBJECT, INCLUDE_SIBLINGS
 
Constructor Summary
TreeProxy(java.lang.Object theObjectInTheSUT)
          This sole constructor for all proxy objects sets the SUT object as a member variable for the proxy.
 
Method Summary
 void addCell(java.util.Vector args, com.rational.test.ft.script.List pathList, int columnIndex)
           
 void addCellAndPoint(java.util.Vector args, TreeItem node, java.awt.Point pt)
           
 void addHeader(java.util.Vector args, java.awt.Point pt, java.lang.String colName)
           
protected  boolean allowsMultipleSelections()
          true is returned if the tree component being evaluated allows multiple nodes to be selected at the same time.
protected  void checkNode(java.lang.Object node)
          Sets the checked state of the tree item.
 void click(com.rational.test.ft.script.Subitem subitem)
          Left mouse click on the center point of the associated subitem.
protected  void collapseNode(java.lang.Object node)
          Set the state of the specified node to be collapsed (such that the child nodes are not visible).
protected  void deselectNode(java.lang.Object node)
           
protected  void expandNode(java.lang.Object node)
          Set the state of the specified node to be expanded (such that the child nodes are visible).
protected  void extendSelectNode(java.lang.Object node)
           
protected  boolean getCheckable()
           
protected  com.rational.test.ft.script.State getCheckState(java.lang.Object node)
           
protected  TreeItem getClosestTreeItem(java.awt.Point pt)
           
protected  java.awt.Rectangle getImageRectangle(org.eclipse.swt.graphics.Image image)
           
 java.awt.Point getLocationOnScreen()
          Return the location on the screen for an swt control
protected  com.rational.test.ft.script.Subitem[] getPath(TreeItem item)
           
protected  java.awt.Point getPointToColumn(TreeItem treeItem, java.awt.Point pt)
           
protected  java.awt.Point getPointToRow(TreeItem treeItem, java.awt.Point pt)
           
 java.lang.Object getProperty(java.lang.String propertyName)
          Get the value for a specific property.
 java.lang.String getRole()
          Returns TestObjectRole.ROLE_TREE.
 java.awt.Point getScreenPoint(com.rational.test.ft.script.Subitem subitem)
          Returns the screen relative point to the center of the supplied subitem.
 java.awt.Rectangle getScreenRectangle(com.rational.test.ft.script.Subitem subitem)
          Returns the rectangle that contains the component being evaluated relative to the top left corner of the screen.
protected  com.rational.test.ft.script.Action getState(java.lang.Object node)
           
 java.lang.Object getSubitem(com.rational.test.ft.script.Subitem subitem)
          Returns an object that represents the specified subitem in the associated test object.
 com.rational.test.ft.vp.ITestData getTestData(java.lang.String testDataType)
          This method constructs the specified verification data object.
 java.util.Hashtable getTestDataTypes()
          Returns a hashtable of data type descriptions of the verification point data available with the associated object in the SUT.
 java.lang.String getText(TreeItem item)
           
protected  java.awt.Rectangle getTreeColumnRectangle(TreeItem item, int columnIndex)
           
protected  java.awt.Rectangle getTreeItemRectangle(TreeItem item)
           
protected  boolean hasDuplicateChildren(TreeItem path, java.lang.String node)
           
 void hScrollTo(int value)
          This method scrolls the control horizontally.
protected  boolean isChecked(java.lang.Object node)
           
 boolean isCollapsed(java.lang.Object node)
           
 boolean isExpanded(java.lang.Object node)
           
protected  boolean isGrayed(java.lang.Object node)
           
protected  boolean isPointInClientArea(java.awt.Point pt)
           
 boolean isSelected(java.lang.Object node)
           
 void processSingleMouseEvent(IMouseActionInfo action)
           
 void scrollLineLeftForUnix()
           
 void scrollLineRightForUnix()
           
protected  void selectNode(java.lang.Object node)
          Set the state of the specified node to be selected.
 void setScrollWidth()
           
 void setState(com.rational.test.ft.script.Action action, com.rational.test.ft.script.Subitem item)
          This method performs a specific action against the subitem.
 void setState(com.rational.test.ft.script.Action action, com.rational.test.ft.script.Subitem start, com.rational.test.ft.script.Subitem end)
          This method performs a specific action against the subitem range defined by the specified indices.
protected  void unCheckNode(java.lang.Object node)
          Sets the unchecked state of the tree item.
 com.rational.test.ft.vp.ITestData updateTestData(java.lang.String testDataType, com.rational.test.ft.vp.ITestData testData)
          This method updates the supplied test data object and returns it.
 
Methods inherited from class com.rational.test.ft.domain.java.swt.ScrollableSwtGraphicalSubitemProxy
click, click, click, doubleClick, doubleClick, doubleClick, doubleClick, drag, drag, drag, drag, drag, drag, dragToScreenPoint, dragToScreenPoint, dragToScreenPoint, dragToScreenPoint, getScreenPoint, getTestObjectClassName, hover, hover, hover, hover, mouseMove, mouseMove, mouseMove, mouseMove, nClick, nClickDrag, nClickDrag, nClickDragToScreenPoint, nClickDragToScreenPoint, scrollLineDown, scrollLineLeft, scrollLineRight, scrollLineUp, scrollPageDown, scrollPageLeft, scrollPageRight, scrollPageUp, setState, vScrollTo
 
Methods inherited from class com.rational.test.ft.domain.java.swt.ScrollableProxy
canBeScrolled, getClientArea, getHorizontalBar, getVerticalBar, hScroll, isHorizontalScrollable, isScrollable, isVerticalScrollable, scrollRectToVisible, vScroll
 
Methods inherited from class com.rational.test.ft.domain.java.swt.ControlProxy
childConstructed, getActionArgs, getChannel, getChildProxy, getChildrenEnumeration, getClippedScreenRectangle, getDefaultActionArgs, getDescriptiveName, getHandle, getImmediateChildren, getLabelText, getLeadingLabel, getMappableParent, getName, getOwnedObjects, getOwner, getParent, getParentObject, getReorderedChildren, getScreenRectangle, getStyle, getToolTipText, getTopMappableParent, getTopParent, getVisualClippedRectangle, hasFocus, isEnabled, isGTK, isLabelled, isObjectMoved, isShell, isShowing, processHoverMouseEvent, processPreDownMouseEvent, processPreUpMouseEvent, setClickArgs, setDownPointArgs, setDrag, setMethodSpecification, setMultiClickAction, setRecordCache
 
Methods inherited from class com.rational.test.ft.domain.java.JavaGuiProxy
activateTopWindow, click, click, click, click, doubleClick, doubleClick, doubleClick, doubleClick, drag, drag, drag, drag, dragToScreenPoint, dragToScreenPoint, dragToScreenPoint, dumpAction, ensureObjectIsVisible, getActionRect, getCachedRectX, getCachedRectY, getChildAtPoint, getClippedRect, getMethodSpecForPoint, getProcessMouseEventHandler, getRegisteredTopLevelWindow, getScreenPoint, getScreenPoint, getScriptCommandFlags, getTopMappableWindow, getTopWindow, hover, hover, hover, hover, isDrag, isOpaque, isPointInObject, isPointInObject, modifiersChanged, mouseMove, mouseMove, nClick, nClickDrag, nClickDragToScreenPoint, processMouseEvent, setProcessMouseEventHandler, setTopLevelWindow, shouldBeMapped
 
Methods inherited from class com.rational.test.ft.domain.java.JavaProxy
addMappableChildrenToVector, addRecognitionProperty, allowProperty, getAddedRecognitionPropertyValue, getChildren, getIndexer, getIndexers, getMappableChildren, getMethods, getNonValueProperties, getProperties, getRecognitionProperties, getRecognitionPropertyWeight, getStandardProperties, getTestDomain, getUniqueId, getVisualClippableParent, hasAddedRecognitionProperties, isRecognitionProperty, setIndexer, setProperty
 
Methods inherited from class com.rational.test.ft.domain.ProxyTestObject
addDataDrivableCommands, baseClassMatch, canTakeVP, equals, findChildrenWithProperties, findChildrenWithPropertiesAndInvoke, getChildren, getDataDrivableCommand, getDataDrivableCommands, getField, getIgnorableProperties, getMappableChildren, getMappableParent, getObjectClassName, getObjectCustomClassName, getOwnedObjects, getParent, getProxy, getScriptCommandAnchor, getVisualMappableChildren, getVisualTopParent, getVOMSpecificProperty, hasSpecialFrameState, isClassIndexConsidered, isSameObject, isValidObject, ping, suppressKeyAction
 
Methods inherited from class com.rational.test.ft.sys.RegisteredObject
addProxyReference, dereference, getObject, getRegisteredId, getTransactionId, isReferenced, isReleaseRequired, register, registerTransiently, release, toString, unregister
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.rational.test.ft.object.interfaces.ISubitem
setState
 

Constructor Detail

TreeProxy

public TreeProxy(java.lang.Object theObjectInTheSUT)
This sole constructor for all proxy objects sets the SUT object as a member variable for the proxy. All interactions with the supplied object are performed through this class.

Method Detail

getRole

public java.lang.String getRole()
Returns TestObjectRole.ROLE_TREE.

Overrides:
getRole in class ControlProxy
Returns:
A brief type name that describes the role this object plays in the UI.
Since:
RFT1.0

getSubitem

public java.lang.Object getSubitem(com.rational.test.ft.script.Subitem subitem)
Returns an object that represents the specified subitem in the associated test object. SubitemNotFoundException will be thrown if the specified subitem is invalid relative to the associated test object. null may be returned if the subitem does not have an object association that can be returned.

Specified by:
getSubitem in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
Specified by:
getSubitem in class ScrollableSwtGraphicalSubitemProxy
Parameters:
subitem - The subitem to fetch an object for.
Returns:
An object representation of the subitem.

getClosestTreeItem

protected TreeItem getClosestTreeItem(java.awt.Point pt)

getPointToColumn

protected java.awt.Point getPointToColumn(TreeItem treeItem,                                           java.awt.Point pt)

getPointToRow

protected java.awt.Point getPointToRow(TreeItem treeItem,                                        java.awt.Point pt)

getPath

protected com.rational.test.ft.script.Subitem[] getPath(TreeItem item)

isChecked

protected boolean isChecked(java.lang.Object node)

isGrayed

protected boolean isGrayed(java.lang.Object node)

click

public void click(com.rational.test.ft.script.Subitem subitem)
Description copied from class: ScrollableSwtGraphicalSubitemProxy
Left mouse click on the center point of the associated subitem. This method is a simple shortcut to the click method with a modifier parameter (modifier set to MOUSE_LEFT).

Specified by:
click in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
Overrides:
click in class ScrollableSwtGraphicalSubitemProxy

getCheckState

protected com.rational.test.ft.script.State getCheckState(java.lang.Object node)

getCheckable

protected boolean getCheckable()

getState

protected com.rational.test.ft.script.Action getState(java.lang.Object node)

isExpanded

public boolean isExpanded(java.lang.Object node)

isCollapsed

public boolean isCollapsed(java.lang.Object node)

isSelected

public boolean isSelected(java.lang.Object node)

isPointInClientArea

protected boolean isPointInClientArea(java.awt.Point pt)
Overrides:
isPointInClientArea in class ScrollableProxy

allowsMultipleSelections

protected boolean allowsMultipleSelections()
true is returned if the tree component being evaluated allows multiple nodes to be selected at the same time. false is returned if only one node may be selected at any time.

Returns:
true if the tree allows multiple nodes to be selected at the same time.

selectNode

protected void selectNode(java.lang.Object node)
Set the state of the specified node to be selected. If the specified node is already selected this call should be treated as a no-op.

Parameters:
node - The node that is to be selected.

checkNode

protected void checkNode(java.lang.Object node)
Sets the checked state of the tree item.

Parameters:
node - The node that is to be selected.

unCheckNode

protected void unCheckNode(java.lang.Object node)
Sets the unchecked state of the tree item.

Parameters:
node - The node that is to be selected.

extendSelectNode

protected void extendSelectNode(java.lang.Object node)

deselectNode

protected void deselectNode(java.lang.Object node)

expandNode

protected void expandNode(java.lang.Object node)
Set the state of the specified node to be expanded (such that the child nodes are visible). This command will be used during playback of a script that expanded the same node when the script was recorded. If the specified node is already expanded this command is a no-op.

Parameters:
node - The node that is to be expanded.

collapseNode

protected void collapseNode(java.lang.Object node)
Set the state of the specified node to be collapsed (such that the child nodes are not visible).

Parameters:
node - The node that is to be collapsed.

scrollLineLeftForUnix

public void scrollLineLeftForUnix()

scrollLineRightForUnix

public void scrollLineRightForUnix()

getTreeColumnRectangle

protected java.awt.Rectangle getTreeColumnRectangle(TreeItem item,                                                     int columnIndex)

getTreeItemRectangle

protected java.awt.Rectangle getTreeItemRectangle(TreeItem item)

getImageRectangle

protected java.awt.Rectangle getImageRectangle(org.eclipse.swt.graphics.Image image)

getText

public java.lang.String getText(TreeItem item)

addHeader

public void addHeader(java.util.Vector args,                       java.awt.Point pt,                       java.lang.String colName)

addCellAndPoint

public void addCellAndPoint(java.util.Vector args,                             TreeItem node,                             java.awt.Point pt)

addCell

public void addCell(java.util.Vector args,                     com.rational.test.ft.script.List pathList,                     int columnIndex)

processSingleMouseEvent

public void processSingleMouseEvent(IMouseActionInfo action)
Overrides:
processSingleMouseEvent in class ScrollableProxy

setState

public void setState(com.rational.test.ft.script.Action action,                      com.rational.test.ft.script.Subitem item)
This method performs a specific action against the subitem.

Specified by:
setState in interface com.rational.test.ft.object.interfaces.ISubitem
Parameters:
item - The item to act upon.
action - The action that should be performed.

setState

public void setState(com.rational.test.ft.script.Action action,                      com.rational.test.ft.script.Subitem start,                      com.rational.test.ft.script.Subitem end)
This method performs a specific action against the subitem range defined by the specified indices.

Specified by:
setState in interface com.rational.test.ft.object.interfaces.ISubitem
Parameters:
start - The first item to act upon.
end - The last item to act upon.
action - The action that should be performed.

getLocationOnScreen

public java.awt.Point getLocationOnScreen()
Return the location on the screen for an swt control

Overrides:
getLocationOnScreen in class ControlProxy

getScreenRectangle

public java.awt.Rectangle getScreenRectangle(com.rational.test.ft.script.Subitem subitem)
Returns the rectangle that contains the component being evaluated relative to the top left corner of the screen. This will commonly be two operations (getScreenRectangle for the parent object and then adjusting for the specified subitem) combined into a single operation. The rectangle is exposed so that actions may be directly scripted against a visible subitem. null is returned if the subitem is not showing.

Specified by:
getScreenRectangle in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
Specified by:
getScreenRectangle in class ScrollableSwtGraphicalSubitemProxy
Returns:
The adjusted rectangle surrounding subitem relative to the screen. null is returned if the subitem is not showing.

getScreenPoint

public java.awt.Point getScreenPoint(com.rational.test.ft.script.Subitem subitem)
Returns the screen relative point to the center of the supplied subitem.

Specified by:
getScreenPoint in interface com.rational.test.ft.object.interfaces.IGraphicalSubitem
Overrides:
getScreenPoint in class ScrollableSwtGraphicalSubitemProxy
Parameters:
subitem - The subitem the resultant screen point is relative to.
Returns:
A screen relative point.

hasDuplicateChildren

protected boolean hasDuplicateChildren(TreeItem path,                                        java.lang.String node)

getTestDataTypes

public java.util.Hashtable getTestDataTypes()
Returns a hashtable of data type descriptions of the verification point data available with the associated object in the SUT. The hashtable keys are String objects that are used as the VP type in the associated test data. The type is a simple value that is defferent then other type values associated with this object under test. The type keys map to a verbose description of the test data, reasonable for presentation to a user.

Overrides:
getTestDataTypes in class JavaProxy
Returns:
An hashtable of type/description pairs used to describe the verification data available from this proxy.
See Also:
getTestData(String), ITestData

getTestData

public com.rational.test.ft.vp.ITestData getTestData(java.lang.String testDataType)
This method constructs the specified verification data object. The testDataType parameter is one of the hashtable keys returned by getTestDataTypes.

Overrides:
getTestData in class ProxyTestObject
Parameters:
testDataType - A test data type supplied by getTestDataTypes.
Returns:
The verification data for the supplied type.
See Also:
getTestDataTypes(), ITestData

updateTestData

public com.rational.test.ft.vp.ITestData updateTestData(java.lang.String testDataType,                                                         com.rational.test.ft.vp.ITestData testData)
This method updates the supplied test data object and returns it. The testDataType parameter is one of the hashtable keys returned by getTestDataTypes. The testData is a previously supplied ITestData object that needs to be updated to reflect the current state of the associated test object.

Overrides:
updateTestData in class ProxyTestObject
Parameters:
testDataType - A test data type supplied by getTestDataTypes.
testData - The test data base object that requires updating.
Returns:
The testData passed in with appropriate updates.
See Also:
getTestDataTypes(), ITestData

getProperty

public java.lang.Object getProperty(java.lang.String propertyName)
Get the value for a specific property.

Overrides:
getProperty in class ControlProxy
Parameters:
propertyName - The name of the property to fetch.
Returns:
The active value of the specified property for the associated test object.
See Also:
ProxyTestObject.getProperties(), ProxyTestObject.setProperty(String,Object), ProxyTestObject.getRecognitionProperties(), ProxyTestObject.addRecognitionProperty(String,Object,int)

hScrollTo

public void hScrollTo(int value)
This method scrolls the control horizontally.

Specified by:
hScrollTo in interface com.rational.test.ft.object.interfaces.IScrollable
Overrides:
hScrollTo in class ScrollableSwtGraphicalSubitemProxy
Parameters:
value - The position of the vertical scrollbar after this action is completed.
See Also:
hScrollTo(int)

setScrollWidth

public void setScrollWidth()