java.lang.Object | |||||
↳ | javax.accessibility.AccessibleContext | ||||
↳ | java.awt.Component.AccessibleAWTComponent | ||||
↳ | java.awt.Container.AccessibleAWTContainer | ||||
↳ | javax.swing.JComponent.AccessibleJComponent | ||||
↳ | javax.swing.text.JTextComponent.AccessibleJTextComponent |
![]() |
![]() |
This class implements accessibility support for the
JTextComponent
class. It provides an implementation of
the Java Accessibility API appropriate to menu user-interface elements.
Warning:
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeansTM
has been added to the java.beans
package.
Please see XMLEncoder
.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an AccessibleJTextComponent.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Handles caret updates (fire appropriate property change event,
which are AccessibleContext.ACCESSIBLE_CARET_PROPERTY and
AccessibleContext.ACCESSIBLE_SELECTION_PROPERTY).
| |||||||||||
Handles document remove (fire appropriate property change event,
which is AccessibleContext.ACCESSIBLE_TEXT_PROPERTY).
| |||||||||||
Cuts the text between two indices into the system clipboard.
| |||||||||||
Deletes the text between two indices
| |||||||||||
Performs the specified Action on the object
| |||||||||||
Gets the AccessibleAction associated with this object that supports
one or more actions.
| |||||||||||
Returns the number of accessible actions available in this object
If there are more than one, the first one is considered the
"default" action of the object.
| |||||||||||
Returns a description of the specified action of the object.
| |||||||||||
Returns the AccessibleEditableText interface for
this text component.
| |||||||||||
Gets the role of this object.
| |||||||||||
Gets the state set of the JTextComponent.
| |||||||||||
Get the AccessibleText associated with this object.
| |||||||||||
Returns the String after a given index.
| |||||||||||
Returns the String at a given index.
| |||||||||||
Returns the String before a given index.
| |||||||||||
Returns the zero-based offset of the caret.
| |||||||||||
Returns the number of characters (valid indices)
| |||||||||||
Returns the AttributeSet for a given character (at a given index).
| |||||||||||
Determines the bounding box of the character at the given
index into the string.
| |||||||||||
Given a point in local coordinates, return the zero-based index
of the character under that Point.
| |||||||||||
Returns the portion of the text that is selected.
| |||||||||||
Returns the end offset within the selected text.
| |||||||||||
Returns the start offset within the selected text.
| |||||||||||
Returns the
Rectangle enclosing the text between
two indicies. | |||||||||||
Returns the text string between two indices.
| |||||||||||
Returns the
AccessibleTextSequence after a given
index . | |||||||||||
Returns the
AccessibleTextSequence at a given
index . | |||||||||||
Returns the
AccessibleTextSequence before a given
index . | |||||||||||
Inserts the specified string at the given index
| |||||||||||
Handles document insert (fire appropriate property change event
which is AccessibleContext.ACCESSIBLE_TEXT_PROPERTY).
| |||||||||||
Pastes the text from the system clipboard into the text
starting at the specified index.
| |||||||||||
Handles document remove (fire appropriate property change event,
which is AccessibleContext.ACCESSIBLE_TEXT_PROPERTY).
| |||||||||||
Replaces the text between two indices with the specified
string.
| |||||||||||
Selects the text between two indices.
| |||||||||||
Sets attributes for the text between two indices.
| |||||||||||
Sets the text contents to the specified string.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Constructs an AccessibleJTextComponent. Adds a listener to track caret change.
Handles caret updates (fire appropriate property change event, which are AccessibleContext.ACCESSIBLE_CARET_PROPERTY and AccessibleContext.ACCESSIBLE_SELECTION_PROPERTY). This keeps track of the dot position internally. When the caret moves, the internal position is updated after firing the event.
e | the CaretEvent |
---|
Handles document remove (fire appropriate property change event, which is AccessibleContext.ACCESSIBLE_TEXT_PROPERTY). This tracks the changed offset via the event.
e | the DocumentEvent |
---|
Cuts the text between two indices into the system clipboard.
startIndex | the starting index in the text |
---|---|
endIndex | the ending index in the text |
Deletes the text between two indices
startIndex | the starting index in the text |
---|---|
endIndex | the ending index in the text |
Performs the specified Action on the object
i | zero-based index of actions |
---|
Gets the AccessibleAction associated with this object that supports one or more actions.
Returns the number of accessible actions available in this object If there are more than one, the first one is considered the "default" action of the object.
Returns a description of the specified action of the object.
i | zero-based index of the actions |
---|
Returns the AccessibleEditableText interface for this text component.
Gets the role of this object.
Gets the state set of the JTextComponent. The AccessibleStateSet of an object is composed of a set of unique AccessibleState's. A change in the AccessibleStateSet of an object will cause a PropertyChangeEvent to be fired for the AccessibleContext.ACCESSIBLE_STATE_PROPERTY property.
Get the AccessibleText associated with this object. In the implementation of the Java Accessibility API for this class, return this object, which is responsible for implementing the AccessibleText interface on behalf of itself.
Returns the String after a given index. Whitespace between words is treated as a word.
part | the CHARACTER, WORD, or SENTENCE to retrieve |
---|---|
index | an index within the text |
Returns the String at a given index. Whitespace between words is treated as a word.
part | the CHARACTER, WORD, or SENTENCE to retrieve |
---|---|
index | an index within the text |
Returns the String before a given index. Whitespace between words is treated a word.
part | the CHARACTER, WORD, or SENTENCE to retrieve |
---|---|
index | an index within the text |
Returns the zero-based offset of the caret. Note: The character to the right of the caret will have the same index value as the offset (the caret is between two characters).
Returns the number of characters (valid indices)
Returns the AttributeSet for a given character (at a given index).
i | the zero-based index into the text |
---|
Determines the bounding box of the character at the given
index into the string. The bounds are returned in local
coordinates. If the index is invalid a null rectangle
is returned.
The screen coordinates returned are "unscrolled coordinates"
if the JTextComponent is contained in a JScrollPane in which
case the resulting rectangle should be composed with the parent
coordinates. A good algorithm to use is:
i | the index into the String >= 0 |
---|
Given a point in local coordinates, return the zero-based index of the character under that Point. If the point is invalid, this method returns -1.
p | the Point in local coordinates |
---|
Returns the portion of the text that is selected.
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. Return 0 if the text is empty, or the caret position if no selection.
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. Return 0 if the text is empty, or the caret position if no selection.
Returns the Rectangle
enclosing the text between
two indicies.
startIndex | the start index in the text |
---|---|
endIndex | the end index in the text |
null
is returnedReturns the text string between two indices.
startIndex | the starting index in the text |
---|---|
endIndex | the ending index in the text |
Returns the AccessibleTextSequence
after a given
index
.
part | the CHARACTER , WORD ,
SENTENCE , LINE or
ATTRIBUTE_RUN to retrieve |
---|---|
index | an index within the text |
AccessibleTextSequence
specifying the text
if part
and index
are valid. Otherwise,
null
is returnedReturns the AccessibleTextSequence
at a given
index
.
part | the CHARACTER , WORD ,
SENTENCE , LINE or
ATTRIBUTE_RUN to retrieve |
---|---|
index | an index within the text |
AccessibleTextSequence
specifying the text if
part
and index
are valid. Otherwise,
null
is returnedReturns the AccessibleTextSequence
before a given
index
.
part | the CHARACTER , WORD ,
SENTENCE , LINE or
ATTRIBUTE_RUN to retrieve |
---|---|
index | an index within the text |
AccessibleTextSequence
specifying the text
if part
and index
are valid. Otherwise,
null
is returnedInserts the specified string at the given index
index | the index in the text where the string will be inserted |
---|---|
s | the string to insert in the text |
Handles document insert (fire appropriate property change event which is AccessibleContext.ACCESSIBLE_TEXT_PROPERTY). This tracks the changed offset via the event.
e | the DocumentEvent |
---|
Pastes the text from the system clipboard into the text starting at the specified index.
startIndex | the starting index in the text |
---|
Handles document remove (fire appropriate property change event, which is AccessibleContext.ACCESSIBLE_TEXT_PROPERTY). This tracks the changed offset via the event.
e | the DocumentEvent |
---|
Replaces the text between two indices with the specified string.
startIndex | the starting index in the text |
---|---|
endIndex | the ending index in the text |
s | the string to replace the text between two indices |
Selects the text between two indices.
startIndex | the starting index in the text |
---|---|
endIndex | the ending index in the text |
Sets attributes for the text between two indices.
startIndex | the starting index in the text |
---|---|
endIndex | the ending index in the text |
as | the attribute set |
Sets the text contents to the specified string.
s | the string to set the text contents |
---|