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.awt
Class CheckboxProxy

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.awt.CheckboxProxy
All Implemented Interfaces:
IChannelObject, IDataDriven, IProxyBase, IRadioButtonProxy, IPropertyFilter, ISetParent, com.rational.test.ft.object.interfaces.IGraphical, com.rational.test.ft.object.interfaces.IToggle, com.rational.test.ft.object.interfaces.IToggleGUI

public class CheckboxProxy
extends ComponentProxy
implements com.rational.test.ft.object.interfaces.IToggleGUI, IRadioButtonProxy

Proxy for AWT Checkbox objects. This handles simple checkboxes and radio buttons, which are implemented as Checkbox objects that are part of a CheckboxGroup.


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.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
CheckboxProxy(java.lang.Object theObjectInTheSUT)
          Sets the SUT object as a member variable for the proxy.
 
Method Summary
 void clickToState(com.rational.test.ft.script.MouseModifiers modifiers, com.rational.test.ft.script.State state)
          Performs the necessary mouse actions to attain the desired state for the associated component.
 void clickToState(com.rational.test.ft.script.State state)
          Performs the necessary mouse actions to attain the desired state for the associated component.
 void deselect()
          Sets the state of the associated object to NOT_SELECTED.
 void dragToState(com.rational.test.ft.script.MouseModifiers modifiers, com.rational.test.ft.script.State state)
          Performs the necessary mouse actions to attain the desired state for the associated component.
 void dragToState(com.rational.test.ft.script.State state)
          Performs the necessary mouse actions to attain the desired state for the associated component.
 com.rational.test.ft.sys.MethodSpecification getDataDrivableCommand()
          This method must be implemented by any proxy that wishes to support data driving.
 com.rational.test.ft.sys.MethodSpecification[] getDataDrivableCommands(int includeChildren)
          Walks the proxy parent-child hierarchy and returns a command for each control that is data drivable.
 com.rational.test.ft.script.Property[] getDataDrivenRecognitionProperties(java.util.Hashtable radiobuttonGroups)
          Return a limited set of properties that can be used to identify all radiobuttons in the group.
 java.lang.String getDescriptiveName()
          Returns a name that can be used to describe the associated UI object in a script.
 java.lang.String getLabel()
          Returns the label for the Checkbox object.
 java.lang.Object getProperty(java.lang.String propertyName)
          Gets the value for a specific property.
 java.lang.Object getRadioButtonGroup()
          Return access to the radio button group object.
 java.lang.String getRole()
          Returns TestObjectRole.ROLE_CHECK_BOX.
 com.rational.test.ft.script.State getState()
          Returns the state of the associated object.
 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 in the SUT.
 java.lang.String getTestObjectClassName()
          Returns the top level GUI test object classname that implements ITopWindow.
 java.lang.String getVariableDataDrivenRecognitionProperty(com.rational.test.ft.script.Property[] properties)
          Only one recognition property will be data driven by default, this method specifies that property.
 void indeterminate()
          Sets the state of the associated object to INDETERMINATE.
 boolean isRadioSelected()
          Specifies if the radiobutton is currently selected.
 void processSingleMouseEvent(IMouseActionInfo action)
          Returns a method specification for the specified mouse event.
 void select()
          Sets the state of the associated object to SELECTED.
 void setState(com.rational.test.ft.script.State state)
          Sets the state of the associated object to the specified state.
 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.awt.ComponentProxy
canBeScrolled, childConstructed, getChildAtPoint, getChildProxy, getChildrenEnumeration, getClippedRect, getComponentChildren, getEmbeddedBrowsers, getImmediateChildren, getLabelText, getLeadingLabel, getLocationOnScreen, getMappableChildren, getMappableParent, getName, getOwnedObjects, getOwner, getParent, getParent2, getParentObject, getScreenRectangle, getTopParent, getWindow, hasFocus, isDopeyDynamicName, isEnabled, isHScroll, isLabelled, isOpaque, isRecognitionProperty, isShowing, isVScroll, setParent
 
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, getClippedScreenRectangle, getMethodSpecForPoint, getProcessMouseEventHandler, getRegisteredTopLevelWindow, getScreenPoint, getScreenPoint, getScriptCommandFlags, getTopMappableWindow, getTopWindow, hover, hover, hover, hover, isDrag, isPointInObject, isPointInObject, modifiersChanged, mouseMove, mouseMove, nClick, nClickDrag, nClickDragToScreenPoint, processHoverMouseEvent, processMouseEvent, scrollRectToVisible, setProcessMouseEventHandler, setTopLevelWindow, shouldBeMapped
 
