org.eclipse.actf.accservice.core.win32.ia2
Class IA2Accessible

java.lang.Object
  extended by org.eclipse.actf.accservice.core.win32.msaa.MsaaAccessible
      extended by org.eclipse.actf.accservice.core.win32.ia2.IA2Accessible
All Implemented Interfaces:
IAccessibleElement, IAccessibleElement2

public class IA2Accessible
extends MsaaAccessible
implements IAccessibleElement2

implementation of IAccessibleElement for GUI controls that implement IAccessible2/IBM interfaces.

This class is a wrapper for an IAccessible2 pointer, a pointer that Provides access to a native Windows object that provides assistive technologies (ATs) with properties of GUI components that allow the AT to offer an alternative interface to the control. This class relies upon JCAccessible.dll for most of its implementation. The documentation for the Microsoft COM library and, in particular, for IAccessible2/IBM will be helpful.

Author:
Mike Smith, Kavitha Teegala

Field Summary
 
Fields inherited from class org.eclipse.actf.accservice.core.win32.msaa.MsaaAccessible
accRef, childId, childId_self, computingIndexInParent, element, errorCodeReturnMap, errString, highLightEnabled, hwnd, indexInParent, MAX_CHILDREN, SWT_ACC_TYPENAME, SWT_CTRL_TYPENAME, SWT_WIDGET_TYPENAME
 
Constructor Summary
IA2Accessible(int ref)
          create an IA2Accessible element based on a reference pointer
IA2Accessible(int hwnd, int childID)
          construct an IA2Accessible from a window handle.
IA2Accessible(Object control)
          create an IA2Accessible element from the given control.
IA2Accessible(Point location)
          create an IA2Accessible element by utilizing the MSAA function AccessibleObjectFromPoint.
 
Method Summary
 boolean doDefaultAction()
           
 boolean equals(Object other)
           
protected  void finalize()
           
 Object getAccessibleAction2()
           
 IA2AccessibleApplication getAccessibleApplication()
           
 String getAccessibleAttributes()
           
 IAccessibleElement getAccessibleChild(int childID)
          return the child with the given ID.
 IAccessibleElement[] getAccessibleChildren()
          return all of the children of this MsaaAccessible.
 IA2AccessibleComponent getAccessibleComponent()
           
 IAccessibleEditableTextElement getAccessibleEditableText()
          get the accessible Editable Text for this object
 String getAccessibleExtendedRole()
           
 int getAccessibleExtendedStateCount()
           
 Set getAccessibleExtendedStates()
           
 List getAccessibleGroupPosition()
           
 IA2AccessibleHyperlink getAccessibleHyperlink()
           
 IA2AccessibleHypertext getAccessibleHypertext()
           
 IAccessibleImageElement[] getAccessibleImage()
          get the accessible image elements for this object
 int getAccessibleIndexInParent()
          retreave the index of this accessible within its parent accessible
 Locale getAccessibleLocale()
           
 String getAccessibleLocalizedExtendedRole()
           
 Set getAccessibleLocalizedExtendedStates()
           
 IAccessibleElement getAccessibleParent()
          returns the parent accessible object.
 Map getAccessibleRelation(int relationIndex)
           
 int getAccessibleRelationCount()
           
 Map getAccessibleRelations()
          get the relations for this accessible element.
 String getAccessibleRole()
          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.

 Set getAccessibleState()
          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.

 Set getAccessibleStates()
           
 IAccessibleTableElement getAccessibleTable()
          get the accessible table element for this object
 IAccessibleTextElement getAccessibleText()
          get the accessible text element for this object
 Object getAccessibleValue2()
          
 int getAccessibleWindowHandle()
           
 int getUniqueID()
           
static int IA2FromIAcc(IAccessibleElement accElem)
           
protected  void initFromHtmlElement(int htmlElemRef)
           
protected  void initFromHwnd(int hwnd, int childID)
           
protected  void initFromPoint(int x, int y)
           
protected  int internalGetAccessibleAction2()
           
protected  int internalGetAccessibleApplication()
           
protected  int internalGetAccessibleComponent()
           
protected  int internalGetAccessibleEditableText()
           
protected  int internalGetAccessibleHyperLink()
           
protected  int internalGetAccessibleHyperText()
           
protected  int[] internalGetAccessibleImage()
           
protected  String internalGetAccessibleRelation(int relationIndex)
           
protected  String[] internalGetAccessibleRelations(int maxRelations)
           
protected  String internalGetAccessibleRole()
           
protected  long internalGetAccessibleRoleAsLong()
           
