|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.accessibility.AccessibleContext
java.awt.Component.AccessibleAWTComponent
java.awt.Container.AccessibleAWTContainer
javax.swing.JComponent.AccessibleJComponent
javax.swing.text.JTextComponent.AccessibleJTextComponent
public class JTextComponent.AccessibleJTextComponent
AccessibleJTextComponent implements accessibility hooks for JTextComponent. It allows an accessibility driver to read and manipulate the text component's contents as well as update UI elements such as the caret.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent.AccessibleJComponent |
---|
JComponent.AccessibleJComponent.AccessibleContainerHandler, JComponent.AccessibleJComponent.AccessibleFocusHandler |
Nested classes/interfaces inherited from class java.awt.Component.AccessibleAWTComponent |
---|
Component.AccessibleAWTComponent.AccessibleAWTComponentHandler, Component.AccessibleAWTComponent.AccessibleAWTFocusHandler |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent.AccessibleJComponent |
---|
accessibleContainerHandler, accessibleFocusHandler |
Fields inherited from class java.awt.Component.AccessibleAWTComponent |
---|
accessibleAWTComponentHandler, accessibleAWTFocusHandler |
Fields inherited from interface javax.accessibility.AccessibleAction |
---|
DECREMENT, INCREMENT, TOGGLE_EXPAND |
Fields inherited from interface javax.accessibility.AccessibleText |
---|
CHARACTER, SENTENCE, WORD |
Constructor Summary | |
---|---|
JTextComponent.AccessibleJTextComponent()
Construct an AccessibleJTextComponent. |
Method Summary | |
---|---|
void |
caretUpdate(CaretEvent e)
Handle a change in the caret position and fire any applicable property change events. |
void |
changedUpdate(DocumentEvent e)
Handle a text change event and fire an AccessibleContext.ACCESSIBLE_TEXT_PROPERTY property change event. |
void |
cut(int start,
int end)
Cuts the text between two indexes. |
void |
delete(int start,
int end)
Deletes the text between two indexes. |
boolean |
doAccessibleAction(int i)
Performs the i-th action. |
int |
getAccessibleActionCount()
Returns the number of actions for this object. |
String |
getAccessibleActionDescription(int i)
Returns the description of the i-th action. |
AccessibleEditableText |
getAccessibleEditableText()
Retrieve an AccessibleEditableText object that controls this text component. |
AccessibleRole |
getAccessibleRole()
Retrieve the accessible role of this component. |
AccessibleStateSet |
getAccessibleStateSet()
Retreive the accessible state set of this component. |
AccessibleText |
getAccessibleText()
Retrieve an AccessibleText object that controls this text component. |
String |
getAfterIndex(int part,
int index)
Gets the text located after index. null is returned if the index or part is invalid. |
String |
getAtIndex(int part,
int index)
Gets the text located at index. null is returned if the index or part is invalid. |
String |
getBeforeIndex(int part,
int index)
Gets the text located before index. null is returned if the index or part is invalid. |
int |
getCaretPosition()
Retrieve the current caret position. |
AttributeSet |
getCharacterAttribute(int index)
Gets the character attributes of the character at index. |
Rectangle |
getCharacterBounds(int index)
Calculate the bounding box of the character at the given index. |
int |
getCharCount()
Return the length of the text in this text component. |
int |
getIndexAtPoint(Point p)
Get the index of the character at the given point, in component pixel co-ordinates. |
String |
getSelectedText()
Retrieve the current text selection. |
int |
getSelectionEnd()
Retrieve the index of the last character in the current text selection. |
int |
getSelectionStart()
Retrieve the index of the first character in the current text selection. |
String |
getTextRange(int start,
int end)
Gets the text between two indexes. |
void |
insertTextAtIndex(int index,
String s)
Inserts the text at the given index. |
void |
insertUpdate(DocumentEvent e)
Handle a text insertion event and fire an AccessibleContext.ACCESSIBLE_TEXT_PROPERTY property change event. |
void |
paste(int start)
Pastes the text from the system clipboard to the given index. |
void |
removeUpdate(DocumentEvent e)
Handle a text removal event and fire an AccessibleContext.ACCESSIBLE_TEXT_PROPERTY property change event. |
void |
replaceText(int start,
int end,
String s)
Replaces the text between two indexes with the given text. |
void |
selectText(int start,
int end)
Selects the text between two indexes. |
void |
setAttributes(int start,
int end,
AttributeSet s)
Sets the attributes of all the text between two indexes. |
void |
setTextContents(String s)
Sets the text contents. |
Methods inherited from class javax.swing.JComponent.AccessibleJComponent |
---|
addPropertyChangeListener, getAccessibleChild, getAccessibleChildrenCount, getAccessibleDescription, getAccessibleKeyBinding, getAccessibleName, getBorderTitle, getTitledBorderText, getToolTipText, removePropertyChangeListener |
Methods inherited from class java.awt.Container.AccessibleAWTContainer |
---|
getAccessibleAt |
Methods inherited from class javax.accessibility.AccessibleContext |
---|
firePropertyChange, getAccessibleAction, getAccessibleIcon, getAccessibleRelationSet, getAccessibleSelection, getAccessibleTable, getAccessibleValue, setAccessibleDescription, setAccessibleName, setAccessibleParent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.accessibility.AccessibleComponent |
---|
addFocusListener, contains, getAccessibleAt, getBackground, getBounds, getCursor, getFont, getFontMetrics, getForeground, getLocation, getLocationOnScreen, getSize, isEnabled, isFocusTraversable, isShowing, isVisible, removeFocusListener, requestFocus, setBackground, setBounds, setCursor, setEnabled, setFont, setForeground, setLocation, setSize, setVisible |
Constructor Detail |
---|
public JTextComponent.AccessibleJTextComponent()
Method Detail |
---|
public int getCaretPosition()
getCaretPosition
in interface AccessibleText
public String getSelectedText()
getSelectedText
in interface AccessibleText
public int getSelectionStart()
getSelectionStart
in interface AccessibleText
public int getSelectionEnd()
getSelectionEnd
in interface AccessibleText
public void caretUpdate(CaretEvent e)
caretUpdate
in interface CaretListener
e
- - the caret update eventpublic AccessibleStateSet getAccessibleStateSet()
getAccessibleStateSet
in class JComponent.AccessibleJComponent
AccessibleState
public AccessibleRole getAccessibleRole()
getAccessibleRole
in class JComponent.AccessibleJComponent
AccessibleRole
public AccessibleEditableText getAccessibleEditableText()
getAccessibleEditableText
in class AccessibleContext
AccessibleEditableText
public AccessibleText getAccessibleText()
getAccessibleText
in class AccessibleContext
AccessibleText
public void insertUpdate(DocumentEvent e)
insertUpdate
in interface DocumentListener
e
- - the insertion eventpublic void removeUpdate(DocumentEvent e)
removeUpdate
in interface DocumentListener
e
- - the removal eventpublic void changedUpdate(DocumentEvent e)
changedUpdate
in interface DocumentListener
e
- - text change eventpublic int getIndexAtPoint(Point p)
getIndexAtPoint
in interface AccessibleText
p
- - a point in component pixel co-ordinates
public Rectangle getCharacterBounds(int index)
getCharacterBounds
in interface AccessibleText
index
- - the character index
public int getCharCount()
getCharCount
in interface AccessibleText
public AttributeSet getCharacterAttribute(int index)
getCharacterAttribute
in interface AccessibleText
index
- - index of the character
public String getAtIndex(int part, int index)
getAtIndex
in interface AccessibleText
part
- - AccessibleText.CHARACTER
, AccessibleText.WORD
, or AccessibleText.SENTENCE
index
- - index of the part
public String getAfterIndex(int part, int index)
getAfterIndex
in interface AccessibleText
part
- - AccessibleText.CHARACTER
, AccessibleText.WORD
, or AccessibleText.SENTENCE
index
- - index after the part
public String getBeforeIndex(int part, int index)
getBeforeIndex
in interface AccessibleText
part
- - AccessibleText.CHARACTER
, AccessibleText.WORD
, or AccessibleText.SENTENCE
index
- - index before the part
public int getAccessibleActionCount()
getAccessibleActionCount
in interface AccessibleAction
public String getAccessibleActionDescription(int i)
getAccessibleActionDescription
in interface AccessibleAction
i
- - the action to get the description for
public boolean doAccessibleAction(int i)
doAccessibleAction
in interface AccessibleAction
i
- - the action to perform
public void setTextContents(String s)
setTextContents
in interface AccessibleEditableText
s
- - the new text contents.public void insertTextAtIndex(int index, String s)
insertTextAtIndex
in interface AccessibleEditableText
index
- - the index to insert the new text at.s
- - the new textpublic String getTextRange(int start, int end)
getTextRange
in interface AccessibleEditableText
start
- - the starting index (inclusive)end
- - the ending index (exclusive)public void delete(int start, int end)
delete
in interface AccessibleEditableText
start
- - the starting index (inclusive)end
- - the ending index (exclusive)public void cut(int start, int end)
cut
in interface AccessibleEditableText
start
- - the starting index (inclusive)end
- - the ending index (exclusive)public void paste(int start)
paste
in interface AccessibleEditableText
start
- - the starting indexpublic void replaceText(int start, int end, String s)
replaceText
in interface AccessibleEditableText
start
- - the starting index (inclusive)end
- - the ending index (exclusive)s
- - the text to pastepublic void selectText(int start, int end)
selectText
in interface AccessibleEditableText
start
- - the starting index (inclusive)end
- - the ending index (exclusive)public void setAttributes(int start, int end, AttributeSet s)
setAttributes
in interface AccessibleEditableText
start
- - the starting index (inclusive)end
- - the ending index (exclusive)s
- - the new attribute set for the text in the range
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |