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 WidgetProxy

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.WidgetProxy
All Implemented Interfaces:
IChannelObject, IDataDriven, IProxyBase, IPropertyFilter, com.rational.test.ft.object.interfaces.IGraphical
Direct Known Subclasses:
ItemProxy

public abstract class WidgetProxy
extends JavaGuiProxy

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


Nested Class Summary
protected  class WidgetProxy.ChildEnumerator
           
protected  class WidgetProxy.ImmediateChildEnumerator
           
 
Field Summary
protected static java.lang.String CLASSINDEX
           
protected static int CLASSINDEXWEIGHT
           
protected static java.lang.String MAPPABLECLASSINDEX
           
protected static int MAPPABLECLASSINDEXWEIGHT
           
protected static int MAX_NAME
           
 
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
WidgetProxy(java.lang.Object theObjectInTheSUT)
          This sole constructor for all proxy objects sets the SUT object as a member variable for the proxy.
 
Method Summary
 IChannel getChannel()
          return a channel for the object.
protected  ProxyTestObject getChildProxy(java.lang.Object childObject)
           
 java.util.Enumeration getChildrenEnumeration()
          Return an enumeration of proxies for the children of this object.
 java.lang.String getDescriptiveName()
          Returns a name that can be used to describe the associated UI object in a script.
 java.util.Enumeration getImmediateChildren()
          Return an enumeration of proxies for the children of this object.
protected  java.lang.String getLeadingLabel()
          This method is used to generate an interesting descriptive name for controls without persistent text.
 java.awt.Point getLocationOnScreen()
          Return the location on the screen.
 ProxyTestObject getMappableParent()
          Returns a proxy object for the parent of this object.
 java.lang.String getName()
          get the name of the object
 ProxyTestObject[] getOwnedObjects()
          Return an array of proxies for the objects owned by this object.
 ProxyTestObject getOwner()
          Returns a proxy object for the owner of this object.
 ProxyTestObject getParent()
          Returns a proxy object for the parent of this object.
 java.lang.Object getParentObject()
          Returns an object for the parent of this object.
 java.lang.Object getProperty(java.lang.String propertyName)
          Get the value for a specific property.
 java.lang.String getRole()
          Returns TestObjectRole.ROLE_SWT.
 java.awt.Rectangle getScreenRectangle()
          Returns the rectangle that contains the component being evaluated relative to the top left corner of the screen.
 ProxyTestObject getTopMappableParent()
          Returns a proxy object for the top parent of this object.
 ProxyTestObject getTopParent()
          Returns a proxy object for the top parent of this object.
 boolean hasFocus()
          The hasFocus method is private in the SWT world, so this method always returns false.
 
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, getClippedScreenRectangle, getMethodSpecForPoint, getProcessMouseEventHandler, getRegisteredTopLevelWindow, getScreenPoint, getScreenPoint, getScriptCommandFlags, getTestObjectClassName, getTopMappableWindow, getTopWindow, hover, hover, hover, hover, isDrag, isEnabled, isOpaque, isPointInObject, isPointInObject, isShowing, modifiersChanged, mouseMove, mouseMove, nClick, nClickDrag, nClickDragToScreenPoint, processHoverMouseEvent, processMouseEvent, processSingleMouseEvent, scrollRectToVisible, setProcessMouseEventHandler, setTopLevelWindow, shouldBeMapped
 
Methods inherited from class com.rational.test.ft.domain.java.JavaProxy
addMappableChildrenToVector, addRecognitionProperty, allowProperty, childConstructed, getAddedRecognitionPropertyValue, getChildren, getIndexer, getIndexers, getMappableChildren, getMethods, getNonValueProperties, getProperties, getRecognitionProperties, getRecognitionPropertyWeight, getStandardProperties, getTestDataTypes, getTestDomain, getUniqueId, getVisualClippableParent, hasAddedRecognitionProperties, isRecognitionProperty, setIndexer, setProperty
 
Methods inherited from class com.rational.test.ft.domain.ProxyTestObject
addDataDrivableCommands, baseClassMatch, canTakeVP, equals, findChildrenWithProperties, findChildrenWithPropertiesAndInvoke, getChildren, getDataDrivableCommand, getDataDrivableCommands, getField, getIgnorableProperties, getMappableChildren, getMappableParent, getObjectClassName, getObjectCustomClassName, getOwnedObjects, getParent, getProxy, getScriptCommandAnchor, getTestData, getVisualClippedRectangle, getVisualMappableChildren, getVisualTopParent, getVOMSpecificProperty, hasSpecialFrameState, isClassIndexConsidered, isSameObject, isValidObject, ping, suppressKeyAction, updateTestData
 
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
 

