java.awt
Class TextComponent.AccessibleAWTTextComponent

java.lang.Object
  extended by javax.accessibility.AccessibleContext
      extended by java.awt.Component.AccessibleAWTComponent
          extended by java.awt.TextComponent.AccessibleAWTTextComponent
All Implemented Interfaces:
TextListener, Serializable, EventListener, AccessibleComponent, AccessibleText
Direct Known Subclasses:
TextArea.AccessibleAWTTextArea, TextField.AccessibleAWTTextField
Enclosing class:
TextComponent

protected class TextComponent.AccessibleAWTTextComponent
extends Component.AccessibleAWTComponent
implements AccessibleText, TextListener

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Component.AccessibleAWTComponent
Component.AccessibleAWTComponent.AccessibleAWTComponentHandler, Component.AccessibleAWTComponent.AccessibleAWTFocusHandler
 
Field Summary
 
Fields inherited from class java.awt.Component.AccessibleAWTComponent
accessibleAWTComponentHandler, accessibleAWTFocusHandler
 
Fields inherited from class javax.accessibility.AccessibleContext
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
 
Fields inherited from interface javax.accessibility.AccessibleText
CHARACTER, SENTENCE, WORD
 
Constructor Summary
TextComponent.AccessibleAWTTextComponent()
           
 
Method Summary
 AccessibleRole getAccessibleRole()
          Returns the role of this component.
 AccessibleStateSet getAccessibleStateSet()
          Returns a state set describing this component's state.
 AccessibleText getAccessibleText()
          Get any supported accessible text.
 String getAfterIndex(int part, int index)
          Returns the section of text after the index, or null if the index or part is invalid.
 String getAtIndex(int part, int index)
          Returns the section of text at the index, or null if the index or part is invalid.
 String getBeforeIndex(int part, int index)
          Returns the section of text before the index, or null if the index or part is invalid.
 int getCaretPosition()
          Return the offset of the character.
 AttributeSet getCharacterAttribute(int index)
          Returns the attributes of a character at an index, or null if the index is out of bounds.
 Rectangle getCharacterBounds(int index)
          Determines the bounding box of the indexed character.
 int getCharCount()
          Return the number of characters.
 int getIndexAtPoint(Point point)
          Given a point in the coordinate system of this object, return the 0-based index of the character at that point, or -1 if there is none.
 String getSelectedText()
          Returns the selected text.
 int getSelectionEnd()
          Returns the end index of the selection.
 int getSelectionStart()
          Returns the start index of the selection.
 void textValueChanged(TextEvent event)
          This method is called when the text being monitored changes.
 
Methods inherited from class java.awt.Component.AccessibleAWTComponent
addFocusListener, addPropertyChangeListener, contains, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAccessibleComponent, getAccessibleDescription, getAccessibleIndexInParent, getAccessibleName, getAccessibleParent, getBackground, getBounds, getCursor, getFont, getFontMetrics, getForeground, getLocale, getLocation, getLocationOnScreen, getSize, isEnabled, isFocusTraversable, isShowing, isVisible, removeFocusListener, removePropertyChangeListener, requestFocus, setBackground, setBounds, setCursor, setEnabled, setFont, setForeground, setLocation, setSize, setVisible
 
Methods inherited from class javax.accessibility.AccessibleContext
firePropertyChange, getAccessibleAction, getAccessibleEditableText, 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
 

Constructor Detail

TextComponent.AccessibleAWTTextComponent

public TextComponent.AccessibleAWTTextComponent()
Method Detail

getAccessibleRole

public AccessibleRole getAccessibleRole()
Description copied from class: Component.AccessibleAWTComponent
Returns the role of this component.

Overrides:
getAccessibleRole in class Component.AccessibleAWTComponent
Returns:
the accessible role
See Also:
AccessibleRole

getAccessibleStateSet

public AccessibleStateSet getAccessibleStateSet()
Description copied from class: Component.AccessibleAWTComponent
Returns a state set describing this component's state.

