public class JTextComponent.AccessibleJTextComponent extends JComponent.AccessibleJComponent implements AccessibleText, CaretListener, DocumentListener, AccessibleAction, AccessibleEditableText
JComponent.AccessibleJComponent.AccessibleContainerHandler, JComponent.AccessibleJComponent.AccessibleFocusHandlerComponent.AccessibleAWTComponent.AccessibleAWTComponentHandler, Component.AccessibleAWTComponent.AccessibleAWTFocusHandleraccessibleContainerHandler, accessibleFocusHandleraccessibleAWTComponentHandler, accessibleAWTFocusHandlerACCESSIBLE_ACTION_PROPERTY, ACCESSIBLE_ACTIVE_DESCENDANT_PROPERTY, ACCESSIBLE_CARET_PROPERTY, ACCESSIBLE_CHILD_PROPERTY, ACCESSIBLE_COMPONENT_BOUNDS_CHANGED, ACCESSIBLE_DESCRIPTION_PROPERTY, ACCESSIBLE_HYPERTEXT_OFFSET, ACCESSIBLE_INVALIDATE_CHILDREN, ACCESSIBLE_NAME_PROPERTY, ACCESSIBLE_SELECTION_PROPERTY, ACCESSIBLE_STATE_PROPERTY, ACCESSIBLE_TABLE_CAPTION_CHANGED, ACCESSIBLE_TABLE_COLUMN_DESCRIPTION_CHANGED, ACCESSIBLE_TABLE_COLUMN_HEADER_CHANGED, ACCESSIBLE_TABLE_MODEL_CHANGED, ACCESSIBLE_TABLE_ROW_DESCRIPTION_CHANGED, ACCESSIBLE_TABLE_ROW_HEADER_CHANGED, ACCESSIBLE_TABLE_SUMMARY_CHANGED, ACCESSIBLE_TEXT_ATTRIBUTES_CHANGED, ACCESSIBLE_TEXT_PROPERTY, ACCESSIBLE_VALUE_PROPERTY, ACCESSIBLE_VISIBLE_DATA_PROPERTY, accessibleDescription, accessibleName, accessibleParentCLICK, DECREMENT, INCREMENT, TOGGLE_EXPAND, TOGGLE_POPUPCHARACTER, SENTENCE, WORD| Constructor and Description |
|---|
JTextComponent.AccessibleJTextComponent()
Construct an AccessibleJTextComponent.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
addPropertyChangeListener, getAccessibleChild, getAccessibleChildrenCount, getAccessibleDescription, getAccessibleKeyBinding, getAccessibleName, getBorderTitle, getTitledBorderText, getToolTipText, removePropertyChangeListenergetAccessibleAtaddFocusListener, contains, getAccessibleComponent, getAccessibleIndexInParent, getAccessibleParent, getBackground, getBounds, getCursor, getFont, getFontMetrics, getForeground, getLocale, getLocation, getLocationOnScreen, getSize, isEnabled, isFocusTraversable, isShowing, isVisible, removeFocusListener, requestFocus, setBackground, setBounds, setCursor, setEnabled, setFont, setForeground, setLocation, setSize, setVisiblefirePropertyChange, getAccessibleAction, getAccessibleIcon, getAccessibleRelationSet, getAccessibleSelection, getAccessibleTable, getAccessibleValue, setAccessibleDescription, setAccessibleName, setAccessibleParentclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddFocusListener, 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, setVisiblepublic JTextComponent.AccessibleJTextComponent()
public int getCaretPosition()
getCaretPosition in interface AccessibleTextpublic String getSelectedText()
getSelectedText in interface AccessibleTextpublic int getSelectionStart()
getSelectionStart in interface AccessibleTextpublic int getSelectionEnd()
getSelectionEnd in interface AccessibleTextpublic void caretUpdate(CaretEvent e)
caretUpdate in interface CaretListenere - - the caret update eventpublic AccessibleStateSet getAccessibleStateSet()
getAccessibleStateSet in class JComponent.AccessibleJComponentAccessibleStatepublic AccessibleRole getAccessibleRole()
getAccessibleRole in class JComponent.AccessibleJComponentAccessibleRolepublic AccessibleEditableText getAccessibleEditableText()
getAccessibleEditableText in class AccessibleContextAccessibleEditableTextpublic AccessibleText getAccessibleText()
getAccessibleText in class AccessibleContextAccessibleTextpublic void insertUpdate(DocumentEvent e)
insertUpdate in interface DocumentListenere - - the insertion eventpublic void removeUpdate(DocumentEvent e)
removeUpdate in interface DocumentListenere - - the removal eventpublic void changedUpdate(DocumentEvent e)
changedUpdate in interface DocumentListenere - - text change eventpublic int getIndexAtPoint(Point p)
getIndexAtPoint in interface AccessibleTextp - - a point in component pixel co-ordinatespublic Rectangle getCharacterBounds(int index)
getCharacterBounds in interface AccessibleTextindex - - the character indexpublic int getCharCount()
getCharCount in interface AccessibleTextpublic AttributeSet getCharacterAttribute(int index)
getCharacterAttribute in interface AccessibleTextindex - - index of the characterpublic String getAtIndex(int part, int index)
getAtIndex in interface AccessibleTextpart - - AccessibleText.CHARACTER, AccessibleText.WORD, or AccessibleText.SENTENCEindex - - index of the partpublic String getAfterIndex(int part, int index)
getAfterIndex in interface AccessibleTextpart - - AccessibleText.CHARACTER, AccessibleText.WORD, or AccessibleText.SENTENCEindex - - index after the partpublic String getBeforeIndex(int part, int index)
getBeforeIndex in interface AccessibleTextpart - - AccessibleText.CHARACTER, AccessibleText.WORD, or AccessibleText.SENTENCEindex - - index before the partpublic int getAccessibleActionCount()
getAccessibleActionCount in interface AccessibleActionpublic String getAccessibleActionDescription(int i)
getAccessibleActionDescription in interface AccessibleActioni - - the action to get the description forpublic boolean doAccessibleAction(int i)
doAccessibleAction in interface AccessibleActioni - - the action to performpublic void setTextContents(String s)
setTextContents in interface AccessibleEditableTexts - - the new text contents.public void insertTextAtIndex(int index, String s)
insertTextAtIndex in interface AccessibleEditableTextindex - - the index to insert the new text at.s - - the new textpublic String getTextRange(int start, int end)
getTextRange in interface AccessibleEditableTextstart - - the starting index (inclusive)end - - the ending index (exclusive)public void delete(int start, int end)
delete in interface AccessibleEditableTextstart - - the starting index (inclusive)end - - the ending index (exclusive)public void cut(int start, int end)
cut in interface AccessibleEditableTextstart - - the starting index (inclusive)end - - the ending index (exclusive)public void paste(int start)
paste in interface AccessibleEditableTextstart - - the starting indexpublic void replaceText(int start, int end, String s)
replaceText in interface AccessibleEditableTextstart - - the starting index (inclusive)end - - the ending index (exclusive)s - - the text to pastepublic void selectText(int start, int end)
selectText in interface AccessibleEditableTextstart - - the starting index (inclusive)end - - the ending index (exclusive)public void setAttributes(int start, int end, AttributeSet s)
setAttributes in interface AccessibleEditableTextstart - - the starting index (inclusive)end - - the ending index (exclusive)s - - the new attribute set for the text in the range