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 TableProxy

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.TableProxy
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 TableProxy
extends ScrollableSwtGraphicalSubitemProxy
implements com.rational.test.ft.object.interfaces.ISubitem

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


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
TableProxy(java.lang.Object theObjectInTheSUT)
          This sole constructor for all proxy objects sets the SUT object as a member variable for the proxy.
 
Method Summary
protected  void addDataDrivableCommands(ProxyTestObject proxy, java.util.Vector commands, int includeChildren)
           
protected  void checkItem(TableItem item)
          Sets the checked state of the table item.
 int columnAtPoint(java.awt.Point pt)
          This method returns the column index for the column at the specified Point.
protected  void extendSelect(int index)
          This method extends the current selection to include a subitem at a specified index.
 com.rational.test.ft.script.Cell getCell(int columnIndex, int rowIndex)
           
 java.awt.Rectangle getCellRectangle(int nColumn, int nRow)
          This method returns the table relative rectangle for the specified cell.
protected  boolean getCheckable()
           
 java.awt.Rectangle getClientRectangle()
          Returns the rectangle that contains the component being evaluated relative to the top left corner of the screen.
 com.rational.test.ft.script.Column getColumn(int columnIndex)
           
 com.rational.test.ft.script.Column getColumn(java.awt.Point pt)
           
 int getColumnCount()
          This method returns the number of columns in the table header component under evaluation.
 java.lang.String getColumnName(int nColumn)
          This method returns the name of the column at the specified column index.
protected  TableColumn[] getColumns()
           
 com.rational.test.ft.sys.MethodSpecification getDataDrivableCommand()
          This method must be implemented by any proxy that wishes to support data driving.
protected  TableItem getItem(int index)
           
 int getItemHeight()
          Returns the height of the area which would be used to display of the items
 java.lang.String getRole()
          Returns TestObjectRole.ROLE_TABLE.
 com.rational.test.ft.script.Row getRow(int rowIndex)
           
 int getRowCount()
          This method returns the number of rows in the table component under evaluation.
 int getRowIndex(java.awt.Point pt)
           
protected  int getRowIndex(com.rational.test.ft.script.Row row)
           
protected  int getRowIndex(com.rational.test.ft.script.Text subitem)
           
 java.awt.Point getScreenPoint(com.rational.test.ft.script.Subitem subitem, java.awt.Point pt)
          Returns the screen relative point given a subitem and a subitem relative point.
 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.
 java.awt.Rectangle getScreenRectangle(com.rational.test.ft.script.Subitem subitem, boolean needScroll)
          Returns the rectangle that contains the component being evaluated relative to the top left corner of the screen.
 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.script.Subitem getSubitemAtPoint(java.awt.Point pt)
           
 com.rational.test.ft.vp.ITestData getTestData(java.lang.String testDataType)
          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.
protected  boolean isHeaderVisible()
           
 void processSingleMouseEvent(IMouseActionInfo action)
          Return a MethodSpecification for the specified mouse event.
protected  void scrollCellIntoView(int nRow, int nColumn, boolean isCheckBox)
           
protected  void scrollPointIntoView(java.awt.Point pt, com.rational.test.ft.script.Subitem subitem)
           
 void setState(com.rational.test.ft.script.Action action)
          This method performs a specific action against the Table.
protected  void setState(com.rational.test.ft.script.Action action, int index)
          This method performs a specific action against the subitem at a specified index.
protected  void setState(com.rational.test.ft.script.Action action, int start, int end)
           
 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.
 boolean shouldBeMapped()
          Returns true; by default all test objects are mapped.
protected  void unCheckItem(TableItem item)
          Sets the checked state of the table item to be false
 com.rational.test.ft.vp.ITestData updateTestData(java.lang.String testDataType, com.rational.test.ft.vp.ITestData testData)
          Updates the supplied test data object and returns it.
 