protected  long internalGetAccessibleStateAsLong()
           
protected  int internalGetAccessibleTable()
           
protected  int internalGetAccessibleText()
           
protected  int internalGetAccessibleValue2()
           
protected  int internalGetAccParent()
           
protected  int internalGetAddress()
           
protected  String internalGetAttributes()
           
protected  int internalGetChildId()
           
protected  String internalGetExtendedRole()
           
protected  int internalGetExtendedStateCount()
           
protected  String[] internalGetExtendedStates(int maxExtendedStates)
           
protected  int[] internalGetGroupPosition()
           
protected  int internalGetIA2AccessibleChild(int childID)
           
protected  int[] internalGetIA2AccessibleChildren()
           
protected static int internalGetIA2fromIAcc(int iacc)
           
protected  int internalGetIndexInParent()
           
protected  String[] internalGetLocale()
           
protected  String internalGetLocalizedExtendedRole()
           
protected  String[] internalGetLocalizedExtendedStates(int maxLocalizedExtendedStates)
           
protected  int internalGetNRelations()
           
protected  int internalGetStates()
           
protected  int internalGetUniqueID()
           
protected  int internalGetWindowHandle()
           
protected static int internalInitFromHtmlElement(int htmlElemRef)
           
protected static int internalInitFromHwnd(int hwnd, int childID)
           
protected static int internalInitFromPoint(int x, int y)
           
protected static boolean internalIsIA2Accessible(int iacc)
           
protected  boolean internalScrollTo(int topLeft)
           
protected  boolean internalScrollToPoint(int coordinateType, int x, int y)
           
static boolean isIA2Accessible(IAccessibleElement accElem)
           
static Map propertyMap()
           
 boolean scrollTo(int topLeft)
           
 boolean scrollToPoint(int coordinateType, Point pt)
           
 
Methods inherited from class org.eclipse.actf.accservice.core.win32.msaa.MsaaAccessible
checkIsValid, classNameFromHwnd, dispose, drawRectangle, element, eraseDesktop, eraseRectangle, errorCodeMap, getAccessibleAction, getAccessibleAddress, getAccessibleChildCount, getAccessibleDefaultAction, getAccessibleDescription, getAccessibleHelp, getAccessibleHelpTopic, getAccessibleKeyboardShortcut, getAccessibleLocation, getAccessibleMsaaRole, getAccessibleName, getAccessibleSelection, getAccessibleValue, getChildId, getWindowHandle, getWindowHandleAsHex, hasFocus, hashCode, internalDispose, internalDoDefaultAction, internalDrawRectangle, internalEraseDesktop, internalEraseRectangle, internalGetAccessibleAction, internalGetAccessibleChild, internalGetAccessibleChildCount, internalGetAccessibleChildren, internalGetAccessibleDescription, internalGetAccessibleHelp, internalGetAccessibleHelpTopic, internalGetAccessibleKeyboardShortcut, internalGetAccessibleLocation, internalGetAccessibleName, internalGetAccessibleParent, internalGetAccessibleRoleAsInt, internalGetAccessibleSelection, internalGetAccessibleState, internalGetAccessibleValue, internalGetClassNameFromHwnd, internalHasFocus, internalRef, internalSelect, isDisposed, isHighlightEnabled, isSimpleChild, putErrorCode, select, setHighlightEnabled, testAndConvertToIA2, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.actf.accservice.core.IAccessibleElement
checkIsValid, element, getAccessibleAction, getAccessibleChildCount, getAccessibleDescription, getAccessibleKeyboardShortcut, getAccessibleLocation, getAccessibleName, getAccessibleSelection, getAccessibleValue
 

Constructor Detail

IA2Accessible

public IA2Accessible(int hwnd,
                     int childID)
construct an IA2Accessible from a window handle. To create a MsaaAccessible from a handle for an SWT control, use a child id of ACC.CHILDID_SELF.

Parameters:
hwnd - - window handle for an SWT control
childID - - child ID (if any)

IA2Accessible

public IA2Accessible(Object control)
create an IA2Accessible element from the given control. Currently, supported controls include:

Parameters:
control -

IA2Accessible

public IA2Accessible(Point location)
create an IA2Accessible element by utilizing the MSAA function AccessibleObjectFromPoint.

Parameters:
location - - any location on the current display device

IA2Accessible

public IA2Accessible(int ref)
create an IA2Accessible element based on a reference pointer

Parameters:
ref - - reference point
Method Detail

initFromHwnd

protected void initFromHwnd(int hwnd,
                            int childID)
