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.jfc
Class JComboBoxProxy

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.awt.ComponentProxy
                      extended by com.rational.test.ft.domain.java.jfc.JComponentProxy
                          extended by com.rational.test.ft.domain.java.jfc.JfcGraphicalSubitemProxy
                              extended by com.rational.test.ft.domain.java.jfc.JComboBoxProxy
All Implemented Interfaces:
IChannelObject, IDataDriven, IProxyBase, IPropertyFilter, ISetParent, com.rational.test.ft.object.interfaces.IGraphical, com.rational.test.ft.object.interfaces.IGraphicalSubitem, com.rational.test.ft.object.interfaces.ISelect, com.rational.test.ft.object.interfaces.ISubitem, com.rational.test.ft.object.interfaces.IText

public class JComboBoxProxy
extends JfcGraphicalSubitemProxy
implements com.rational.test.ft.object.interfaces.ISubitem, com.rational.test.ft.object.interfaces.ISelect, com.rational.test.ft.object.interfaces.IText

Proxy for the javax.swing.JComboBox class.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.rational.test.ft.domain.java.awt.ComponentProxy
ComponentProxy.ChildEnumerator, ComponentProxy.ImmediateChildEnumerator
 
Field Summary
 
Fields inherited from class com.rational.test.ft.domain.java.jfc.JComponentProxy
TAB_INDEX, TAB_TEXT
 
Fields inherited from class com.rational.test.ft.domain.java.awt.ComponentProxy
childrenEnumerated, CLASSINDEX, CLASSINDEXWEIGHT, MAX_NAME, NAMEPROPERTY, NAMEPROPERTYWEIGHT, PRIORLABEL, PRIORLABELWEIGHT
 
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
JComboBoxProxy(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 activateTopWindow()
           
 void click(com.rational.test.ft.script.MouseModifiers modifiers)
          Perform a mouse click action at the specified object relative coordinates within the associated TestObject.
 void doubleClick(com.rational.test.ft.script.MouseModifiers modifiers)
          Perform a mouse dbl-click action at the specified object relative coordinates within the associated TestObject.
 void drag(com.rational.test.ft.script.MouseModifiers modifiers)
          Perform a drag action against the associated TestObject with the supplied set of mouse modifiers.
protected  AbstractButtonProxy getButtonProxy()
          Return the AbstractButtonProxy associated with this JComboBox.
 java.util.Enumeration getChildrenEnumeration()
          Return an enumeration of proxies for the children of this object.
 com.rational.test.ft.sys.MethodSpecification getDataDrivableCommand()
          This method must be implemented by any proxy that wishes to support data driving.
protected  int getItemCount()
           
protected  int getItemIndex(com.rational.test.ft.script.Subitem item)
           
protected  int getItemIndex(com.rational.test.ft.script.Text item)
           
protected  java.lang.Object getItemObject(int nIndex)
           
protected  java.lang.Object[] getItemObjects()
           
protected  java.lang.String[] getItemsText(int limit)
           
 java.lang.String getItemText(int nIndex)
          This method returns the image of the value at the specified index.
protected  javax.swing.JLabel getLabel()
          Return the AbstractButtonProxy associated with this JComboBox.
protected  JListProxy getListProxy()
          Return the JListProxy associated with this JComboBox.
 ProxyTestObject[] getOwnedObjects()
          Returns an array of proxies for the objects owned by this object.
protected  JPopupMenuProxy getPopupProxy()
          Return the JPopupMenu associated with this JComboBox.
 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()
           
protected  java.lang.Object getSelectedItemObject()
           
 java.lang.String getSelectedText()
          Allows direct access to the selected text property on the control.
 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 test object that implements IGraphicalSubitem.
 java.lang.String getText()
          Allows direct access to the text property on the control.
protected  JTextProxy getTextProxy()
          Return the JTextProxy associated with this JComboBox.
protected  boolean isEditable()
          Returns true if this JComboBox is editable.
 void processSingleMouseEvent(IMouseActionInfo action)
          Return a MethodSpecification for the specified mouse event.
 void select(int index)
          Directly modifies subitem selected in the control.
 void select(java.lang.String item)
          Directly modifies subitem selected in the control.
 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)
          Directly modifies the text on the control.
 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.jfc.JfcGraphicalSubitemProxy
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.jfc.JComponentProxy
getBorderTitle, getClippedRect, getClippedScreenRectangle, getDescriptiveName, getProperties, getStandardProperties, getText, getVisibleRectangle, getVisualClippedRectangle, hasFocus, isOpaque, isPointInObject, isType, scrollRectToVisible
 
