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
Class PseudoTopLevelProxy

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

public class PseudoTopLevelProxy
extends JavaGuiProxy
implements com.rational.test.ft.object.interfaces.IGraphical

This class does not represent a true top level proxy, it exists solely to block recording against children that can not properly respond when a popup window is displaying. There are issues with message pumps in the core JVM that cause deadly embrace situations when popup windows (menus and combolistbox popups) are being displayed. The only real work around is to not allow access to nested controls and limit top level control interaction when these popup windows are displayed.

This class will never get recorded, it will always cause the recording to pass to the associated real proxy object. The only action that can be recorded is a clickDisabled command that is smart enough to not trip over the JVM deadly embrace.

The deadly embrace occurs on any action that requires the JVM to sync with the UI thread while a popup window is being displayed. Actions such as getLocationOnScreen must be avoided while in this situation, unles they are performed against the heavvyweight wincow and not against the Java control that represents that window.

Since:
RFT1.1

Field Summary
protected static com.rational.test.ft.util.FtDebug debug
           
protected  ProxyTestObject topLevelProxy
           
protected  java.awt.Rectangle topLevelRect
           
protected  com.rational.test.ft.sys.graphical.Window topLevelWindow
           
 
Fields inherited from class com.rational.test.ft.domain.java.JavaGuiProxy
LEFT, preDownState, processMouseEventHandler, ROLEINDEX, ROLEINDEXWEIGHT, TESTDATA_SPECIALFRAMESTATE, TESTDATA_SPECIALFRAMESTATE_DESCRIPTION
 
Fields inherited from class com.rational.test.ft.domain.java.JavaProxy
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
PseudoTopLevelProxy(ProxyTestObject topLevelProxy, com.rational.test.ft.sys.graphical.Window topLevelWindow, java.awt.Rectangle topLevelRect)
          This sole constructor for all proxy objects sets the SUT object as a member variable for the proxy.
 
Method Summary
protected  void activateTopWindow()
          Overload the inherited implementation to never attempt to activate the ComboListBox popup window.
protected  java.awt.Rectangle getActionRect()
          Gets the screen relative rectangle and throws an invalid action exception if the rectangle is not valid.
 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.
 ProxyTestObject getMappableParent()
          Returns a proxy object for the parent of this object.
 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.
 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.String getRole()
          Returns TestObjectRole#ROLE_COMBO_LIST_BOX.
 java.awt.Point getScreenPoint(java.awt.Point pt)
          Returns the screen relative point, given an object relative point.
 java.awt.Rectangle getScreenRectangle()
          Returns the rectangle that contains the component being evaluated relative to the top left corner of the screen.
 com.rational.test.ft.script.ScriptCommandFlags getScriptCommandFlags()
          This method returns an active state value that reflects the state of the test object at the time of the call.
 java.lang.String getTestObjectClassName()
          Set to null when the JPopupMenu is not interesting.
 ProxyTestObject getTopLevelProxy()
           
 com.rational.test.ft.object.interfaces.ITopWindow getTopMappableWindow()
          All Gui Components must be inside a top-level object.
 com.rational.test.ft.object.interfaces.ITopWindow getTopWindow()
          All Gui Components must be inside a top-level object.
 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.
 boolean isEnabled()
          Check 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.
 boolean isPointInObject(java.awt.Point pt)
          Determines if the specified screen relative point is contained in the component under evaluation.
 boolean isShowing()
          Check the component under evaluation to determine if it is showing (as opposed to hidden).
 void processSingleMouseEvent(IMouseActionInfo action)
          Return a MethodSpecification for the specified mouse event.
 boolean shouldBeMapped()
          Returns true; by default, all test objects are mapped.
 
Methods inherited from class com.rational.test.ft.domain.java.JavaGuiProxy
click, click, click, click, doubleClick, doubleClick, doubleClick, doubleClick, drag, drag, drag, drag, dragToScreenPoint, dragToScreenPoint, dragToScreenPoint, dumpAction, ensureObjectIsVisible, getCachedRectX, getCachedRectY, getClippedRect, getProcessMouseEventHandler, getRegisteredTopLevelWindow, getScreenPoint, hover, hover, hover, hover, isDrag, isPointInObject, modifiersChanged, mouseMove, mouseMove, nClick, nClickDrag, nClickDragToScreenPoint, processHoverMouseEvent, processMouseEvent, scrollRectToVisible, setProcessMouseEventHandler, setTopLevelWindow
 
Methods inherited from class com.rational.test.ft.domain.java.JavaProxy
addMappableChildrenToVector, addRecognitionProperty, allowProperty, childConstructed, getAddedRecognitionPropertyValue, getChildren, getIndexer, getIndexers, getMappableChildren, getMethods, getNonValueProperties, getOwnedObjects, getOwner, getProperties, getProperty, getRecognitionProperties, getRecognitionPropertyWeight, getStandardProperties, getTestDataTypes, 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, getChannel, getChildren, getDataDrivableCommand, getDataDrivableCommands, getField, getIgnorableProperties, getMappableChildren, getMappableParent, getObjectClassName, getObjectCustomClassName, getOwnedObjects, getParent, getProxy, getScriptCommandAnchor, getTestData, 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
 
