org.safs.jvmagent
Class ComponentAgent

java.lang.Object
  |
  +--org.safs.jvmagent.ObjectAgent
        |
        +--org.safs.jvmagent.ComponentAgent
All Implemented Interfaces:
AlternateAncestorUser, LocalAgent, LocalAgentFactoryUser
Direct Known Subclasses:
ComponentAgent, ContainerAgent

public class ComponentAgent
extends ObjectAgent


Field Summary
static java.lang.String[] COMPONENT_PROPERTIES
          Array of property names specific to Component types.
static java.lang.String objectType
          "Component" (Subclasses will override) The generic object type supported by this Agent helper class.
 
Fields inherited from class org.safs.jvmagent.ObjectAgent
alternateAncestor, alternateAncestorClassname, factory, OBJECT_PROPERTIES
 
Constructor Summary
ComponentAgent()
          Constructor for ComponentAgent.
 
Method Summary
 java.lang.String getProperty(java.lang.Object object, java.lang.String property)
          Retrieve the property value of the object if the object has the property.
 java.lang.String[] getPropertyNames(java.lang.Object object)
          Retrieve the list of available properties for the object.
protected  java.lang.String validateActionCommand(TestRecordData testRecordData)
          Verify testRecordData.getCommand() is not null or 0-length.
protected  java.awt.Component validateComponent(java.lang.Object object)
          Verify the object is an instanceof java.awt.Component.
 
Methods inherited from class org.safs.jvmagent.ObjectAgent
getAlternateAncestor, getAlternateAncestorClassname, getAncestorAgent, getCaption, getChildCount, getChildren, getClassName, getID, getLevel, getLocalAgentFactory, getMatchingPathObject, getName, getStringData, getSuperClassNames, getText, isMatchingPath, isShowing, isValid, process, processAncestor, setAlternateAncestor, setAlternateAncestorClassname, setLocalAgentFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

objectType

public static final java.lang.String objectType
"Component" (Subclasses will override) The generic object type supported by this Agent helper class. The generic object type is that returned by GuiClassData.getGenericObjectType. Example: Component Button Table etc..
See Also:
GuiClassData.getGenericObjectType(String)

COMPONENT_PROPERTIES

public static final java.lang.String[] COMPONENT_PROPERTIES
Array of property names specific to Component types.
  1. background
  2. bounds
  3. cursor
  4. focusTraversalKeysEnabled
  5. font
  6. foreground
  7. height
  8. inputContext
  9. locale
  10. location
  11. screenLocation
  12. maxSize
  13. minSize
  14. name
  15. parent
  16. preferSize
  17. size
  18. width
  19. x
  20. y
  21. focus
  22. hasBackground
  23. hasCursor
  24. displayable
  25. doubleBuffered
  26. enabled
  27. focusable
  28. focusOwner
  29. hasFont
  30. hasForeground
  31. lightweight
  32. opaque
  33. showing
  34. valid
  35. visible
  36. .description
  37. .name
  38. .parent
  39. .role
  40. .state
  41. .text
  42. .value
Subclasses will have additional property names in other named arrays. The full set of property names is received with a call to getPropertyNames();
See Also:
getPropertyNames(Object)
Constructor Detail

ComponentAgent

public ComponentAgent()
Constructor for ComponentAgent.
Method Detail

getPropertyNames

public java.lang.String[] getPropertyNames(java.lang.Object object)
Description copied from interface: LocalAgent
Retrieve the list of available properties for the object.
Overrides:
getPropertyNames in class ObjectAgent
Parameters:
object - -- the actual object or component to be checked -- not a pseudo reference.
Returns:
ALL_PROPERTIES
See Also:
LocalAgent.getPropertyNames(Object)

getProperty

public java.lang.String getProperty(java.lang.Object object,
                                    java.lang.String property)
                             throws NoSuchPropertyException
Description copied from interface: LocalAgent
Retrieve the property value of the object if the object has the property.
Overrides:
getProperty in class ObjectAgent
Parameters:
object - -- the actual object or component to be checked -- not a pseudo reference.
property - -- case-sensitive name of the property to retrieve
Returns:
property value which may be null
Throws:
NoSuchPropertyException -  
See Also:
LocalAgent.getProperty(Object, String)

validateActionCommand

protected java.lang.String validateActionCommand(TestRecordData testRecordData)
Verify testRecordData.getCommand() is not null or 0-length.
Returns:
the retrieved action command.
Throws:
SAFSInvalidActionRuntimeException("null") - if action is null.
SAFSInvalidActionRuntimeException("empty") - if action is 0-length.

validateComponent

protected java.awt.Component validateComponent(java.lang.Object object)
Verify the object is an instanceof java.awt.Component.
Returns:
the cast Component on success.
Throws:
SAFSInvalidComponentRuntimeException("null") - if component is null or not a Component.
SAFSInvalidComponentRuntimeException(object.getClass().getName()) - if component is not a Component.