org.eclipse.actf.accservice.javapp
Class JavaAccessibleText

java.lang.Object
  extended by org.eclipse.actf.accservice.javapp.JavaAccessibleText
All Implemented Interfaces:
IAccessibleTextElement

public class JavaAccessibleText
extends Object
implements IAccessibleTextElement

implementation of the IAccessibleTextElement object for the Java Accesibility API's AccessibleText.

Author:
Mike Smith
See Also:
AccessibleText

Constructor Summary
JavaAccessibleText(AccessibleText text)
          Constructor used to create an accessible text object.
 
Method Summary
 Object getAttributes(long offset)
          get the attributes at the specified offset of the text
 long getCaretOffset()
          get the offset of the caret for the accessible text object
 String getSelectedText(long index)
          get the text of the selected object
 long getSelectedTextEnd(long index)
          get the ending index of the selected text
 long getSelectedTextStart(long index)
          get the starting index of the selected text
 long getSelectionCount()
          get number of active non-contiguous selections
 String getText()
          get the text for the accessible text object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaAccessibleText

public JavaAccessibleText(AccessibleText text)
Constructor used to create an accessible text object. This constructor will usually be invoked from JavaAccessible and is not typically called by clients.

Parameters:
text - - AccessibleText object
Method Detail

getText

public String getText()
               throws InvalidComponentException
get the text for the accessible text object

Specified by:
getText in interface IAccessibleTextElement
Returns:
text or an empty string if no text is provided
Throws:
InvalidComponentException

getCaretOffset

public long getCaretOffset()
                    throws InvalidComponentException
get the offset of the caret for the accessible text object

Specified by:
getCaretOffset in interface IAccessibleTextElement
Returns:
caret offset
Throws:
InvalidComponentException

getAttributes

public Object getAttributes(long offset)
                     throws InvalidComponentException
get the attributes at the specified offset of the text

Specified by:
getAttributes in interface IAccessibleTextElement
Parameters:
offset - zero index of caret offset
Returns:
attributes or an empty string if no description is provided
Throws:
InvalidComponentException

getSelectionCount

public long getSelectionCount()
                       throws InvalidComponentException
get number of active non-contiguous selections

Specified by:
getSelectionCount in interface IAccessibleTextElement
Returns:
the number of selections
Throws:
InvalidComponentException

getSelectedText

public String getSelectedText(long index)
                       throws InvalidComponentException
get the text of the selected object

Specified by:
getSelectedText in interface IAccessibleTextElement
Parameters:
index - zero index of selected text objects
Returns:
the number of selections or empty string if index is out of range
Throws:
InvalidComponentException

getSelectedTextStart

public long getSelectedTextStart(long index)
                          throws InvalidComponentException
get the starting index of the selected text

Specified by:
getSelectedTextStart in interface IAccessibleTextElement
Parameters:
index - zero index of selected text objects
Returns:
the starting index of the selection
Throws:
InvalidComponentException

getSelectedTextEnd

public long getSelectedTextEnd(long index)
                        throws InvalidComponentException
get the ending index of the selected text

Specified by:
getSelectedTextEnd in interface IAccessibleTextElement
Parameters:
index - zero index of selected text objects
Returns:
the ending index of the selection
Throws:
InvalidComponentException