APIdia Launch Partner
Top Description Fields Methods
javax.accessibility

public Interface AccessibleExtendedText

Known Direct Implementers
javax.swing.text.JTextComponent.AccessibleJTextComponent
Imports
java.awt.Rectangle

The AccessibleExtendedText interface contains additional methods not provided by the AccessibleText interface.

Applications can determine if an object supports the AccessibleExtendedText interface by first obtaining its AccessibleContext (see Accessible) and then calling the AccessibleContext#getAccessibleText method of AccessibleContext. If the return value is an instance of AccessibleExtendedText, the object supports this interface.

Authors
Peter Korn, Lynn Monsanto
Since
1.5
See Also
Accessible, Accessible#getAccessibleContext, AccessibleContext, AccessibleContext#getAccessibleText

Field Summary

Modifier and TypeField and Description
public static final int
ATTRIBUTE_RUN

Constant used to indicate that the part of the text that should be retrieved is contiguous text with the same text attributes.

public static final int
LINE

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

Method Summary

Modifier and TypeMethod and Description
public Rectangle

Returns:

the bounding rectangle of the text if the indices are valid. Otherwise, null is returned.
getTextBounds
(int
the start index in the text
startIndex
,
int
the end index in the text
endIndex
)

Returns the bounding rectangle of the text between two indices.

public String

Returns:

the text string if the indices are valid. Otherwise, null is returned.
getTextRange
(int
the start index in the text
startIndex
,
int
the end index in the text
endIndex
)

Returns the text between two indices.

public AccessibleTextSequence

Returns:

an AccessibleTextSequence specifying the text if part and index are valid. Otherwise, null is returned.
getTextSequenceAfter
(int
the CHARACTER, WORD, SENTENCE, LINE or ATTRIBUTE_RUN to retrieve
part
,
int
an index within the text
index
)

Returns the AccessibleTextSequence after a given index.

public AccessibleTextSequence

Returns:

an AccessibleTextSequence specifying the text if part and index are valid. Otherwise, null is returned.
getTextSequenceAt
(int
the CHARACTER, WORD, SENTENCE, LINE or ATTRIBUTE_RUN to retrieve
part
,
int
an index within the text
index
)

Returns the AccessibleTextSequence at a given index.

public AccessibleTextSequence

Returns:

an AccessibleTextSequence specifying the text if part and index are valid. Otherwise, null is returned.
getTextSequenceBefore
(int
the CHARACTER, WORD, SENTENCE, LINE or ATTRIBUTE_RUN to retrieve
part
,
int
an index within the text
index
)

Returns the AccessibleTextSequence before a given index.

Field Detail

ATTRIBUTE_RUNback to summary
public static final int ATTRIBUTE_RUN

Constant used to indicate that the part of the text that should be retrieved is contiguous text with the same text attributes.

See Also
AccessibleText#getAtIndex, AccessibleText#getAfterIndex, AccessibleText#getBeforeIndex
LINEback to summary
public static final int LINE

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

See Also
AccessibleText#getAtIndex, AccessibleText#getAfterIndex, AccessibleText#getBeforeIndex

Method Detail

getTextBoundsback to summary
public Rectangle getTextBounds(int startIndex, int endIndex)

Returns the bounding rectangle of the text between two indices.

Parameters
startIndex:int

the start index in the text

endIndex:int

the end index in the text

Returns:Rectangle

the bounding rectangle of the text if the indices are valid. Otherwise, null is returned.

getTextRangeback to summary
public String getTextRange(int startIndex, int endIndex)

Returns the text between two indices.

Parameters
startIndex:int

the start index in the text

endIndex:int

the end index in the text

Returns:String

the text string if the indices are valid. Otherwise, null is returned.

getTextSequenceAfterback to summary
public AccessibleTextSequence getTextSequenceAfter(int part, int index)

Returns the AccessibleTextSequence after a given index.

Parameters
part:int

the CHARACTER, WORD, SENTENCE, LINE or ATTRIBUTE_RUN to retrieve

index:int

an index within the text

Returns:AccessibleTextSequence

an AccessibleTextSequence specifying the text if part and index are valid. Otherwise, null is returned.

See Also
AccessibleText#CHARACTER, AccessibleText#WORD, AccessibleText#SENTENCE
getTextSequenceAtback to summary
public AccessibleTextSequence getTextSequenceAt(int part, int index)

Returns the AccessibleTextSequence at a given index.

Parameters
part:int

the CHARACTER, WORD, SENTENCE, LINE or ATTRIBUTE_RUN to retrieve

index:int

an index within the text

Returns:AccessibleTextSequence

an AccessibleTextSequence specifying the text if part and index are valid. Otherwise, null is returned.

See Also
AccessibleText#CHARACTER, AccessibleText#WORD, AccessibleText#SENTENCE
getTextSequenceBeforeback to summary
public AccessibleTextSequence getTextSequenceBefore(int part, int index)

Returns the AccessibleTextSequence before a given index.

Parameters
part:int

the CHARACTER, WORD, SENTENCE, LINE or ATTRIBUTE_RUN to retrieve

index:int

an index within the text

Returns:AccessibleTextSequence

an AccessibleTextSequence specifying the text if part and index are valid. Otherwise, null is returned.

See Also
AccessibleText#CHARACTER, AccessibleText#WORD, AccessibleText#SENTENCE