Methods inherited from interface com.rational.test.ft.object.interfaces.IGraphical
click, click, click, click, doubleClick, doubleClick, doubleClick, doubleClick, drag, drag, drag, drag, dragToScreenPoint, dragToScreenPoint, dragToScreenPoint, getScreenPoint, hover, hover, hover, hover, mouseMove, mouseMove, nClick, nClickDrag, nClickDragToScreenPoint
 

Field Detail

debug

protected static com.rational.test.ft.util.FtDebug debug

topLevelProxy

protected ProxyTestObject topLevelProxy

topLevelWindow

protected com.rational.test.ft.sys.graphical.Window topLevelWindow

topLevelRect

protected java.awt.Rectangle topLevelRect
Constructor Detail

PseudoTopLevelProxy

public PseudoTopLevelProxy(ProxyTestObject topLevelProxy,                            com.rational.test.ft.sys.graphical.Window topLevelWindow,                            java.awt.Rectangle topLevelRect)
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

getTopLevelProxy

public ProxyTestObject getTopLevelProxy()

getTestObjectClassName

public java.lang.String getTestObjectClassName()
Set to null when the JPopupMenu is not interesting.

Specified by:
getTestObjectClassName in interface IProxyBase
Overrides:
getTestObjectClassName in class JavaGuiProxy
Returns:
No test Object, or the default TestObject if determined to be interesting.

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.

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

getRole

public java.lang.String getRole()
Returns TestObjectRole#ROLE_COMBO_LIST_BOX.

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

shouldBeMapped

public boolean shouldBeMapped()
Returns true; by default, all test objects are mapped. This method should be overriden by proxies that do not contain interesting persistent information. Objects that the script may want to interact with should always return true.

Overrides:
shouldBeMapped in class JavaGuiProxy
Returns:
true, unless overriden in a super class.

getTopWindow

public com.rational.test.ft.object.interfaces.ITopWindow getTopWindow()
All Gui Components must be inside a top-level object. This method returns the TopWindow. Note that if this object is a top-level object, it returns an interface to itself.

Overrides:
getTopWindow in class JavaGuiProxy

getTopMappableWindow

public com.rational.test.ft.object.interfaces.ITopWindow getTopMappableWindow()
All Gui Components must be inside a top-level object. This method returns the TopWindow. Note that if this object is a top-level object, we return an interface to ourself.

Overrides:
getTopMappableWindow in class JavaGuiProxy

getChildrenEnumeration

public java.util.Enumeration getChildrenEnumeration()
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()
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.

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

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 is 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

isShowing

public boolean isShowing()
Check 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()
Check 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.

getScriptCommandFlags

public com.rational.test.ft.script.ScriptCommandFlags getScriptCommandFlags()
This method returns an active state value that reflects the state of the test object at the time of the call. The state includes values such as enabled and showing< and allows the find algorithm to wait until a required state has been achieved.

Overrides:
getScriptCommandFlags in class JavaGuiProxy
Returns:
An object that reflects the active state of the represented test object.

isOpaque

public boolean isOpaque()
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()
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.

isPointInObject

public boolean isPointInObject(java.awt.Point pt)
Determines if the specified screen relative point is contained in the component under evaluation. Note that the point is relative to the top left corner of the screen, and not the component itself or its parent.

This functionality is performed by the proxy due to potentially unusual aspects associated with functionality. While typically the getScreenRectangle is used to resolve this query, there are situations for which this is not accurate. For instance if the clickable region on a button is not rectangular, just checking whether the point is in the rectangle is not valid.

Specified by:
isPointInObject in interface com.rational.test.ft.object.interfaces.IGraphical
Overrides:
isPointInObject in class JavaGuiProxy
Parameters:
pt - Screen relative point to check.
Returns:
true if component contains thePoint, else false.
See Also:
getScreenRectangle()

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

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

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

getScreenPoint

public java.awt.Point getScreenPoint(java.awt.Point pt)
Returns the screen relative point, given an object relative point.

Specified by:
getScreenPoint in interface com.rational.test.ft.object.interfaces.IGraphical
Overrides:
getScreenPoint in class JavaGuiProxy
Parameters:
pt - The Object relative point.
Returns:
A screen relative point.

getActionRect

protected java.awt.Rectangle getActionRect()
Gets the screen relative rectangle and throws an invalid action exception if the rectangle is not valid.

Overrides:
getActionRect in class JavaGuiProxy
Returns:
The adjusted rectangle surrounding component relative to the screen.

activateTopWindow

protected void activateTopWindow()
Overload the inherited implementation to never attempt to activate the ComboListBox popup window. It just goes away when activated.

Overrides:
activateTopWindow in class JavaGuiProxy