org.eclipse.actf.accservice.javapp
Class JavaAccessible

java.lang.Object
  extended by org.eclipse.actf.accservice.javapp.JavaAccessible
All Implemented Interfaces:
IAccessibleElement, IAccessibleElement2

public class JavaAccessible
extends Object
implements IAccessibleElement2

implementation for the Java Swing Accesibility API's Accessible. All methods are passed onto the underlying AccessibleContext object.

Author:
Mike Squillace
See Also:
Accessible

Constructor Summary
JavaAccessible(Object comp)
          wrap the given object as a ACTF IAccessibleElement.
 
Method Summary
 void checkIsValid()
          checks whether or not this accessible element is in a valid state.
 Object element()
          get the element associated with this accessible element
 boolean equals(Object other)
           
 Object getAccessibleAction()
          return the default action
 IAccessibleElement getAccessibleChild(int index)
          return the child at the given index of this accessible element.
 int getAccessibleChildCount()
          return the number of children of this element.
 IAccessibleElement[] getAccessibleChildren()
          return all of the children of this accessible element.
 String getAccessibleDescription()
          return description or use of control
 IAccessibleEditableTextElement getAccessibleEditableText()
          get the accessible Editable Text for this object
 IAccessibleImageElement[] getAccessibleImage()
          get the accessible image elements for this object
 int getAccessibleIndexInParent()
          retreave the index of this accessible within its parent accessible
 String getAccessibleKeyboardShortcut()
          return the keyboard shortcut or mnemonic
 Rectangle getAccessibleLocation()
          Gets the bounds of this object in the form of a Rectangle object.
 String getAccessibleName()
          return the name or short description of this element
 IAccessibleElement getAccessibleParent()
          returns the parent accessible object.
 Map getAccessibleRelations()
          get the relations for this accessible element.
 String getAccessibleRole()
          return role or function of control.
 IAccessibleElement[] getAccessibleSelection()
          get the list of selected accessibles.
 Set getAccessibleState()
          return the state of the control.
 IAccessibleTableElement getAccessibleTable()
          get the accessible table element for this object
 IAccessibleTextElement getAccessibleText()
          get the accessible text element for this object
 Object getAccessibleValue()
          return the value (e.g. of a scroll bar or combo)
 String getAccessibleValueMax()
           
 String getAccessibleValueMin()
           
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaAccessible

public JavaAccessible(Object comp)
wrap the given object as a ACTF IAccessibleElement. The ACTF engine will invoke this constructor using a registered adaptor factory. Clients do not typically call this constructor.

Parameters:
comp -
Method Detail

checkIsValid

public void checkIsValid()
                  throws InvalidComponentException
checks whether or not this accessible element is in a valid state. Validity may consist of whether or not the original element has been disposed or destroyed, whether or not this accessible was successfully initialized, and so forth.

Accessing properties of invalid accessible elements will raise an InvalidComponentException.

Specified by:
checkIsValid in interface IAccessibleElement
Throws:
InvalidComponentException

getAccessibleAction

public Object getAccessibleAction()
                           throws InvalidComponentException
return the default action

Specified by:
getAccessibleAction in interface IAccessibleElement
Returns:
default action or null if no default action is provided
Throws:
InvalidComponentException

getAccessibleChildCount

public int getAccessibleChildCount()
                            throws InvalidComponentException
return the number of children of this element.

Specified by:
getAccessibleChildCount in interface IAccessibleElement
Returns:
number of children of this element
Throws:
InvalidComponentException

getAccessibleChildren

public IAccessibleElement[] getAccessibleChildren()
                                           throws InvalidComponentException
return all of the children of this accessible element.

Specified by:
getAccessibleChildren in interface IAccessibleElement
Returns:
all children of this element
Throws:
InvalidComponentException

getAccessibleChild

public IAccessibleElement getAccessibleChild(int index)
                                      throws InvalidComponentException
return the child at the given index of this accessible element.

Specified by:
getAccessibleChild in interface IAccessibleElement
Returns:
child at the given index of this element
Throws:
InvalidComponentException

getAccessibleDescription

public String getAccessibleDescription()
                                throws InvalidComponentException
return description or use of control

Specified by:
getAccessibleDescription in interface IAccessibleElement
Returns:
description of control or an empty string if no description is provided
Throws:
InvalidComponentException

element

public Object element()
Description copied from interface: IAccessibleElement
get the element associated with this accessible element

Specified by:
element in interface IAccessibleElement
Returns:
original element associated with this accessible or null if this object was not initialized in such a way that the original element is available

getAccessibleKeyboardShortcut

public String getAccessibleKeyboardShortcut()
                                     throws InvalidComponentException
return the keyboard shortcut or mnemonic

Specified by:
getAccessibleKeyboardShortcut in interface IAccessibleElement
Returns:
keyboard shortcut or an empty string if no shortcut is provided
Throws:
InvalidComponentException

getAccessibleName

public String getAccessibleName()
                         throws InvalidComponentException