Methods inherited from class com.rational.test.ft.domain.java.swt.ScrollableSwtGraphicalSubitemProxy
click, click, click, click, doubleClick, doubleClick, doubleClick, doubleClick, drag, drag, drag, drag, drag, drag, dragToScreenPoint, dragToScreenPoint, dragToScreenPoint, dragToScreenPoint, getScreenPoint, getTestObjectClassName, hover, hover, hover, hover, hScrollTo, mouseMove, mouseMove, mouseMove, mouseMove, nClick, nClickDrag, nClickDrag, nClickDragToScreenPoint, nClickDragToScreenPoint, scrollLineDown, scrollLineLeft, scrollLineRight, scrollLineUp, scrollPageDown, scrollPageLeft, scrollPageRight, scrollPageUp, vScrollTo
 
Methods inherited from class com.rational.test.ft.domain.java.swt.ScrollableProxy
canBeScrolled, getClientArea, getHorizontalBar, getVerticalBar, hScroll, isHorizontalScrollable, isPointInClientArea, 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, getLocationOnScreen, getMappableParent, getName, getOwnedObjects, getOwner, getParent, getParentObject, getProperty, 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
 
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
baseClassMatch, canTakeVP, equals, findChildrenWithProperties, findChildrenWithPropertiesAndInvoke, getChildren, 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
 

Constructor Detail

TableProxy

public TableProxy(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_TABLE.

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.

shouldBeMapped

public boolean shouldBeMapped()
Returns true; by default all test objects are mapped. This method should be overriden by proxies that do not contain interesting persistent information. Objects that the script may want to interact with should always return true.

Overrides:
shouldBeMapped in class JavaGuiProxy
Returns:
true, unless overriden in a super class.

getItemHeight

public int getItemHeight()
Returns the height of the area which would be used to display of the items

Returns:
the height of one of the items

getItem

protected TableItem getItem(int index)

getColumns

protected TableColumn[] getColumns()

columnAtPoint

public int columnAtPoint(java.awt.Point pt)
This method returns the column index for the column at the specified Point. The supplied point is the Table relative location and NOT the screen relative location. If the appropriate column can not be determined then a negative one (-1) should be returned to indicate that the column could not be determined.

Parameters:
pt - The Header component relative coordinates that should be used to determine the column index.
Returns:
The column index at the specified point or -1 if the column can not be determined.

getColumnCount

public int getColumnCount()
This method returns the number of columns in the table header component under evaluation.

Returns:
The column count, zero if the count can not be determined.

getRowCount

public int getRowCount()
This method returns the number of rows in the table component under evaluation.

Returns:
The row count, zero if the count can not be determined.

getColumnName

public java.lang.String getColumnName(int nColumn)
This method returns the name of the column at the specified column index. This is typically the title of the column, but may be an icon description or other value that uniquely identifies the column. If the column does not have name then null or "" should be returned. Note, that without a name to identify a column the column index will be used in it's place.

Parameters:
nColumn - The column index for which a name should be created.
Returns:
The title (or other name) for the column at nColumn index into the table header.

getCellRectangle

public java.awt.Rectangle getCellRectangle(int nColumn,                                            int nRow)
This method returns the table relative rectangle for the specified cell. This is used to get the cell relative coordinates for drag operations against a table component.

Parameters:
nColumn - The column index to get the table rectangle for.
nRow - The row index to get the table rectangle for.
Returns:
The table relative rectangle for nColumn's header. Null should be returned if the rectangle can not be computed.

getRowIndex

protected int getRowIndex(com.rational.test.ft.script.Row row)

getRowIndex

protected int getRowIndex(com.rational.test.ft.script.Text subitem)

getSubitemAtPoint

public com.rational.test.ft.script.Subitem getSubitemAtPoint(java.awt.Point pt)

getCell

public com.rational.test.ft.script.Cell getCell(int columnIndex,                                                 int rowIndex)

getColumn

public com.rational.test.ft.script.Column getColumn(java.awt.Point pt)

getColumn

public com.rational.test.ft.script.Column getColumn(int columnIndex)

getRowIndex

public int getRowIndex(java.awt.Point pt)

getRow

public com.rational.test.ft.script.Row getRow(int rowIndex)

isHeaderVisible

protected boolean isHeaderVisible()

getCheckable

protected boolean getCheckable()

scrollCellIntoView

protected void scrollCellIntoView(int nRow,                                   int nColumn,                                   boolean isCheckBox)

scrollPointIntoView

protected void scrollPointIntoView(java.awt.Point pt,                                    com.rational.test.ft.script.Subitem subitem)

setState

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

Specified by:
setState in interface com.rational.test.ft.object.interfaces.ISubitem
Overrides:
setState in class ScrollableSwtGraphicalSubitemProxy
Parameters:
action - The action that should be performed.

setState

protected void setState(com.rational.test.ft.script.Action action,                         int index)
This method performs a specific action against the subitem at a specified index.

Parameters:
item - The index of the item to act upon.
action - The action that should be performed.

setState

protected void setState(com.rational.test.ft.script.Action action,                         int start,                         int end)

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.

checkItem

protected void checkItem(TableItem item)
Sets the checked state of the table item.

Parameters:
item - The tableitem that is to be checked.

unCheckItem

protected void unCheckItem(TableItem item)
Sets the checked state of the table item to be false

Parameters:
item - The tableitem that is to be checked.

extendSelect

protected void extendSelect(int index)
This method extends the current selection to include a subitem at a specified index.

Parameters:
item - The index of the item to select.

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.

getScreenRectangle

public java.awt.Rectangle getScreenRectangle(com.rational.test.ft.script.Subitem subitem,                                              boolean needScroll)
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.

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,                                      java.awt.Point pt)
Returns the screen relative point given a subitem and a subitem relative point.

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.
pt - The subitem relative point.
Returns:
A screen relative point.

