public class JMenuAgent extends JMenuAgent
Modifier and Type | Field and Description |
---|---|
protected java.util.Vector |
path |
protected ComponentTester |
tester |
objectType
alternateAncestor, alternateAncestorClassname, factory
Constructor and Description |
---|
JMenuAgent()
Creates a new instance of JMenuAgent
|
Modifier and Type | Method and Description |
---|---|
protected javax.swing.JMenuBar |
getMenuBar(java.lang.Object object)
returns the relevant menubar control of the given menu item control
|
TestRecordData |
process(java.lang.Object object,
TestRecordData testRecordData)
Process the action provided in the testRecordData.
|
getMatchingPathObject, getSubItemAtIndex, isMatchingPath, traverseMenu
getChildCount, getChildren
convertCoords, validateActionCommand, validateComponent
getAlternateAncestor, getAlternateAncestorClassname, getAncestorAgent, getCaption, getClassName, getID, getLevel, getLocalAgentFactory, getName, getProperty, getPropertyNames, getStringData, getSuperClassNames, getText, isShowing, isValid, processAncestor, setAlternateAncestor, setAlternateAncestorClassname, setLocalAgentFactory
public TestRecordData process(java.lang.Object object, TestRecordData testRecordData)
ObjectAgent
Subclasses in the org.safs.jvmagent package should always attempt to processAncestor
if they themselves do not handle the command in the testRecordData. This is shown
below:
if (testRecordData.getStatusCode() == StatusCodes.SCRIPT_NOT_EXECUTED)
processAncestor(object, testRecordData);
Subclasses in other packages like org.safs.abbot should typically always call
super.process() if they themselves do not handle the command in the testRecordData.
This is shown below:
if (testRecordData.getStatusCode() == StatusCodes.SCRIPT_NOT_EXECUTED)
super.process(object, testRecordData);
In this way, the proper order of processing in-package classes and superclasses
is maintained.
An Agent may throw various types of Agent-specific RuntimeExceptions depending upon failure modes.
process
in interface LocalAgent
process
in class ObjectAgent
testRecordData
- provides all the information needed by the Agent to perform the action and
to get/set the process statuscode.protected javax.swing.JMenuBar getMenuBar(java.lang.Object object)
object
- the menu item control (JMenu, JMenuItem or subclasses)