com.mercury.ftjadin.infra.abstr
Class ObjectCS
java.lang.Object com.mercury.ftjadin.infra.abstr.ObjectCS
- extends java.lang.Object
public class ObjectCS
The ObjectCS class is the base class for all the custom support classes. Each primary toolkit implements a single master class that directly inherits ObjectCS. The other classes of the toolkit inherit from that class. Classes that inherit from the master class are AWT-ComponentCS and SWT-ControlCS.
Field Summary | |
---|---|
static int | ALT Keystroke modifier: alt key. |
static int | CONTROL Keystroke modifier: control key. |
static int | CONTROL_SHIFT Keystroke modifier: control and shift pressed simultaneously. |
static int | LEFT Mouse-click modifier: left mouse button. |
static java.lang.String | LIST_OF_VALUES_METHOD_SUFFIX |
static int | LOCK Keystroke modifier: caps-lock on. |
static int | MIDDLE Mouse-click modifier: middle mouse button. |
static int | NONE No keystroke modifier. |
static int | RIGHT Mouse-click modifier: right mouse button. |
static int | SHIFT Keystroke modifier: shift key. |
static int | UNKNOWN Unrecognized code. |
Constructor Summary | |
---|---|
ObjectCS() |
Method Summary | |
---|---|
protected void | addSimpleListener(java.lang.String listenerName,
java.lang.String addMethodName,
java.lang.String removeMethodName) Adds the calling custom support object as a simple listener. |
protected void | addSimpleListener(java.lang.String listenerName,
java.lang.String addMethodName,
java.lang.String removeMethodName,
java.util.EventListener listener) Adds the simple listener specified with the listener argument. |
java.lang.String | attached_text_attr(java.lang.Object obj) Returns the text of adjacent static-text objects. |
java.lang.String | class_attr(java.lang.Object obj) Returns the name of the generic type of the test object class mapped to the custom control. |
java.util.Vector | enumChildren(java.lang.Object obj) Returns all those children of an object that are to be recognized for recording. |
protected boolean | genericEventHandling(java.lang.Object event) Checks whether the specified event is handled in a generic manner. |
java.awt.Rectangle | getAbsPos(java.lang.Object obj) Returns the absolute coordinates of the object, that is, the coordinates relative to the entire monitor display. |
java.lang.String[] | getArgumentListOfValues(java.lang.Object obj,
java.lang.String methodName,
int argIndex) Returns the possible values for a method argument. |
protected java.lang.String[] | getAttributes(java.lang.Object obj) gets the attributes for GetTOProperty, GetROProperty, SetTOProperty, WaitProperty |
protected static CustomClassManager | getCustomClassManager() Returns the AgentManager's CustomClassManager. |
java.lang.Object | getParent(java.lang.Object obj) Returns the parent object in the Mercury object hierarchy. |
protected static Recorder | getRecorder() Returns the AgentManager's Recorder. |
java.lang.String[] | GetROProperty1_ListOfValues(java.lang.Object o) |
java.lang.Object | getWrapperObject(java.lang.Object wrappedObj) Returns the object that is the wrapper for the specified object. |
static boolean | isInRecord() Checks whether UFT is in a recording session. |
java.lang.String | label_attr(java.lang.Object obj) Returns the label property. |
protected Retval | prepareObject(java.lang.Object obj,
boolean bMakeVisible,
boolean bWaitVisible,
boolean bWaitEnabled,
int timeLeft) A service method called before any custom replay operation. |
void | registerWrapperInspector() Performs registration of a RecordWrapper
for this object's inner objects. |
java.lang.String | tag_attr(java.lang.Object obj) Returns the tag property. |
java.lang.String | to_class_attr(java.lang.Object obj) Returns the name of the test object class mapped to the custom control. |
java.lang.String[] | WaitProperty1_ListOfValues(java.lang.Object o) |
Field Detail |
---|
NONE
public static final int NONE
- No keystroke modifier.
- See Also:
- Constant Field Values
SHIFT
public static final int SHIFT
- Keystroke modifier: shift key.
- See Also:
- Constant Field Values
CONTROL
public static final int CONTROL
- Keystroke modifier: control key.
- See Also:
- Constant Field Values
CONTROL_SHIFT
public static final int CONTROL_SHIFT
- Keystroke modifier: control and shift pressed simultaneously.
- See Also:
- Constant Field Values
LOCK
public static final int LOCK
- Keystroke modifier: caps-lock on.
- See Also:
- Constant Field Values
ALT
public static final int ALT
- Keystroke modifier: alt key.
- See Also:
- Constant Field Values
LEFT
public static final int LEFT
- Mouse-click modifier: left mouse button.
- See Also:
- Constant Field Values
RIGHT
public static final int RIGHT
- Mouse-click modifier: right mouse button.
- See Also:
- Constant Field Values
MIDDLE
public static final int MIDDLE
- Mouse-click modifier: middle mouse button.
- See Also:
- Constant Field Values
UNKNOWN
public static final int UNKNOWN
- Unrecognized code.
- See Also:
- Constant Field Values
LIST_OF_VALUES_METHOD_SUFFIX
public static final java.lang.String LIST_OF_VALUES_METHOD_SUFFIX
- See Also:
- Constant Field Values
Constructor Detail |
---|
ObjectCS
public ObjectCS()
Method Detail |
---|
getRecorder
protected static final Recorder getRecorder()
- Returns the AgentManager's Recorder.
getCustomClassManager
protected static final CustomClassManager getCustomClassManager()
- Returns the AgentManager's CustomClassManager.
getArgumentListOfValues
public java.lang.String[] getArgumentListOfValues(java.lang.Object obj, java.lang.String methodName, int argIndex)
- Returns the possible values for a method argument.
For example, if a combo box is passed as the object, and select is passed as the method,
getArgumentListOfValues
returns an array of strings each containing the text representation of a value that can be selected. - Parameters:
obj
- The GUI object for which the method is invoked.methodName
- The name of the method.argIndex
- The index in the method's argument list for which the to retrieve the list.- Returns:
- An array of the string representations of possible values for the method argument.
to_class_attr
public java.lang.String to_class_attr(java.lang.Object obj)
- Returns the name of the test object class mapped to the custom control.
registerWrapperInspector
public void registerWrapperInspector()
- Performs registration of a
RecordWrapper
for this object's inner objects. This method is called by every support class constructor. Support classes that support compound objects should override this method's default implementation. Your implementation should call registerWrapperInspector once for each class this object wraps. - See Also:
MicAPI.registerWrapperInspector
getWrapperObject
public java.lang.Object getWrapperObject(java.lang.Object wrappedObj)
- Returns the object that is the wrapper for the specified object. If wrappedObj is not wrapped, returns null. This method is called by the QTP infrastructure only if the custom support object declared itself as a wrapper of objects of the type of wrappedObj.
- Parameters:
wrappedObj
- The object for whose type to find a wrapper object.
enumChildren
public java.util.Vector enumChildren(java.lang.Object obj)
- Returns all those children of an object that are to be
recognized for recording.
Returns null if the object does not have subcomponents.
enumChildren
is implemented in theContainerCS
class to return all children of the container. - Parameters:
obj
- The container whose recordable children are returned.- Returns:
- The Vector of the recordable children.
getParent
public java.lang.Object getParent(java.lang.Object obj)
- Returns the parent object in the Mercury object hierarchy. This is usually the same hierarchy found in a toolkit.
- Parameters:
obj
- The object for which to get the parent.- Returns:
- The parent object.
getAbsPos
public java.awt.Rectangle getAbsPos(java.lang.Object obj)
- Returns the absolute coordinates of the object, that is, the coordinates relative to the entire monitor display. The basic implementation of the function returns the results of four objGetInfo() calls with arguments abs_x, abs_y, width, and height. The function is overridden in the ComponentCS class for better performance.
- Parameters:
obj
- The object for which to get coordinates.- Returns:
- A Rectangle containing the object's absolute position.
isInRecord
public static final boolean isInRecord()
- Checks whether UFT is in a recording session.
The method is called by the UFT infrastructure when the
support class sends a Record message. If
isInRecord
is false, the message is ignored.
Call this method from your application to avoid destructive or time-consuming calculations or other activities that are not required unless UFT is recording.
prepareObject
protected Retval prepareObject(java.lang.Object obj, boolean bMakeVisible, boolean bWaitVisible, boolean bWaitEnabled, int timeLeft)
- A service method called before any custom replay operation.
- Parameters:
obj
- The object to prepare for the replay operation.bMakeVisible
- If true, makes the object visible before the replay.bWaitVisible
- If true, waits either for the object to be visible or for the timeout. If timed out, replay continues with no error.bWaitEnabled
- If true, waits either for the object to be enabled or for the timeout. If timed out, replay continues with no error.timeLeft
- The time remaining in the timeout. The routine that calls this method controls the timeout loop.
class_attr
public java.lang.String class_attr(java.lang.Object obj)
- Returns the name of the generic type of the
test object class mapped to the custom control.
For example,
class_attr
may return object, button, edit, menu, or static_text.
label_attr
public java.lang.String label_attr(java.lang.Object obj)
- Returns the label property. If not overridden, returns the label property of the superclass or the text of an adjacent static text.
tag_attr
public java.lang.String tag_attr(java.lang.Object obj)
- Returns the tag property.
The default implementation is:
For non-object classestag_attr
searches, in this order, the label attribute, the attached_text attribute, and the custom class name. It returns the first non-empty attribute.
For object classes, the class name is returned.
To change the name of a custom control test object, do not overridetag_attr
in the support class. Override thelabel_attr
.
attached_text_attr
public java.lang.String attached_text_attr(java.lang.Object obj)
- Returns the text of adjacent static-text objects. This is useful for controls like edit boxes that do not have their own descriptive text, but have an adjacent label.
genericEventHandling
protected boolean genericEventHandling(java.lang.Object event)
- Checks whether the specified event is handled in a generic manner.
addSimpleListener
protected void addSimpleListener(java.lang.String listenerName, java.lang.String addMethodName, java.lang.String removeMethodName)
- Adds the calling custom support object as a simple listener.
- Parameters:
listenerName
- The name of the listener.addMethodName
- The name of the add method.removeMethodName
- The name of the remove method.
addSimpleListener
protected void addSimpleListener(java.lang.String listenerName, java.lang.String addMethodName, java.lang.String removeMethodName, java.util.EventListener listener)
- Adds the simple listener specified with the listener argument.
- Parameters:
listenerName
- The name of the listener.addMethodName
- The name of the add method.removeMethodName
- The name of the remove method.listener
- The EventListener.
getAttributes
protected java.lang.String[] getAttributes(java.lang.Object obj)
- gets the attributes for GetTOProperty, GetROProperty, SetTOProperty, WaitProperty
- Parameters:
obj
- the object inspected- Returns:
- String[] of the attributes
GetROProperty1_ListOfValues
public java.lang.String[] GetROProperty1_ListOfValues(java.lang.Object o)
WaitProperty1_ListOfValues
public java.lang.String[] WaitProperty1_ListOfValues(java.lang.Object o)