Overrides:
getAccessibleStateSet in class Component.AccessibleAWTComponent
Returns:
a new state set
See Also:
AccessibleState

getAccessibleText

public AccessibleText getAccessibleText()
Description copied from class: AccessibleContext
Get any supported accessible text. The default implementation returns null.

Overrides:
getAccessibleText in class AccessibleContext
Returns:
the supported text, or null
See Also:
AccessibleText

getIndexAtPoint

public int getIndexAtPoint(Point point)
Description copied from interface: AccessibleText
Given a point in the coordinate system of this object, return the 0-based index of the character at that point, or -1 if there is none.

Specified by:
getIndexAtPoint in interface AccessibleText
Parameters:
point - the point to look at
Returns:
the character index, or -1

getCharacterBounds

public Rectangle getCharacterBounds(int index)
Description copied from interface: AccessibleText
Determines the bounding box of the indexed character. Returns an empty rectangle if the index is out of bounds.

Specified by:
getCharacterBounds in interface AccessibleText
Parameters:
index - the 0-based character index
Returns:
the bounding box, may be empty

getCharCount

public int getCharCount()
Description copied from interface: AccessibleText
Return the number of characters.

Specified by:
getCharCount in interface AccessibleText
Returns:
the character count

getCaretPosition

public int getCaretPosition()
Description copied from interface: AccessibleText
Return the offset of the character. The offset matches the index of the character to the right, since the carat lies between characters.

Specified by:
getCaretPosition in interface AccessibleText
Returns:
the 0-based caret position

getAtIndex

public String getAtIndex(int part,
                         int index)
Description copied from interface: AccessibleText
Returns the section of text at the index, or null if the index or part is invalid.

Specified by:
getAtIndex in interface AccessibleText
Parameters:
part - AccessibleText.CHARACTER, AccessibleText.WORD, or AccessibleText.SENTENCE
index - the 0-based character index
Returns:
the selection of text at that index, or null

getAfterIndex

public String getAfterIndex(int part,
                            int index)
Description copied from interface: AccessibleText
Returns the section of text after the index, or null if the index or part is invalid.

Specified by:
getAfterIndex in interface AccessibleText
Parameters:
part - AccessibleText.CHARACTER, AccessibleText.WORD, or AccessibleText.SENTENCE
index - the 0-based character index
Returns:
the selection of text after that index, or null

getBeforeIndex

public String getBeforeIndex(int part,
                             int index)
Description copied from interface: AccessibleText
Returns the section of text before the index, or null if the index or part is invalid.

Specified by:
getBeforeIndex in interface AccessibleText
Parameters:
part - AccessibleText.CHARACTER, AccessibleText.WORD, or AccessibleText.SENTENCE
index - the 0-based character index
Returns:
the selection of text before that index, or null

getCharacterAttribute

public AttributeSet getCharacterAttribute(int index)
Description copied from interface: AccessibleText
Returns the attributes of a character at an index, or null if the index is out of bounds.

Specified by:
getCharacterAttribute in interface AccessibleText
Parameters:
index - the 0-based character index
Returns:
the character's attributes

getSelectionStart

public int getSelectionStart()
Description copied from interface: AccessibleText
Returns the start index of the selection. If there is no selection, this is the same as the caret location.

Specified by:
getSelectionStart in interface AccessibleText
Returns:
the 0-based character index of the selection start

getSelectionEnd

public int getSelectionEnd()
Description copied from interface: AccessibleText
Returns the end index of the selection. If there is no selection, this is the same as the caret location.

Specified by:
getSelectionEnd in interface AccessibleText
Returns:
the 0-based character index of the selection end

getSelectedText

public String getSelectedText()
Description copied from interface: AccessibleText
Returns the selected text. This may be null or "" if no text is selected.

Specified by:
getSelectedText in interface AccessibleText
Returns:
the selected text

textValueChanged

public void textValueChanged(TextEvent event)
Description copied from interface: TextListener
This method is called when the text being monitored changes.

Specified by:
textValueChanged in interface TextListener
Parameters:
event - the TextEvent indicating the change