javax.swing.text
public class JTextComponent.AccessibleJTextComponent extends JComponent.AccessibleJComponent implements AccessibleText, CaretListener, DocumentListener, AccessibleAction, AccessibleEditableText
JComponent.AccessibleJComponent.AccessibleContainerHandler, JComponent.AccessibleJComponent.AccessibleFocusHandler
Component.AccessibleAWTComponent.AccessibleAWTComponentHandler, Component.AccessibleAWTComponent.AccessibleAWTFocusHandler
accessibleContainerHandler, accessibleFocusHandler
accessibleAWTComponentHandler, accessibleAWTFocusHandler
ACCESSIBLE_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, accessibleParent
CLICK, DECREMENT, INCREMENT, TOGGLE_EXPAND, TOGGLE_POPUP
CHARACTER, 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, removePropertyChangeListener
getAccessibleAt
addFocusListener, 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, setVisible
firePropertyChange, getAccessibleAction, getAccessibleIcon, getAccessibleRelationSet, getAccessibleSelection, getAccessibleTable, getAccessibleValue, setAccessibleDescription, setAccessibleName, setAccessibleParent
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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
public JTextComponent.AccessibleJTextComponent()
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-ordinatespublic Rectangle getCharacterBounds(int index)
getCharacterBounds
in interface AccessibleText
index
- - the character indexpublic int getCharCount()
getCharCount
in interface AccessibleText
public AttributeSet getCharacterAttribute(int index)
getCharacterAttribute
in interface AccessibleText
index
- - index of the characterpublic String getAtIndex(int part, int index)
getAtIndex
in interface AccessibleText
part
- - AccessibleText.CHARACTER
, AccessibleText.WORD
, or AccessibleText.SENTENCE
index
- - index of the partpublic String getAfterIndex(int part, int index)
getAfterIndex
in interface AccessibleText
part
- - AccessibleText.CHARACTER
, AccessibleText.WORD
, or AccessibleText.SENTENCE
index
- - index after the partpublic String getBeforeIndex(int part, int index)
getBeforeIndex
in interface AccessibleText
part
- - AccessibleText.CHARACTER
, AccessibleText.WORD
, or AccessibleText.SENTENCE
index
- - index before the partpublic int getAccessibleActionCount()
getAccessibleActionCount
in interface AccessibleAction
public String getAccessibleActionDescription(int i)
getAccessibleActionDescription
in interface AccessibleAction
i
- - the action to get the description forpublic boolean doAccessibleAction(int i)
doAccessibleAction
in interface AccessibleAction
i
- - the action to performpublic 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