|
FlexDoc/Javadoc 2.0 Demo Java Doc |
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 JavaBeans
has been added to the java.beans
package.
Please see XMLEncoder.
Nested Class Summary |
Nested classes/interfaces inherited from class javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component.AccessibleAWTComponent |
Field Summary |
Fields inherited from class javax.swing.JComponent.AccessibleJComponent |
Fields inherited from class java.awt.Container.AccessibleAWTContainer |
Fields inherited from class java.awt.Component.AccessibleAWTComponent |
Fields inherited from interface javax.accessibility.AccessibleText |
Fields inherited from interface javax.accessibility.AccessibleAction |
Fields inherited from interface javax.accessibility.AccessibleExtendedText |
Constructor Summary |
||
Constructs an AccessibleJTextComponent.
|
Method Summary |
||
void |
Handles caret updates (fire appropriate property change event,
which are AccessibleContext.ACCESSIBLE_CARET_PROPERTY and
AccessibleContext.ACCESSIBLE_SELECTION_PROPERTY).
|
|
void |
Handles document remove (fire appropriate property change event,
which is AccessibleContext.ACCESSIBLE_TEXT_PROPERTY).
|
|
void |
cut(int startIndex, int endIndex)
Cuts the text between two indices into the system clipboard.
|
|
void |
delete(int startIndex, int endIndex)
Deletes the text between two indices
|
|
boolean |
doAccessibleAction(int i)
Performs the specified Action on the object
|
|
Gets the AccessibleAction associated with this object that
supports one or more actions.
|
||
int |
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.
|
||
getAfterIndex(int part, int index)
Returns the String after a given index.
|
||
getAtIndex(int part, int index)
Returns the String at a given index.
|
||
getBeforeIndex(int part, int index)
Returns the String before a given index.
|
||
int |
Returns the zero-based offset of the caret.
|
|
getCharacterAttribute(int i)
Returns the AttributeSet for a given character (at a given index).
|
||
getCharacterBounds(int i)
Determines the bounding box of the character at the given
index into the string.
|
||
int |
Returns the number of characters (valid indices)
|
|
int |
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.
|
||
int |
Returns the end offset within the selected text.
|
|
int |
Returns the start offset within the selected text.
|
|
getTextBounds(int startIndex, int endIndex)
Returns the
Rectangle enclosing the text between
two indicies. |
||
getTextRange(int startIndex, int endIndex)
Returns the text string between two indices.
|
||
getTextSequenceAfter(int part, int index)
Returns the
AccessibleTextSequence after a given
index . |
||
getTextSequenceAt(int part, int index)
Returns the
AccessibleTextSequence at a given
index . |
||
getTextSequenceBefore(int part, int index)
Returns the
AccessibleTextSequence before a given
index . |
||
void |
insertTextAtIndex(int index, String s)
Inserts the specified string at the given index
|
|
void |
Handles document insert (fire appropriate property change event
which is AccessibleContext.ACCESSIBLE_TEXT_PROPERTY).
|
|
void |
paste(int startIndex)
Pastes the text from the system clipboard into the text
starting at the specified index.
|
|
void |
Handles document remove (fire appropriate property change event,
which is AccessibleContext.ACCESSIBLE_TEXT_PROPERTY).
|
|
void |
replaceText(int startIndex, int endIndex, String s)
Replaces the text between two indices with the specified
string.
|
|
void |
selectText(int startIndex, int endIndex)
Selects the text between two indices.
|
|
void |
setAttributes(int startIndex, int endIndex, AttributeSet as)
Sets attributes for the text between two indices.
|
|
void |
Sets the text contents to the specified string.
|
Methods inherited from class javax.swing.JComponent.AccessibleJComponent |
Methods inherited from class java.awt.Container.AccessibleAWTContainer |
Methods inherited from class javax.accessibility.AccessibleContext |
Methods inherited from class java.lang.Object |
public AccessibleJTextComponent |
() |
public void caretUpdate |
(CaretEvent e) |
public void insertUpdate |
(DocumentEvent e) |
public void removeUpdate |
(DocumentEvent e) |
public void changedUpdate |
(DocumentEvent e) |
public AccessibleStateSet getAccessibleStateSet |
() |
public AccessibleRole getAccessibleRole |
() |
public AccessibleText getAccessibleText |
() |
public int getIndexAtPoint |
(Point p) |
public Rectangle getCharacterBounds |
(int i) |
Accessible a: AccessibleText at = a.getAccessibleText(); AccessibleComponent ac = a.getAccessibleComponent(); Rectangle r = at.getCharacterBounds(); Point p = ac.getLocation(); r.x += p.x; r.y += p.y;Note: the JTextComponent must have a valid size (e.g. have been added to a parent container whose ancestor container is a valid top-level window) for this method to be able to return a meaningful (non-null) value.
public int getCharCount |
() |
public int getCaretPosition |
() |
public AttributeSet getCharacterAttribute |
(int i) |
public int getSelectionStart |
() |
public int getSelectionEnd |
() |
public String getSelectedText |
() |
public String getAtIndex |
(int part, int index) |
public String getAfterIndex |
(int part, int index) |
public String getBeforeIndex |
(int part, int index) |
public AccessibleEditableText getAccessibleEditableText |
() |
public void setTextContents |
(String s) |
public void insertTextAtIndex |
(int index, String s) |
public String getTextRange |
(int startIndex, int endIndex) |
public void delete |
(int startIndex, int endIndex) |
public void cut |
(int startIndex, int endIndex) |
public void paste |
(int startIndex) |
public void replaceText |
public void selectText |
(int startIndex, int endIndex) |
public void setAttributes |
public AccessibleTextSequence getTextSequenceAt |
(int part, int index) |
AccessibleTextSequence
at a given
index
.
CHARACTER
, WORD
,
SENTENCE
, LINE
or
ATTRIBUTE_RUN
to retrieve
AccessibleTextSequence
specifying the text if
part
and index
are valid. Otherwise,
null
is returnedpublic AccessibleTextSequence getTextSequenceAfter |
(int part, int index) |
AccessibleTextSequence
after a given
index
.
CHARACTER
, WORD
,
SENTENCE
, LINE
or
ATTRIBUTE_RUN
to retrieve
AccessibleTextSequence
specifying the text
if part
and index
are valid. Otherwise,
null
is returnedpublic AccessibleTextSequence getTextSequenceBefore |
(int part, int index) |
AccessibleTextSequence
before a given
index
.
CHARACTER
, WORD
,
SENTENCE
, LINE
or
ATTRIBUTE_RUN
to retrieve
AccessibleTextSequence
specifying the text
if part
and index
are valid. Otherwise,
null
is returnedpublic Rectangle getTextBounds |
(int startIndex, int endIndex) |
Rectangle
enclosing the text between
two indicies.
null
is returnedpublic AccessibleAction getAccessibleAction |
() |
public int getAccessibleActionCount |
() |
public String getAccessibleActionDescription |
(int i) |
public boolean doAccessibleAction |
(int i) |
|
FlexDoc/Javadoc 2.0 Demo Java Doc |