Methods inherited from class com.rational.test.ft.domain.java.JavaProxy
addMappableChildrenToVector, addRecognitionProperty, allowProperty, getAddedRecognitionPropertyValue, getChildren, getIndexer, getIndexers, getMethods, getNonValueProperties, getProperties, getRecognitionProperties, getRecognitionPropertyWeight, getStandardProperties, 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, getField, getIgnorableProperties, getMappableChildren, getMappableParent, getObjectClassName, getObjectCustomClassName, getOwnedObjects, getParent, getProxy, getScriptCommandAnchor, getVisualClippedRectangle, 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

CheckboxProxy

public CheckboxProxy(java.lang.Object theObjectInTheSUT)
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()
Returns the top level GUI test object classname that implements ITopWindow. This proxy may be used for frames that are not top-level windows, but the same support still works.

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

getLabel

public java.lang.String getLabel()
Returns the label for the Checkbox object.


getDescriptiveName

public java.lang.String getDescriptiveName()
Returns a name that can be used to describe the associated UI object in a script. This name may be further adjusted to become unique to the script, but it acts as the base for the name used in the script. Only characters used in Java identifiers should be returned (alphabetic, numeric, or underscore characters). Non-identifier characters cause script compilation failures. An example of what to return is "OKButton" for a java.awt.Button with the text "OK" on it.

Overrides:
getDescriptiveName in class ComponentProxy
Returns:
A descriptive object name.

getRole

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

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

getProperty

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

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

getDataDrivableCommands

public com.rational.test.ft.sys.MethodSpecification[] getDataDrivableCommands(int includeChildren)
Description copied from class: ProxyTestObject
Walks the proxy parent-child hierarchy and returns a command for each control that is data drivable. Controls that are not data drivable and do not have children that are data drivable should return null.

The reason that the proxies are left with doing the walk instead of it happening at a higher level is because they have a better understanding of the hierarchy they expose. Domains like HTML can take advantage of internal knowledge to allow them better control the traversal of interesting child proxies relative to data driving. By default this method will perform a standard traversal of the proxy hierarchy and does not need to be overridden unless necessary.

Specified by:
getDataDrivableCommands in interface IDataDriven
Overrides:
getDataDrivableCommands in class ProxyTestObject
Parameters:
includeChildren - Flag to control which child objects are considered for data driving. Must be IDataDriven.INCLUDE_JUSTOBJECT, IDataDriven.INCLUDE_SIBLINGS or IDataDriven.INCLUDE_ALL.
Returns:
An array of commands that can be data driven.
See Also:
ProxyTestObject.getDataDrivableCommand()

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(int)

processSingleMouseEvent

public void processSingleMouseEvent(IMouseActionInfo action)
Returns a method specification for the specified mouse event. This is the primary record interface for mouse events against a particular control. The processSingleMouseEvent method is implemented in order to record clickToState against checkboxes. But for checkboxes that are really radiobuttons (part of a CheckBoxGroup), ordinary clicks are recorded.

Overrides:
processSingleMouseEvent in class JavaGuiProxy
Parameters:
action - The event cache and other mouse state information for this mouse action.
See Also:
MethodSpecification

clickToState

public void clickToState(com.rational.test.ft.script.State state)
Performs the necessary mouse actions to attain the desired state for the associated component. If the state of the component is already in the desired state, multiple actions may be performed to reset the state appropriately.

Specified by:
clickToState in interface com.rational.test.ft.object.interfaces.IToggleGUI
Parameters:
state - The desired target state for the associated component.

clickToState

public void clickToState(com.rational.test.ft.script.MouseModifiers modifiers,                          com.rational.test.ft.script.State state)
Performs the necessary mouse actions to attain the desired state for the associated component. If the state of the component is already in the desired state, multiple actions may be performed to reset the state appropriately.

Specified by:
clickToState in interface com.rational.test.ft.object.interfaces.IToggleGUI
Parameters:
modifiers - The mouse modifiers to be used to attain the desired state.
state - The desired target state for the associated component.

dragToState

public void dragToState(com.rational.test.ft.script.State state)
Performs the necessary mouse actions to attain the desired state for the associated component. If the state of the component is already in the desired state, multiple actions may be performed to reset the state appropriately.

Specified by:
dragToState in interface com.rational.test.ft.object.interfaces.IToggleGUI
Parameters:
state - The desired target state for the associated component.

dragToState

