org.eclipse.actf.accservice.mozdom
Class MozillaAccessible

java.lang.Object
  extended by org.eclipse.actf.accservice.mozdom.MozillaAccessible
All Implemented Interfaces:
IAccessibleElement

public class MozillaAccessible
extends Object
implements IAccessibleElement


Constructor Summary
MozillaAccessible(org.mozilla.interfaces.nsIAccessible acc)
          wrap the given object as a ACTF IAccessibleElement.
MozillaAccessible(Object element)
           
 
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
 String 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
 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<Long,org.mozilla.interfaces.nsIAccessible> getAccessibleRelations()
           
 String getAccessibleRole()
          return role or function of control.
 IAccessibleElement[] getAccessibleSelection()
          get the list of selected accessibles.
 Set<String> getAccessibleState()
          return the state of the control.
 String getAccessibleValue()
          return the value (e.g. of a scroll bar or combo)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MozillaAccessible

public MozillaAccessible(Object element)

MozillaAccessible

public MozillaAccessible(org.mozilla.interfaces.nsIAccessible acc)
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:
acc -
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 String 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
Description copied from interface: IAccessibleElement
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

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<Long,org.mozilla.interfaces.nsIAccessible> getAccessibleRelations()
                                                                      throws InvalidComponentException
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<String> 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 String 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

element

public Object element()
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

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