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:
BlackBerry API 4.6.1

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 number of characters in this field.
 int getInputFilterStyle()
          Retrieves input filter style such as TextFilter.PHONE.
 int getLineCount()
          Returns the 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

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

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.1

WORD

static final int WORD
Constant used to indicate that the part of the text that should be retrieved is a word.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.1

LINE

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

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.1


Method Detail

getWholeText

String getWholeText()
Returns the whole text as one string

Since:
BlackBerry API 4.6.1

getAtIndex

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:
BlackBerry API 4.6.1

getCaretPosition

int getCaretPosition()
Returns the zero-based offset of the caret.

Returns:
current caret position in text field
Since:
BlackBerry API 4.6.1

getCharCount

int getCharCount()
Returns the number of characters in this field.

Returns:
number of characters in text field
Since:
BlackBerry API 4.6.1

getSelectionText

String getSelectionText()
Returns the portion of the text that is selected.

Returns:
string representing portion of text currently selected
Since:
BlackBerry API 4.6.1

getSelectionStart

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:
BlackBerry API 4.6.1

getSelectionEnd

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:
BlackBerry API 4.6.1

getLineCount

int getLineCount()
Returns the number of lines in this field.

Returns:
Number of lines of text this field contains.
Since:
BlackBerry API 4.6.1

getInputFilterStyle

int getInputFilterStyle()
Retrieves input filter style such as TextFilter.PHONE. Refer to the TextFilter style constants for possible values.

Returns:
input filter style if field accepts input
Since:
BlackBerry API 5.0.0





Copyright 1999-2010 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. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.