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 MenuComponentProxy

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

public class MenuComponentProxy
extends JavaGuiProxy

Base proxy for AWT Menu objects.


Nested Class Summary
protected  class MenuComponentProxy.ChildEnumerator
           
 
Field Summary
protected static java.lang.String CLASSINDEX
           
protected static int CLASSINDEXWEIGHT
           
protected static int MAX_NAME
           
protected static java.lang.String 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
MenuComponentProxy(java.lang.Object theObjectInTheSUT)
          Sets the SUT object as a member variable for the proxy.
 
Method Summary
 java.lang.Object getChildAtPoint(java.awt.Point pt)
          Finds the child object that is at the specified point.
 java.util.Enumeration getChildrenEnumeration()
          Returns an enumeration of proxies for the children of this object.
 java.awt.Rectangle getClippedRect(java.awt.Rectangle childRect)
           
 java.lang.String getDescriptiveName()
          Returns a name that can be used to describe the associated UI object in a script.
 java.util.Enumeration getImmediateChildren()
          Returns an enumeration of proxies for the immediate children of this object.
 ProxyTestObject getMappableParent()
          Returns a proxy object for the parent of this object.
protected  ProxyTestObject[] getMenuChildrenArray()
          This protected method is needed to access true menu child proxies.
 java.lang.String getName()
          Gets the name of the object.
 ProxyTestObject[] getOwnedObjects()
          Returns 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)
          Gets the value for a specific property.
 java.lang.String getRole()
          Returns TestObjectRole.ROLE_AWT.
 java.awt.Rectangle getScreenRectangle()
          Returns the rectangle that contains the component being evaluated relative to the top left corner of the screen.
 ProxyTestObject getTopParent()
          Returns a proxy object for the top parent of this object.
 boolean hasFocus()
          Always returns false because there is not a direct way to determine who has the focus in the AWT world.
 boolean isEnabled()
          Checks the component under evaluation to determine if it is enabled or disabled.
 boolean isOpaque()
          Checks the component under evaluation to determine if it is opaque or transparent.
 boolean isShowing()
          Checks the component under evaluation to determine if it is showing (as opposed to hidden).
 
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, getTestObjectClassName, getTopMappableWindow, getTopWindow, hover, hover, hover, hover, isDrag, isPointInObject, isPointInObject, 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, getTopMappableParent, getUniqueId, getVisualClippableParent, hasAddedRecognitionProperties, isRecognitionProperty, setIndexer, setProperty
 
Methods inherited from class com.rational.test.ft.domain.ProxyTestObject
addDataDrivableCommands, baseClassMatch, canTakeVP, equals, findChildrenWithProperties, findChildrenWithPropertiesAndInvoke, getChannel, 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

NAME

protected static final java.lang.String NAME
See Also:
Constant Field Values
Constructor Detail

MenuComponentProxy

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

getName

public java.lang.String getName()
Gets 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 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.

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

getRole

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

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

isShowing

public boolean isShowing()
Checks the component under evaluation to determine if it is showing (as opposed to hidden).

Specified by:
isShowing in interface com.rational.test.ft.object.interfaces.IGraphical
Specified by:
isShowing in class JavaGuiProxy
Returns:
true if component is showing, else false.

isEnabled

public boolean isEnabled()
Checks the component under evaluation to determine if it is enabled or disabled.

Specified by:
isEnabled in interface com.rational.test.ft.object.interfaces.IGraphical
Specified by:
isEnabled in class JavaGuiProxy
Returns:
true if component is enabled, else false.

isOpaque

public boolean isOpaque()
Checks the component under evaluation to determine if it is opaque or transparent.

Specified by:
isOpaque in interface com.rational.test.ft.object.interfaces.IGraphical
Overrides:
isOpaque in class JavaGuiProxy
Returns:
true if component is opaque, else false.

hasFocus

public boolean hasFocus()
Always returns false because there is not a direct way to determine who has the focus in the AWT world. This does not represent a significant loss in functionality for AWT because the associated HWND can be queried to determine who has the focus. It could monitor focus events, but this is not a very significant issue considering the extreme 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 commonly consists of 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()

getClippedRect

public java.awt.Rectangle getClippedRect(java.awt.Rectangle childRect)
Overrides:
getClippedRect in class JavaGuiProxy

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 proxy for 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.

getChildrenEnumeration

public java.util.Enumeration getChildrenEnumeration()
Returns 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()
Returns an enumeration of proxies for the immediate 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()
Returns 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.

getChildAtPoint

public java.lang.Object getChildAtPoint(java.awt.Point pt)
Finds the child object that is at the specified point. Note that the point is relative to the top left corner of the screen, and not the component itself or its parent.

If this object has no children, it should return null.

Specified by:
getChildAtPoint in interface com.rational.test.ft.object.interfaces.IGraphical
Overrides:
getChildAtPoint in class JavaGuiProxy
Parameters:
pt - Screen relative point to check.
Returns:
The object at the point or null if no child object is found.
See Also:
getScreenRectangle()

getProperty

public java.lang.Object getProperty(java.lang.String propertyName)
Gets 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)

getMenuChildrenArray

protected ProxyTestObject[] getMenuChildrenArray()
This protected method is needed to access true menu child proxies.