Methods inherited from class com.rational.test.ft.domain.java.awt.ComponentProxy
canBeScrolled, childConstructed, getChildAtPoint, getChildProxy, getComponentChildren, getEmbeddedBrowsers, getImmediateChildren, getLabelText, getLeadingLabel, getLocationOnScreen, getMappableChildren, getMappableParent, getName, getOwner, getParent, getParent2, getParentObject, getScreenRectangle, getTopParent, getWindow, isDopeyDynamicName, isEnabled, isHScroll, isLabelled, isRecognitionProperty, isShowing, isVScroll, setParent
 
Methods inherited from class com.rational.test.ft.domain.java.JavaGuiProxy
click, click, click, doubleClick, doubleClick, doubleClick, drag, drag, drag, dragToScreenPoint, dragToScreenPoint, dragToScreenPoint, dumpAction, ensureObjectIsVisible, getActionRect, getCachedRectX, getCachedRectY, getMethodSpecForPoint, getProcessMouseEventHandler, getRegisteredTopLevelWindow, getScreenPoint, getScreenPoint, getScriptCommandFlags, getTopMappableWindow, getTopWindow, hover, hover, hover, hover, isDrag, isPointInObject, modifiersChanged, mouseMove, mouseMove, nClick, nClickDrag, nClickDragToScreenPoint, processHoverMouseEvent, processMouseEvent, setProcessMouseEventHandler, setTopLevelWindow, shouldBeMapped
 
Methods inherited from class com.rational.test.ft.domain.java.JavaProxy
addMappableChildrenToVector, addRecognitionProperty, allowProperty, getAddedRecognitionPropertyValue, getChildren, getIndexer, getIndexers, getMethods, getNonValueProperties, getRecognitionProperties, getRecognitionPropertyWeight, getTestDomain, getTopMappableParent, getUniqueId, getVisualClippableParent, hasAddedRecognitionProperties, setIndexer, setProperty
 
Methods inherited from class com.rational.test.ft.domain.ProxyTestObject
addDataDrivableCommands, baseClassMatch, canTakeVP, equals, findChildrenWithProperties, findChildrenWithPropertiesAndInvoke, getChannel, 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

JComboBoxProxy

public JComboBoxProxy(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 test object that implements IGraphicalSubitem.

Specified by:
getTestObjectClassName in interface IProxyBase
Overrides:
getTestObjectClassName in class JfcGraphicalSubitemProxy
Returns:
The stateful test object class full name.

getProperty

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

Overrides:
getProperty in class JComponentProxy
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)

getRole

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

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

getOwnedObjects

public ProxyTestObject[] getOwnedObjects()
Returns an array of proxies for the objects owned by this object.

Overrides:
getOwnedObjects in class ComponentProxy
Returns:
An array of proxies of objects owned by this proxy.

getChildrenEnumeration

public java.util.Enumeration getChildrenEnumeration()
Return an enumeration of proxies for the children of this object. Return null for JComboBoxProxy.

Overrides:
getChildrenEnumeration in class ComponentProxy
Returns:
null

getItemCount

protected int getItemCount()

getItemObject

protected java.lang.Object getItemObject(int nIndex)

getItemObjects

protected java.lang.Object[] getItemObjects()

getItemsText

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

getItemText

public java.lang.String getItemText(int nIndex)
This method returns the image of the value at the specified index. If the image can not be attained then a null string is returned.

Parameters:
nIndex - The item index to get the image of.
Returns:
The image if the nIndex item or null.

getSelectedItemObject

protected java.lang.Object getSelectedItemObject()

getSelectedText

public java.lang.String getSelectedText()
Description copied from interface: com.rational.test.ft.object.interfaces.ISelect
Allows direct access to the selected text property on the control.