Overrides:
initFromHwnd in class MsaaAccessible

initFromPoint

protected void initFromPoint(int x,
                             int y)
Overrides:
initFromPoint in class MsaaAccessible

initFromHtmlElement

protected void initFromHtmlElement(int htmlElemRef)
Overrides:
initFromHtmlElement in class MsaaAccessible

internalGetWindowHandle

protected int internalGetWindowHandle()
Overrides:
internalGetWindowHandle in class MsaaAccessible

internalGetChildId

protected int internalGetChildId()
Overrides:
internalGetChildId in class MsaaAccessible

internalInitFromHwnd

protected static int internalInitFromHwnd(int hwnd,
                                          int childID)

internalInitFromHtmlElement

protected static int internalInitFromHtmlElement(int htmlElemRef)

internalInitFromPoint

protected static int internalInitFromPoint(int x,
                                           int y)

getAccessibleParent

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

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

internalGetAccParent

protected int internalGetAccParent()

getAccessibleChildren

public IAccessibleElement[] getAccessibleChildren()
                                           throws InvalidComponentException
Description copied from class: MsaaAccessible
return all of the children of this MsaaAccessible. Note that children include either MsaaAccessible objects that represent MsaaAccessible wrappers of IAccessible pointers or MsaaAccessible objects that wrap "simple" children, children that share their properties with their IAccessible parent.

Specified by:
getAccessibleChildren in interface IAccessibleElement
Overrides:
getAccessibleChildren in class MsaaAccessible
Returns:
children of this MsaaAccessible
Throws:
InvalidComponentException

internalGetIA2AccessibleChildren

protected int[] internalGetIA2AccessibleChildren()

getAccessibleChild

public IAccessibleElement getAccessibleChild(int childID)
                                      throws InvalidComponentException
return the child with the given ID. This id is not an index into the children of a IA2ccessible object, though children are typically numbered as such. Also, note that the returned IA2Accessible need not correspond to an SWT control.

Specified by:
getAccessibleChild in interface IAccessibleElement
Overrides:
getAccessibleChild in class MsaaAccessible
Parameters:
childID - ID of desired child
Returns:
child of this IA2Accessible with ID
Throws:
InvalidComponentException

internalGetIA2AccessibleChild

protected int internalGetIA2AccessibleChild(int childID)

getAccessibleValue2

public Object getAccessibleValue2()
                           throws InvalidComponentException

Throws:
InvalidComponentException

internalGetAccessibleValue2

protected int internalGetAccessibleValue2()

getAccessibleApplication

public IA2AccessibleApplication getAccessibleApplication()
                                                  throws InvalidComponentException
Throws:
InvalidComponentException

internalGetAccessibleApplication

protected int internalGetAccessibleApplication()

getAccessibleAction2

public Object getAccessibleAction2()
                            throws InvalidComponentException
Throws:
InvalidComponentException

internalGetAccessibleAction2

protected int internalGetAccessibleAction2()

getAccessibleComponent

public IA2AccessibleComponent getAccessibleComponent()
                                              throws InvalidComponentException
Throws:
InvalidComponentException

internalGetAccessibleComponent

protected int internalGetAccessibleComponent()

getAccessibleHypertext

public IA2AccessibleHypertext getAccessibleHypertext()
                                              throws InvalidComponentException
Throws:
InvalidComponentException

internalGetAccessibleHyperText

protected int internalGetAccessibleHyperText()

getAccessibleHyperlink

public IA2AccessibleHyperlink getAccessibleHyperlink()
                                              throws InvalidComponentException
Throws:
InvalidComponentException

internalGetAccessibleHyperLink

protected int internalGetAccessibleHyperLink()

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

internalGetAccessibleTable

protected int internalGetAccessibleTable()

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

internalGetAccessibleText

protected int internalGetAccessibleText()

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

internalGetAccessibleImage

protected int[] internalGetAccessibleImage()

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
Overrides:
getAccessibleRole in class MsaaAccessible
Returns:
role of control or an empty string if no role is provided
Throws:
InvalidComponentException
See Also:
AccessibleConstants

internalGetAccessibleRoleAsLong

protected long internalGetAccessibleRoleAsLong()

internalGetAccessibleRole

protected String internalGetAccessibleRole()
Overrides:
internalGetAccessibleRole in class MsaaAccessible

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
Overrides:
getAccessibleState in class MsaaAccessible
Returns:
state of control or an empty set if no state is provided
Throws:
InvalidComponentException
See Also:
AccessibleConstants

