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 MenuItemProxy

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

public class MenuItemProxy
extends JavaGuiProxy

Proxy for SWT MenuItem objects.


Nested Class Summary
protected  class MenuItemProxy.ChildEnumerator
           
 
Field Summary
protected static java.lang.String CLASSINDEX
           
protected static int CLASSINDEXWEIGHT
           
protected static int MAX_NAME
           
protected static java.lang.String TESTDATA_STATE
           
protected static java.lang.String TESTDATA_TEXT
           
protected static java.lang.Object theCacheMenu
           
 
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
MenuItemProxy(java.lang.Object theObjectInTheSUT)
          Sets the SUT object as a member variable for the proxy.
 
Method Summary
 IChannel getChannel()
          return a channel for the object.
 java.lang.Object getChildAtPoint(java.awt.Point pt)
          Finds the child object that is at the specified point.
 java.util.Enumeration getChildrenEnumeration()
          Return an enumeration of mappable proxies for the children of this object.
 java.awt.Rectangle getClippedScreenRectangle()
          Returns the clipped-screen rectangle for the associated TestObject
 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 immediate children of this object.
 int getIndex()
           
 java.lang.String getLabel()
          get the label on the menu item
 ProxyTestObject getMappableParent()
          Returns a proxy object for the mappable parent of this object.
 MenuProxy getMenuProxy()
           
 ProxyTestObject[] getOwnedObjects()
          Always returns null because object relationships are not understood at this level of abstaction.
 ProxyTestObject getOwner()
          Always returns null because object relationships are not understood at this level of abstaction.
 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.
 com.rational.test.ft.script.Subitem[] getPath()
          Get the path to this menu item relative to the top of the menu hierarchy.
 java.lang.Object getProperty(java.lang.String propertyName)
          Get the value for a specific property.
 java.lang.String getRole()
          Returns TestObjectRole.ROLE_MENU_ITEM.
 java.awt.Rectangle getScreenRectangle()
          Returns the rectangle that contains the component being evaluated relative to the top left corner of the screen.
protected  boolean getState()
           
 int getStyle()
           
 com.rational.test.ft.script.Subitem getSubitem()
          Return the Subitem describes this JMenuItem.
 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.awt.Rectangle getVisualClippedRectangle()
          The optimized way to obtain the ClippedRectangle.
 boolean hasFocus()
          Check the component under evaluation to determine if it has keyboard focus.
protected  boolean isCheckBox()
           
 boolean isEnabled()
          Checks the component under evaluation to determine if it is enabled or disabled.
 boolean isOpaque()
          Check the component under evaluation to determine if it is opaque or transparent.
protected  boolean isRadioButton()
           
protected  boolean isSeparator()
           
 boolean isShowing()
          Check the component under evaluation to determine if it is showing (as apposed to hidden).
 boolean isSubitem(com.rational.test.ft.script.Subitem subitem)
          true if the specified subitem is valid for this menu item.
 void processSingleMouseEvent(IMouseActionInfo action)
           
 void setCachedMenuBar(java.lang.Object topMenu)
           
 
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, getClippedRect, getMethodSpecForPoint, getProcessMouseEventHandler, getRegisteredTopLevelWindow, getScreenPoint, getScreenPoint, getScriptCommandFlags, getTestObjectClassName, 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, childConstructed, getAddedRecognitionPropertyValue, getChildren, getIndexer, getIndexers, getMappableChildren, getMethods, getNonValueProperties, getProperties, getRecognitionProperties, getRecognitionPropertyWeight, getStandardProperties, getTestDomain, getTopMappableParent, getTopParent, 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, 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

CLASSINDEX

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

CLASSINDEXWEIGHT

protected static final int CLASSINDEXWEIGHT
See Also:
Constant Field Values

theCacheMenu

protected static java.lang.Object theCacheMenu

MAX_NAME

protected static final int MAX_NAME
See Also:
Constant Field Values

TESTDATA_TEXT

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

TESTDATA_STATE

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

MenuItemProxy

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

getRole

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

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

getLabel

public java.lang.String getLabel()
get the label on the menu item


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 java.awt.Button with the text "OK" on it.

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

getStyle

public int getStyle()

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.

processSingleMouseEvent

public void processSingleMouseEvent(IMouseActionInfo action)
Overrides:
processSingleMouseEvent in class JavaGuiProxy

setCachedMenuBar

public void setCachedMenuBar(java.lang.Object topMenu)

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

getMenuProxy

public MenuProxy getMenuProxy()

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.

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.

isShowing

public boolean isShowing()
Check the component under evaluation to determine if it is showing (as apposed 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.

isOpaque

public boolean isOpaque()
Description copied from class: JavaGuiProxy
Check 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()
Description copied from class: JavaGuiProxy
Check the component under evaluation to determine if it has keyboard focus.

Specified by:
hasFocus in interface com.rational.test.ft.object.interfaces.IGraphical
Specified by:
hasFocus in class JavaGuiProxy
Returns:
true if component has keyboard focus, else false.

getMappableParent

public ProxyTestObject getMappableParent()
Description copied from class: JavaGuiProxy
Returns a proxy object for the mappable 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.

getChildrenEnumeration

public java.util.Enumeration getChildrenEnumeration()
Description copied from class: JavaGuiProxy
Return an enumeration of mappable 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()
Description copied from class: JavaGuiProxy
Return 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()
Description copied from class: JavaProxy
Always returns null because object relationships are not understood at this level of abstaction.

Overrides:
getOwner in class JavaProxy
Returns:
null, no known parent.

getOwnedObjects

public ProxyTestObject[] getOwnedObjects()
Description copied from class: JavaProxy
Always returns null because object relationships are not understood at this level of abstaction.

Overrides:
getOwnedObjects in class JavaProxy
Returns:
null, no known parent.

getChildAtPoint

public java.lang.Object getChildAtPoint(java.awt.Point pt)
Description copied from class: JavaGuiProxy
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:
JavaGuiProxy.getScreenRectangle()

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

getClippedScreenRectangle

public java.awt.Rectangle getClippedScreenRectangle()
Description copied from interface: com.rational.test.ft.object.interfaces.IGraphical
Returns the clipped-screen rectangle for the associated TestObject

Specified by:
getClippedScreenRectangle in interface com.rational.test.ft.object.interfaces.IGraphical
Overrides:
getClippedScreenRectangle in class JavaGuiProxy
Returns:
java.awt.Rectangle - The clipped screen rectangle, or null if the object cannot be seen in any window on the screen.
See Also:
IGraphical.getScreenRectangle()

getVisualClippedRectangle

public java.awt.Rectangle getVisualClippedRectangle()
The optimized way to obtain the ClippedRectangle.

Overrides:
getVisualClippedRectangle in class ProxyTestObject
Returns:
The ClippedScreen Rectangle of the control

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)

getPath

public com.rational.test.ft.script.Subitem[] getPath()
Get the path to this menu item relative to the top of the menu hierarchy.


getIndex

public int getIndex()

getSubitem

public com.rational.test.ft.script.Subitem getSubitem()
Return the Subitem describes this JMenuItem.

Returns:
Text if there's text on this JMenuItem Index if the text is not available.

isSubitem

public boolean isSubitem(com.rational.test.ft.script.Subitem subitem)
true if the specified subitem is valid for this menu item.

Returns:
true if the specified subitem is valid for this menu item.

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.

isRadioButton

protected boolean isRadioButton()

isCheckBox

protected boolean isCheckBox()

isSeparator

protected boolean isSeparator()

getState

protected boolean getState()