Specified by:
getSelectedText in interface com.rational.test.ft.object.interfaces.ISelect
Returns:
The selected text in the control

getSelectedIndex

public int getSelectedIndex()

getItemIndex

protected int getItemIndex(com.rational.test.ft.script.Text item)

getItemIndex

protected int getItemIndex(com.rational.test.ft.script.Subitem item)

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 JfcGraphicalSubitemProxy
Parameters:
subitem - The subitem to fetch an object for.
Returns:
An object representation of the subitem.

isEditable

protected boolean isEditable()
Returns true if this JComboBox is editable.

Returns:
true if it is editable

getListProxy

protected JListProxy getListProxy()
Return the JListProxy associated with this JComboBox.

Returns:
the JListProxy associated with this JComboBox.

getPopupProxy

protected JPopupMenuProxy getPopupProxy()
Return the JPopupMenu associated with this JComboBox.


getButtonProxy

protected AbstractButtonProxy getButtonProxy()
Return the AbstractButtonProxy associated with this JComboBox.

Returns:
the AbstractButtonProxy associated with this JComboBox.

getLabel

protected javax.swing.JLabel getLabel()
Return the AbstractButtonProxy associated with this JComboBox.

Returns:
the AbstractButtonProxy associated with this JComboBox.

getTextProxy

protected JTextProxy getTextProxy()
Return the JTextProxy associated with this JComboBox.

Returns:
the JTextProxy associated with this JComboBox.

activateTopWindow

protected void activateTopWindow()
Overrides:
activateTopWindow in class JavaGuiProxy

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)

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

click

public void click(com.rational.test.ft.script.MouseModifiers modifiers)
Perform a mouse click action at the specified object relative coordinates within the associated TestObject.

Specified by:
click in interface com.rational.test.ft.object.interfaces.IGraphical
Overrides:
click in class JavaGuiProxy

doubleClick

public void doubleClick(com.rational.test.ft.script.MouseModifiers modifiers)
Perform a mouse dbl-click action at the specified object relative coordinates within the associated TestObject.

Specified by:
doubleClick in interface com.rational.test.ft.object.interfaces.IGraphical
Overrides:
doubleClick in class JavaGuiProxy

drag

public void drag(com.rational.test.ft.script.MouseModifiers modifiers)
Perform a drag action against the associated TestObject with the supplied set of mouse modifiers. This method is used to simulate drag actions against controls that are typically not sensitive to drag actions.

Specified by:
drag in interface com.rational.test.ft.object.interfaces.IGraphical
Overrides:
drag in class JavaGuiProxy

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.

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

Specified by:
setState in interface com.rational.test.ft.object.interfaces.ISubitem
Parameters:
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.

getText

public java.lang.String getText()
Description copied from interface: com.rational.test.ft.object.interfaces.ISelect
Allows direct access to the text property on the control.

Specified by:
getText in interface com.rational.test.ft.object.interfaces.ISelect
Specified by:
getText in interface com.rational.test.ft.object.interfaces.IText
Returns:
The text of all elements in the control

setText

public void setText(java.lang.String text)
Description copied from interface: com.rational.test.ft.object.interfaces.IText
Directly modifies the text on the control.

Specified by:
setText in interface com.rational.test.ft.object.interfaces.IText
Parameters:
text - The text to update the property text of the component

select

public void select(java.lang.String item)
Description copied from interface: com.rational.test.ft.object.interfaces.ISelect
Directly modifies subitem selected in the control. If the specified text is not in the controls list of elements, a SubitemNotFoundException is thrown.

Specified by:
select in interface com.rational.test.ft.object.interfaces.ISelect
Parameters:
item - the item to update the control with
See Also:
ISelect.select(int)

select

public void select(int index)
Description copied from interface: com.rational.test.ft.object.interfaces.ISelect
Directly modifies subitem selected in the control. If the specified index is not valid for the active list of elements in the control, a SubitemNotFoundException is thrown.

Specified by:
select in interface com.rational.test.ft.object.interfaces.ISelect
Parameters:
index - the index of the item to update the control with
See Also:
ISelect.select(String)

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