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 ComboProxy

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.SwtGraphicalSubitemProxy
                          extended by com.rational.test.ft.domain.java.swt.ComboProxy
All Implemented Interfaces:
IChannelObject, IDataDriven, IProxyBase, IComboBox, IPropertyFilter, com.rational.test.ft.object.interfaces.IGraphical, com.rational.test.ft.object.interfaces.IGraphicalSubitem

public class ComboProxy
extends SwtGraphicalSubitemProxy
implements IComboBox

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


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
ComboProxy(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 click()
          Left mouse click on the center point of the associated TestObject; is a simple shortcut to the click method with a modifier parameter (modifier set to MOUSE_LEFT).
 void clickForComboBox()
          Perform a mouse n-click action on the specified coordinates relative to the associated TestObject.
 void clickForSetText()
           
protected  void extendSelect(int index)
          This method extends the current selection to include a subitem at a specified index.
 ProxyTestObject[] getChildren()
          Uses getChildren to implement.
protected  java.awt.Rectangle getClickActionRect()
          Gets the screen relative rectangle and throws an invalid action exception if the rect is not valid.
 com.rational.test.ft.sys.MethodSpecification getDataDrivableCommand()
          This method must be implemented by any proxy that wishes to support data driving.
 int getItemCount()
          Gets the number of items.
 int getItemHeight()
          Returns the height of the area which would be used to display of the items
protected  int getItemIndex(java.lang.String item)
          Returns the index in the List of item .
protected  int getItemIndex(com.rational.test.ft.script.Subitem item)
          Returns the index in the List of item.
protected  int getItemIndex(com.rational.test.ft.script.Text item)
          Returns the index in the List of item.
 java.lang.String[] getItems()
          Gets the items.
protected  java.lang.String[] getItems(int limit)
           
 java.lang.String getItemText(int index)
          Gets an item at an index.
 ProxyTestObject[] getMappableChildren()
          Uses getChildren to implement.
 java.util.Hashtable getProperties()
          Returns a complete set of properties for the associated test object.
 java.lang.Object getProperty(java.lang.String propertyName)
          Get the value for a specific property.
 java.lang.String getRole()
          Returns TestObjectRole.ROLE_COMBO_BOX.
 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.
 int getSelectedIndex()
          Returns the index of the selected item in the associated ComboBox control.
protected  com.rational.test.ft.script.Subitem getSubitem(int index)
          Returns the Subitem at the specified index.
 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 getTestObjectClassName()
          Return the GuiSubitemTestObject classname.
 java.lang.String getText()
          Gets an item at an index.
 int getTextHeight()
          Returns the height of the text area
protected  boolean isDropDown()
           
protected  boolean isReadOnly()
           
protected  boolean isSimple()
           
 boolean needMethodSpecForPoint()
          Returns true if getMethodSpecForPoint should return a coordinate based action for drags onto the popup.
 void processSingleMouseEvent(IMouseActionInfo action)
          Return a MethodSpecification for the specified mouse event.
protected  void select(int index)
          Selects an item.
 void select(java.lang.String text)
           
 void setState(com.rational.test.ft.script.Action action)
          This method performs a specific action.
 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 at a specified index.
 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.
 void setText(java.lang.String text)
           
 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.SwtGraphicalSubitemProxy
click, click, click, click, doubleClick, doubleClick, doubleClick, doubleClick, drag, drag, drag, drag, drag, drag, dragToScreenPoint, dragToScreenPoint, dragToScreenPoint, dragToScreenPoint, getScreenPoint, getScreenPoint, hover, hover, hover, hover, mouseMove, mouseMove, mouseMove, mouseMove, nClick, nClickDrag, nClickDrag, nClickDragToScreenPoint, nClickDragToScreenPoint
 
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, getReorderedChildren, getScreenRectangle, getStyle, getToolTipText, getTopMappableParent, getTopParent, getVisualClippedRectangle, hasFocus, isEnabled, isGTK, isLabelled, isObjectMoved, isShell, isShowing, processHoverMouseEvent, processPreDownMouseEvent, processPreUpMouseEvent, scrollRectToVisible, setClickArgs, setDownPointArgs, setDrag, setMethodSpecification, setMultiClickAction, setRecordCache
 
Methods inherited from class com.rational.test.ft.domain.java.JavaGuiProxy
activateTopWindow, 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, getIndexer, getIndexers, getMethods, getNonValueProperties, 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, 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

ComboProxy

public ComboProxy(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

getTestObjectClassName

public java.lang.String getTestObjectClassName()
Return the GuiSubitemTestObject classname.

Specified by:
getTestObjectClassName in interface IProxyBase
Overrides:
getTestObjectClassName in class SwtGraphicalSubitemProxy
Returns:
The default IGraphicalSubitem test object class full name.

getRole

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

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
Overrides:
getSubitem in class SwtGraphicalSubitemProxy
Parameters:
subitem - The subitem to fetch an object for.
Returns:
An object representation of the subitem.

getMappableChildren

public ProxyTestObject[] getMappableChildren()
Description copied from class: JavaProxy
Uses getChildren to implement.

Overrides:
getMappableChildren in class JavaProxy
Returns:
null, if no known children.

getChildren

public ProxyTestObject[] getChildren()
Description copied from class: JavaProxy
Uses getChildren to implement.

Overrides:
getChildren in class JavaProxy
Returns:
null, if no known children.

getProperties

public java.util.Hashtable getProperties()
Description copied from class: ProxyTestObject
Returns a complete set of properties for the associated test object. The meaning of a property is specific to the test domain and the test object. Typically, this is a set of name/value pairs that describe the test object and its active state. Properties such as font, colors, and coordinate information are typically associated with a GUI test object. Associated data and state information can also be returned, depending on the test object.

This method does not return properties whose values are references to objects. The method ProxyTestObject.getNonValueProperties() returns information about such properties.

Overrides:
getProperties in class JavaProxy
Returns:
The set of known properties associated with a test object.
See Also:
ProxyTestObject.getProperty(String), ProxyTestObject.setProperty(String,Object), ProxyTestObject.getStandardProperties(), ProxyTestObject.getNonValueProperties()

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)

getText

public java.lang.String getText()
Gets an item at an index. Indexing is zero based.

Parameters:
index - the index of the item

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

getTextHeight

public int getTextHeight()
Returns the height of the text area

Returns:
the height of the text area

getItems

public java.lang.String[] getItems()
Gets the items.

Returns:
the items in the List

getItems

protected java.lang.String[] getItems(int limit)

getItemText

public java.lang.String getItemText(int index)
Gets an item at an index. Indexing is zero based.

Specified by:
getItemText in interface IComboBox
Parameters:
index - the index of the item
Returns:
The text of the item at the specified index.

getItemCount

public int getItemCount()
Gets the number of items.

Specified by:
getItemCount in interface IComboBox
Returns:
the number of items in the list.

needMethodSpecForPoint

public boolean needMethodSpecForPoint()
Returns true if getMethodSpecForPoint should return a coordinate based action for drags onto the popup.

Specified by:
needMethodSpecForPoint in interface IComboBox
Returns:
If getMethodSpecForPoint should be supported for the popup window.

getSubitem

protected com.rational.test.ft.script.Subitem getSubitem(int index)
Returns the Subitem at the specified index.

Parameters:
index - the specified index.
Returns:
a Subitem.

getItemIndex

protected int getItemIndex(java.lang.String item)
Returns the index in the List of item .

Parameters:
item - a String
Returns:
index of the item if it's in List -1 if cannot find it in List

getItemIndex

protected int getItemIndex(com.rational.test.ft.script.Text item)
Returns the index in the List of item.

Parameters:
item - a Text
Returns:
index of the item it's in List -1 if cannot find it in List

getItemIndex

protected int getItemIndex(com.rational.test.ft.script.Subitem item)
Returns the index in the List of item.

Parameters:
item - a Subitem
Returns:
index of the item it's in List -1 if cannot find it in List

select

public void select(java.lang.String text)

setText

public void setText(java.lang.String text)

select

protected void select(int index)
Selects an item. If the item at an index is not selected, it is selected. If the item at an index is selected, it remains selected. Indices that are out of range are ignored. Indexing is zero based.


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.

getSelectedIndex

public int getSelectedIndex()
Description copied from interface: IComboBox
Returns the index of the selected item in the associated ComboBox control.

Specified by:
getSelectedIndex in interface IComboBox
Returns:
The index of the selected item in the associated ComboBox control.

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 at a specified index.

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)
This method performs a specific action.

Parameters:
action - The action that should be performed.

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:
#getDataDrivableCommands()

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.

Parameters:
start - The first item to act upon.
end - The last item to act upon.
action - The action that should be performed.

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 JavaGuiProxy
Parameters:
action - The event cache and other mouse state information for this mouse action.

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 SwtGraphicalSubitemProxy
Returns:
The adjusted rectangle surrounding subitem relative to the screen. null is returned if the subitem is not showing.

isSimple

protected boolean isSimple()

isDropDown

protected boolean isDropDown()

isReadOnly

protected boolean isReadOnly()

getClickActionRect

protected java.awt.Rectangle getClickActionRect()
Gets the screen relative rectangle and throws an invalid action exception if the rect is not valid.

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

click

public void click()
Left mouse click on the center point of the associated TestObject; 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.IGraphical
Overrides:
click in class JavaGuiProxy

clickForSetText

public void clickForSetText()

clickForComboBox

public void clickForComboBox()
Perform a mouse n-click action on the specified coordinates relative to the associated TestObject.


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