getClientRectangle

public java.awt.Rectangle getClientRectangle()
Returns the rectangle that contains the component being evaluated relative to the top left corner of the screen. This will commonly be two operations (getLocationOnScreen and getSize) combined into a single operation.

Returns:
The adjusted rectangle surrounding component relative to the screen.

processSingleMouseEvent

public void processSingleMouseEvent(IMouseActionInfo action)
Return a MethodSpecification for the specified mouse event. This is the primary record interface for mouse events against a particular control.

Overrides:
processSingleMouseEvent in class ScrollableProxy
Parameters:
action - The event cache and other mouse state information for this mouse action.

getTestDataTypes

public java.util.Hashtable getTestDataTypes()
Returns a hashtable of data type descriptions of the verification point data available with the associated object. 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 different from 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.
Since:
RFT1.0
See Also:
getTestData(String), ITestData

getTestData

public com.rational.test.ft.vp.ITestData getTestData(java.lang.String testDataType)
Constructs the specified verification data object. The testDataType parameter is a hashtable key 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.
Since:
RFT1.0
See Also:
getTestDataTypes(), ITestData

updateTestData

public com.rational.test.ft.vp.ITestData updateTestData(java.lang.String testDataType,                                                         com.rational.test.ft.vp.ITestData testData)
Updates the supplied test data object and returns it. The testDataType parameter is a hashtable key 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.
Since:
RFT1.0
See Also:
getTestDataTypes(), ITestData

getDataDrivableCommand

public com.rational.test.ft.sys.MethodSpecification getDataDrivableCommand()
This method must be implemented by any proxy that wishes to support data driving. By default a null value is returned.

Specified by:
getDataDrivableCommand in interface IDataDriven
Overrides:
getDataDrivableCommand in class ProxyTestObject
Since:
RFT2.0
See Also:
ProxyTestObject.getDataDrivableCommands(int)

addDataDrivableCommands

protected void addDataDrivableCommands(ProxyTestObject proxy,                                        java.util.Vector commands,                                        int includeChildren)
Overrides:
addDataDrivableCommands in class ProxyTestObject