Field Detail

MAX_NAME

protected static final int MAX_NAME
See Also:
Constant Field Values

CLASSINDEX

protected static final java.lang.String CLASSINDEX
See Also:
Constant Field Values

CLASSINDEXWEIGHT

protected static final int CLASSINDEXWEIGHT
See Also:
Constant Field Values

MAPPABLECLASSINDEX

protected static final java.lang.String MAPPABLECLASSINDEX
See Also:
Constant Field Values

MAPPABLECLASSINDEXWEIGHT

protected static final int MAPPABLECLASSINDEXWEIGHT
See Also:
Constant Field Values
Constructor Detail

WidgetProxy

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

getName

public java.lang.String getName()
get the name of the 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 be made unique to the script, but will act 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 will cause script compilation failures. An example of what to return may be "OKButton" for a swt.Button with the text "OK" on it.

Specified by:
getDescriptiveName in class JavaGuiProxy
Returns:
A descriptive object name.

getRole

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

Overrides:
getRole in class JavaProxy
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)
Get the value for a specific property.

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

hasFocus

public boolean hasFocus()
The hasFocus method is private in the SWT world, so this method always returns false. Not a significant loss in functionality for SWT because the associated HWND can be queried to determine who has focus. Could monitor focus events, but just not that significant an issue for such drastic (and error prone) solution.

Specified by:
hasFocus in interface com.rational.test.ft.object.interfaces.IGraphical
Specified by:
hasFocus in class JavaGuiProxy
Returns:
Always false for AWT.

getScreenRectangle

public java.awt.Rectangle getScreenRectangle()
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.

Specified by:
getScreenRectangle in interface com.rational.test.ft.object.interfaces.IGraphical
Specified by:
getScreenRectangle in class JavaGuiProxy
Returns:
The adjusted rectangle surrounding component relative to the screen.
See Also:
IGraphical.isPointInObject(java.awt.Point), IGraphical.getClippedScreenRectangle()

getLocationOnScreen

public java.awt.Point getLocationOnScreen()
Return the location on the screen.


getParent

public ProxyTestObject getParent()
Returns a proxy object for the parent of this object. Returns null if this object has no parent.

Specified by:
getParent in class JavaGuiProxy
Returns:
The proxy for the parent test object or null for a top level window.

getParentObject

public java.lang.Object getParentObject()
Returns an object for the parent of this object. Returns null if this object has no parent.

Specified by:
getParentObject in class JavaGuiProxy
Returns:
The parent test object or null for a top level window.

getMappableParent

public ProxyTestObject getMappableParent()
Returns a proxy object for the parent of this object. Returns null if this object has no parent.

Specified by:
getMappableParent in class JavaGuiProxy
Returns:
The proxy for the parent test object or null for a top level window.

getTopParent

public ProxyTestObject getTopParent()
Returns a proxy object for the top parent of this object. Returns itself if this object has no parent.

Overrides:
getTopParent in class JavaProxy
Returns:
The proxy for the top parent test object or itself for a top level window.

getTopMappableParent

public ProxyTestObject getTopMappableParent()
Returns a proxy object for the top parent of this object. Returns itself if this object has no parent.

Overrides:
getTopMappableParent in class JavaProxy
Returns:
The proxy for the top parent test object or itself for a top level window.

getChildProxy

protected ProxyTestObject getChildProxy(java.lang.Object childObject)

getChildrenEnumeration

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

Specified by:
getChildrenEnumeration in class JavaGuiProxy
Returns:
The child proxies relative to this proxy.

getImmediateChildren

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

Specified by:
getImmediateChildren in class JavaGuiProxy
Returns:
The child proxies relative to this proxy.

getOwner

public ProxyTestObject getOwner()
Returns a proxy object for the owner of this object. Returns null if this object has no owner.

Overrides:
getOwner in class JavaProxy
Returns:
The proxy for the owning object or null for a top object without an owner.

getOwnedObjects

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

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

getLeadingLabel

protected java.lang.String getLeadingLabel()
This method is used to generate an interesting descriptive name for controls without persistent text. This method returns the persistent text on a label that immediately precedes this control in the parents hierarchy.

Returns:
A leading label components text.

getChannel

public IChannel getChannel()
return a channel for the object.

Specified by:
getChannel in interface IChannelObject
Overrides:
getChannel in class ProxyTestObject
Returns:
the channel used by this object.