internalGetAccessibleStateAsLong

protected long internalGetAccessibleStateAsLong()

isIA2Accessible

public static boolean isIA2Accessible(IAccessibleElement accElem)

IA2FromIAcc

public static int IA2FromIAcc(IAccessibleElement accElem)

internalGetAddress

protected int internalGetAddress()
Overrides:
internalGetAddress in class MsaaAccessible

internalIsIA2Accessible

protected static boolean internalIsIA2Accessible(int iacc)

internalGetIA2fromIAcc

protected static int internalGetIA2fromIAcc(int iacc)

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

internalGetAccessibleEditableText

protected int internalGetAccessibleEditableText()

getAccessibleRelationCount

public int getAccessibleRelationCount()
                               throws InvalidComponentException
Throws:
InvalidComponentException

internalGetNRelations

protected int internalGetNRelations()

getAccessibleRelation

public Map getAccessibleRelation(int relationIndex)
                          throws InvalidComponentException
Throws:
InvalidComponentException

internalGetAccessibleRelation

protected String internalGetAccessibleRelation(int relationIndex)

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

internalGetAccessibleRelations

protected String[] internalGetAccessibleRelations(int maxRelations)

scrollTo

public boolean scrollTo(int topLeft)
                 throws InvalidComponentException
Throws:
InvalidComponentException

internalScrollTo

protected boolean internalScrollTo(int topLeft)

scrollToPoint

public boolean scrollToPoint(int coordinateType,
                             Point pt)
                      throws InvalidComponentException
Throws:
InvalidComponentException

internalScrollToPoint

protected boolean internalScrollToPoint(int coordinateType,
                                        int x,
                                        int y)

getAccessibleGroupPosition

public List getAccessibleGroupPosition()
                                throws InvalidComponentException
Throws:
InvalidComponentException

internalGetGroupPosition

protected int[] internalGetGroupPosition()

getAccessibleStates

public Set getAccessibleStates()
                        throws InvalidComponentException
Throws:
InvalidComponentException

internalGetStates

protected int internalGetStates()

getAccessibleExtendedRole

public String getAccessibleExtendedRole()
                                 throws InvalidComponentException
Throws:
InvalidComponentException

internalGetExtendedRole

protected String internalGetExtendedRole()

getAccessibleLocalizedExtendedRole

public String getAccessibleLocalizedExtendedRole()
                                          throws InvalidComponentException
Throws:
InvalidComponentException

internalGetLocalizedExtendedRole

protected String internalGetLocalizedExtendedRole()

getAccessibleExtendedStateCount

public int getAccessibleExtendedStateCount()
                                    throws InvalidComponentException
Throws:
InvalidComponentException

internalGetExtendedStateCount

protected int internalGetExtendedStateCount()

getAccessibleExtendedStates

public Set getAccessibleExtendedStates()
                                throws InvalidComponentException
Throws:
InvalidComponentException

internalGetExtendedStates

protected String[] internalGetExtendedStates(int maxExtendedStates)

getAccessibleLocalizedExtendedStates

public Set getAccessibleLocalizedExtendedStates()
                                         throws InvalidComponentException
Throws:
InvalidComponentException

internalGetLocalizedExtendedStates

protected String[] internalGetLocalizedExtendedStates(int maxLocalizedExtendedStates)

getUniqueID

public int getUniqueID()
                throws InvalidComponentException
Throws:
InvalidComponentException

internalGetUniqueID

protected int internalGetUniqueID()

getAccessibleWindowHandle

public int getAccessibleWindowHandle()
                              throws InvalidComponentException
Throws:
InvalidComponentException

getAccessibleIndexInParent

public int getAccessibleIndexInParent()
                               throws InvalidComponentException
Description copied from class: MsaaAccessible
retreave the index of this accessible within its parent accessible

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

internalGetIndexInParent

protected int internalGetIndexInParent()

getAccessibleLocale

public Locale getAccessibleLocale()
                           throws InvalidComponentException
Throws:
InvalidComponentException

internalGetLocale

protected String[] internalGetLocale()

getAccessibleAttributes

public String getAccessibleAttributes()
                               throws InvalidComponentException
Throws:
InvalidComponentException

internalGetAttributes

protected String internalGetAttributes()

equals

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

doDefaultAction

public boolean doDefaultAction()
                        throws InvalidComponentException
Overrides:
doDefaultAction in class MsaaAccessible
Throws:
InvalidComponentException

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class MsaaAccessible
Throws:
Throwable

propertyMap

public static Map propertyMap()