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 JMenuItemProxy

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.AbstractButtonProxy
                              extended by com.rational.test.ft.domain.java.jfc.JMenuItemProxy
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
Direct Known Subclasses:
JMenuProxy, JSeparatorProxy

public class JMenuItemProxy
extends AbstractButtonProxy

Proxy for the javax.swing.JMenuItem class.


Nested Class Summary
protected  class JMenuItemProxy.ChildEnumerator
           
 
Nested classes/interfaces inherited from class com.rational.test.ft.domain.java.awt.ComponentProxy
ComponentProxy.ImmediateChildEnumerator
 
Field Summary
protected  java.awt.Rectangle initRect
           
protected static int NAME_LENGTH
           
protected  com.rational.test.ft.script.Subitem[] thePathList
           
protected  com.rational.test.ft.script.Subitem theSubitem
           
 
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
JMenuItemProxy(java.lang.Object theObjectInTheSUT)
          This sole constructor for all proxy objects sets the SUT object as a member variable for the proxy.
 
Method Summary
 ProxyTestObject getAssociateProxy()
          Return the proxy we want to record the actions against.
 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.
 int getIndex()
           
protected  ProxyTestObject[] getMenuChildrenArray()
          This protected method is needed to access true menu child proxies.
 JMenuItemProxy getMenuItemProxy(com.rational.test.ft.script.Subitem item)
           
 com.rational.test.ft.sys.MethodSpecification getMethodSpecForPoint(java.awt.Point pt)
          Return a MethodSpecification for a method that returns a java.awt.Point for the specified coordinates.
 java.lang.String getName()
          Returns a string that can be used to describe the path of this JMenuItem.
 java.lang.Object getParentObject()
          Returns an object for the parent of this object.
 com.rational.test.ft.script.Subitem[] getPath()
          Returns an array of Subitems can be used to describe the path of this JMenuItem.
protected  java.lang.String getPathText(java.lang.String separator)
          This method provides a path image for debugging and for the menu item descriptive name.
 java.lang.String getRole()
          Returns TestObjectRole.ROLE_MENU_ITEM.
 com.rational.test.ft.script.Subitem getSubitem()
          Return the Subitem describes this JMenuItem.
 void processSingleMouseEvent(IMouseActionInfo action)
          Return a MethodSpecification for the specified mouse event.
 
Methods inherited from class com.rational.test.ft.domain.java.jfc.AbstractButtonProxy
clickToState, clickToState, deselect, dragToState, dragToState, getDataDrivableCommands, getDataDrivenRecognitionProperties, getIconDescription, getProperty, getRadioButtonGroup, getState, getTestData, getTestDataTypes, getTestObjectClassName, getText, getVariableDataDrivenRecognitionProperty, hasSpecialFrameState, indeterminate, isRadioSelected, select, setState, shouldBeMapped, updateTestData
 
Methods inherited from class com.rational.test.ft.domain.java.jfc.JComponentProxy
getBorderTitle, getClippedRect, getClippedScreenRectangle, 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, getOwnedObjects, getOwner, getParent, getParent2, getScreenRectangle, getTopParent, getWindow, isDopeyDynamicName, isEnabled, isHScroll, isLabelled, 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, getProcessMouseEventHandler, getRegisteredTopLevelWindow, getScreenPoint, getScreenPoint, getScriptCommandFlags, getTopMappableWindow, getTopWindow, hover, hover, hover, hover, isDrag, isPointInObject, modifiersChanged, mouseMove, mouseMove, nClick, nClickDrag, nClickDragToScreenPoint, processHoverMouseEvent, processMouseEvent, setProcessMouseEventHandler, setTopLevelWindow
 
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, getDataDrivableCommand, getField, getIgnorableProperties, getMappableChildren, getMappableParent, getObjectClassName, getObjectCustomClassName, getOwnedObjects, getParent, getProxy, getScriptCommandAnchor, getVisualMappableChildren, getVisualTopParent, getVOMSpecificProperty, 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
 

Field Detail

NAME_LENGTH

protected static final int NAME_LENGTH
See Also:
Constant Field Values

theSubitem

protected com.rational.test.ft.script.Subitem theSubitem

thePathList

protected com.rational.test.ft.script.Subitem[] thePathList

initRect

protected java.awt.Rectangle initRect
Constructor Detail

JMenuItemProxy

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

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.

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

getRole

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

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

getChildrenEnumeration

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

Overrides:
getChildrenEnumeration in class ComponentProxy
Returns:
The child proxies relative to this proxy.

getName

public java.lang.String getName()
Returns a string that can be used to describe the path of this JMenuItem.

Overrides:
getName in class ComponentProxy

getParentObject

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

Overrides:
getParentObject in class ComponentProxy
Returns:
The parent test object or null for a top level window.

getAssociateProxy

public ProxyTestObject getAssociateProxy()
Return the proxy we want to record the actions against. It could be a JMenuBarProxy or a JPopupMenuProxy (only when the JPopupMenu is not invoked by a JMenu).


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.

getIndex

public int getIndex()

getPath

public com.rational.test.ft.script.Subitem[] getPath()
Returns an array of Subitems can be used to describe the path of this JMenuItem.


getPathText

protected java.lang.String getPathText(java.lang.String separator)
This method provides a path image for debugging and for the menu item descriptive name.

Parameters:
separator - The string to be placed between the items in the path.
Returns:
An viewable image of the menu item path.

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 AbstractButtonProxy
Parameters:
action - The event cache and other mouse state information for this mouse action.

getMethodSpecForPoint

public com.rational.test.ft.sys.MethodSpecification getMethodSpecForPoint(java.awt.Point pt)
Return a MethodSpecification for a method that returns a java.awt.Point for the specified coordinates. By default a method specification for IGraphical.getScreenPoint will be returned. However, if a proxy can find

Overrides:
getMethodSpecForPoint in class JavaGuiProxy
Parameters:
x - The screen relative x coordinate.
y - The screen relative y coordinate.
See Also:
MethodSpecification

getMenuItemProxy

public JMenuItemProxy getMenuItemProxy(com.rational.test.ft.script.Subitem item)

getMenuChildrenArray

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