return the name or short description of this element

Specified by:
getAccessibleName in interface IAccessibleElement
Returns:
name or an empty string if no name is provided
Throws:
InvalidComponentException

getAccessibleParent

public IAccessibleElement getAccessibleParent()
                                       throws InvalidComponentException
returns the parent accessible object.

Specified by:
getAccessibleParent in interface IAccessibleElement
Returns:
parent accessible element or null if no parent for this element exists
Throws:
InvalidComponentException

getAccessibleIndexInParent

public int getAccessibleIndexInParent()
                               throws InvalidComponentException
retreave the index of this accessible within its parent accessible

Specified by:
getAccessibleIndexInParent in interface IAccessibleElement
Returns:
index of this accessible in its parent or -1 if not available
Throws:
InvalidComponentException

getAccessibleRelations

public Map getAccessibleRelations()
                           throws InvalidComponentException
get the relations for this accessible element. Such objects express this element's relation to other accessible elements (e.g. the element is a "member of" or "labeled by" some other element). The map should have the relation type as key and relation target(s) as value. The value will be an array of IAccessibleElement objects.

Note: All attempts will be made to use keys that match one of the pre-defined relation constants in AccessibleConstants. Should the relation type be unknown or not match one of the pre-defined constants, the original relationship type from the underlying accessibility model will be returned.

Specified by:
getAccessibleRelations in interface IAccessibleElement2
Returns:
accessible relations held by this element to other accessible elements
Throws:
InvalidComponentException

getAccessibleRole

public String getAccessibleRole()
                         throws InvalidComponentException
return role or function of control.

Note: All attempts will be made to return one of the pre-defined role constants in AccessibleConstants. Should the role be unknown or not match one of the pre-defined constants, the original role string from the underlying accessibility model will be returned.

Specified by:
getAccessibleRole in interface IAccessibleElement
Returns:
role of control or an empty string if no role is provided
Throws:
InvalidComponentException
See Also:
AccessibleConstants

getAccessibleSelection

public IAccessibleElement[] getAccessibleSelection()
                                            throws InvalidComponentException
get the list of selected accessibles.

Specified by:
getAccessibleSelection in interface IAccessibleElement
Returns:
selections or empty array if no selection
Throws:
InvalidComponentException

getAccessibleState

public Set getAccessibleState()
                       throws InvalidComponentException
return the state of the control. Note that the returned string may contain several states separated by commas.

Note: All attempts will be made to return one of the pre-defined state constants in AccessibleConstants. Should the state be unknown or not match one of the pre-defined constants, the original state from the underlying accessibility model will be returned.

Specified by:
getAccessibleState in interface IAccessibleElement
Returns:
state of control or an empty set if no state is provided
Throws:
InvalidComponentException
See Also:
AccessibleConstants

getAccessibleValue

public Object getAccessibleValue()
                          throws InvalidComponentException
return the value (e.g. of a scroll bar or combo)

Specified by:
getAccessibleValue in interface IAccessibleElement
Returns:
value or an empty string if no value is provided
Throws:
InvalidComponentException

getAccessibleValueMin

public String getAccessibleValueMin()
                             throws InvalidComponentException
Throws:
InvalidComponentException

getAccessibleValueMax

public String getAccessibleValueMax()
                             throws InvalidComponentException
Throws:
InvalidComponentException

getAccessibleTable

public IAccessibleTableElement getAccessibleTable()
                                           throws InvalidComponentException
get the accessible table element for this object

Specified by:
getAccessibleTable in interface IAccessibleElement2
Returns:
table or null if no table is available
Throws:
InvalidComponentException

getAccessibleText

public IAccessibleTextElement getAccessibleText()
                                         throws InvalidComponentException
get the accessible text element for this object

Specified by:
getAccessibleText in interface IAccessibleElement2
Returns:
text object or null if no text is available
Throws:
InvalidComponentException

getAccessibleImage

public IAccessibleImageElement[] getAccessibleImage()
                                             throws InvalidComponentException
get the accessible image elements for this object

Specified by:
getAccessibleImage in interface IAccessibleElement2
Returns:
array of image objects or empty array if no images are available
Throws:
InvalidComponentException

getAccessibleEditableText

public IAccessibleEditableTextElement getAccessibleEditableText()
                                                         throws InvalidComponentException
Description copied from interface: IAccessibleElement2
get the accessible Editable Text for this object

Specified by:
getAccessibleEditableText in interface IAccessibleElement2
Returns:
EditbleText object or null if no EditableText is available
Throws:
InvalidComponentException

getAccessibleLocation

public Rectangle getAccessibleLocation()
                                throws InvalidComponentException
Description copied from interface: IAccessibleElement
Gets the bounds of this object in the form of a Rectangle object. The bounds specify this object's width, height, and location relative to its parent.

Specified by:
getAccessibleLocation in interface IAccessibleElement
Returns:
A rectangle indicating this component's bounds; null if this object is not on the screen.
Throws:
InvalidComponentException

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object