public void dragToState(com.rational.test.ft.script.MouseModifiers modifiers,                         com.rational.test.ft.script.State state)
Performs the necessary mouse actions to attain the desired state for the associated component. If the state of the component is already in the desired state, multiple actions may be performed to reset the state appropriately.

Specified by:
dragToState in interface com.rational.test.ft.object.interfaces.IToggleGUI
Parameters:
modifiers - The mouse modifiers to be used to attain the desired state.
state - The desired target state for the associated component.

setState

public void setState(com.rational.test.ft.script.State state)
Sets the state of the associated object to the specified state.

Specified by:
setState in interface com.rational.test.ft.object.interfaces.IToggle
See Also:
State

getState

public com.rational.test.ft.script.State getState()
Returns the state of the associated object.

Specified by:
getState in interface com.rational.test.ft.object.interfaces.IToggle
Returns:
One of the State literals.
See Also:
State

select

public void select()
Sets the state of the associated object to SELECTED. The UnsupportedActionException exception will be thrown if this action can not be performed.

Specified by:
select in interface com.rational.test.ft.object.interfaces.IToggle

deselect

public void deselect()
Sets the state of the associated object to NOT_SELECTED. The UnsupportedActionException exception is thrown if this action cannot be performed.

Specified by:
deselect in interface com.rational.test.ft.object.interfaces.IToggle

indeterminate

public void indeterminate()
Sets the state of the associated object to INDETERMINATE. The UnsupportedActionException exception is thrown if this action cannot be performed.

Specified by:
indeterminate in interface com.rational.test.ft.object.interfaces.IToggle

getTestDataTypes

public java.util.Hashtable getTestDataTypes()
Description copied from class: JavaProxy
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 different from the other type values associated with this object under test. The type keys map to a verbose description of the test data. This is 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:
ProxyTestObject.getTestData(String), ITestData

getTestData

public com.rational.test.ft.vp.ITestData getTestData(java.lang.String testDataType)
Description copied from class: ProxyTestObject
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.
See Also:
ProxyTestObject.getTestDataTypes(), ITestData

updateTestData

public com.rational.test.ft.vp.ITestData updateTestData(java.lang.String testDataType,                                                         com.rational.test.ft.vp.ITestData testData)
Description copied from class: ProxyTestObject
Updates the supplied test data object and returns it. The testDataType parameter is a hashtable key returned by ProxyTestObject.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 database object that requires updating.
Returns:
The testData passed in with appropriate updates.
See Also:
ProxyTestObject.getTestDataTypes(), ITestData

getRadioButtonGroup

public java.lang.Object getRadioButtonGroup()
Description copied from interface: IRadioButtonProxy
Return access to the radio button group object. The object returned is used to correlate the radio button to other radio buttons relative to the same parent in the same group. If access to the group is not available then null should be returned and all radiobuttons in the parent will be treated as if they come from the same group.

Specified by:
getRadioButtonGroup in interface IRadioButtonProxy

getDataDrivenRecognitionProperties

public com.rational.test.ft.script.Property[] getDataDrivenRecognitionProperties(java.util.Hashtable radiobuttonGroups)
Description copied from interface: IRadioButtonProxy
Return a limited set of properties that can be used to identify all radiobuttons in the group. The values are specific to the one proxy but will be applied to all proxies when attempting to find radiobuttons in this group during playback. For instance returning the "text" property is only interesting if all properties in the group have a non-null, unique text property. Otherwise, something more resilient to a parent relative find should be used.

Specified by:
getDataDrivenRecognitionProperties in interface IRadioButtonProxy
Parameters:
radiobuttonGroups - The set of radiobutton groups available from the same parent. The key to the map is the group object and the value is a java.util.Vector of the radiobuttons in the group.

getVariableDataDrivenRecognitionProperty

public java.lang.String getVariableDataDrivenRecognitionProperty(com.rational.test.ft.script.Property[] properties)
Description copied from interface: IRadioButtonProxy
Only one recognition property will be data driven by default, this method specifies that property. The returned property must be in the set of properties returned by #getDataDrivenRecognitionProperties(). Nothing will be data driven if this property name is not in that set.

Specified by:
getVariableDataDrivenRecognitionProperty in interface IRadioButtonProxy
Parameters:
properties - The properties returned by IRadioButtonProxy.getDataDrivenRecognitionProperties(Hashtable).

isRadioSelected

public boolean isRadioSelected()
Description copied from interface: IRadioButtonProxy
Specifies if the radiobutton is currently selected. The selected value is used to as the initial value in the datapool when data driving is complete.

Specified by:
isRadioSelected in interface IRadioButtonProxy