net.rim.device.api.ui.accessibility
Interface AccessibleText


public interface AccessibleText

The AccessibleText interface should be implemented by all classes that present textual information on the display. This interface provides the standard mechanism for an assistive technology to access that text via its content, attributes, and spatial location. Applications can determine if an object supports the AccessibleText interface by calling the AccessibleContext.getAccessibleText() method of AccessibleContext. If the return value is not null, the object supports this interface.

Since:
JDE 4.7.0

Field Summary
static int CHAR
          Constant used to indicate that the part of the text that should be retrieved is a character.
static int LINE
          Constant used to indicate that the part of the text that should be retrieved is a line.
static int WORD
          Constant used to indicate that the part of the text that should be retrieved is a word.
 
Method Summary
 String getAtIndex(int part, int index)
          Returns the String at a given index.
 int getCaretPosition()
          Returns the zero-based offset of the caret.
 int getCharCount()
          Returns the zero-based offset of the caret.
 int getLineCount()
          Retrieves number of lines in this field.
 int getSelectionEnd()
          Returns the end offset within the selected text.
 int getSelectionStart()
          Returns the start offset within the selected text.
 String getSelectionText()
          Returns the portion of the text that is selected.
 String getWholeText()
          Returns the whole text as one string
 

Field Detail

CHAR

public static final int CHAR
Constant used to indicate that the part of the text that should be retrieved is a character.
Since:
JDE 4.7.0

LINE

public static final int LINE
Constant used to indicate that the part of the text that should be retrieved is a line.
Since:
JDE 4.7.0

WORD

public static final int WORD
Constant used to indicate that the part of the text that should be retrieved is a word.
Since:
JDE 4.7.0
Method Detail

getAtIndex

public String getAtIndex(int part,
                         int index)
Returns the String at a given index.
Parameters:
part - one of CHAR, WORD, LINE
index - - position in text field
Returns:
string representing part of text at the index
Since:
JDE 4.7.0

getCaretPosition

public int getCaretPosition()
Returns the zero-based offset of the caret.
Returns:
current caret position in text field
Since:
JDE 4.7.0

getCharCount

public int getCharCount()
Returns the zero-based offset of the caret.
Returns:
number of characters in text field
Since:
JDE 4.7.0

getLineCount

public int getLineCount()
Retrieves number of lines in this field.
Returns:
Number of lines of text this field contains.
Since:
JDE 4.7.0

getSelectionEnd

public int getSelectionEnd()
Returns the end offset within the selected text. If there is no selection, but there is a caret, the start and end offsets will be the same.
Returns:
end index of selected text
Since:
JDE 4.7.0

getSelectionStart

public int getSelectionStart()
Returns the start offset within the selected text. If there is no selection, but there is a caret, the start and end offsets will be the same.
Returns:
start index of selected text
Since:
JDE 4.7.0

getSelectionText

public String getSelectionText()
Returns the portion of the text that is selected.
Returns:
string representing portion of text currently selected
Since:
JDE 4.7.0

getWholeText

public String getWholeText()
Returns the whole text as one string
Since:
JDE 4.7.0



Copyright 1999-2009 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.