GNU Classpath (0.91) | |
Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
javax.accessibility.AccessibleContext
java.awt.Component.AccessibleAWTComponent
java.awt.Container.AccessibleAWTContainer
javax.swing.JComponent.AccessibleJComponent
javax.swing.text.JTextComponent.AccessibleJTextComponent
public class JTextComponent.AccessibleJTextComponent
extends JComponent.AccessibleJComponent
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.Container.AccessibleAWTContainer | |
Container.AccessibleAWTContainer.AccessibleContainerHandler |
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.Container.AccessibleAWTContainer | |
accessibleContainerHandler |
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 | |
|
Method Summary | |
void |
|
void |
|
void |
|
void |
|
boolean |
|
int |
|
String |
|
AccessibleEditableText |
|
AccessibleRole |
|
AccessibleStateSet |
|
AccessibleText |
|
String |
|
String |
|
String |
|
int |
|
int |
|
AttributeSet |
|
Rectangle |
|
int |
|
String |
|
int |
|
int |
|
String |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
Methods inherited from class java.awt.Container.AccessibleAWTContainer | |
getAccessibleAt , getAccessibleChild , getAccessibleChildrenCount |
Methods inherited from class java.lang.Object | |
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
public AccessibleJTextComponent()
Constructs an AccessibleJTextComponent. Adds a listener to track caret change.
public void caretUpdate(CaretEvent e)
Handles caret updates (fire appropriate property change event, which are AccessibleContext.ACCESSIBLE_CARET_PROPERTY and AccessibleContext.ACCESSIBLE_SELECTION_PROPERTY). This keeps track of the dot position internally. When the caret moves, the internal position is updated after firing the event.
- Specified by:
- caretUpdate in interface CaretListener
- Parameters:
e
- - caret event
public void changedUpdate(DocumentEvent e)
Changed update. Fire appropriate property change event which is AccessibleContext.ACCESSIBLE_TEXT_PROPERTY.
- Specified by:
- changedUpdate in interface DocumentListener
- Parameters:
e
- - document event
public void cut(int start, int end)
Cut the text between two points to the system clipboard.
- Specified by:
- cut in interface AccessibleEditableText
- Parameters:
start
- the start position, inclusiveend
- the end position, exclusive
public void delete(int start, int end)
Delete the text between two points.
- Specified by:
- delete in interface AccessibleEditableText
- Parameters:
start
- the start position, inclusiveend
- the end position, exclusive
public boolean doAccessibleAction(int i)
Perform the specified action. Does nothing if out of bounds.
- Specified by:
- doAccessibleAction in interface AccessibleAction
- Parameters:
i
- the action to perform, 0-based
- Returns:
- true if the action was performed
public int getAccessibleActionCount()
Get the number possible actions for this object, with the zeroth representing the default action.
- Specified by:
- getAccessibleActionCount in interface AccessibleAction
- Returns:
- the 0-based number of actions
public String getAccessibleActionDescription(int i)
Get a description for the specified action. Returns null if out of bounds.
- Specified by:
- getAccessibleActionDescription in interface AccessibleAction
- Parameters:
i
- the action to describe, 0-based
- Returns:
- description of the action
public AccessibleEditableText getAccessibleEditableText()
Returns the AccessibleEditableText interface for this text component.
- Overrides:
- getAccessibleEditableText in interface AccessibleContext
- Returns:
- this
public AccessibleRole getAccessibleRole()
Returns the accessible role of this component.
- Overrides:
- getAccessibleRole in interface JComponent.AccessibleJComponent
- Returns:
- the accessible role of this component
- See Also:
AccessibleRole
public AccessibleStateSet getAccessibleStateSet()
Returns the accessible state set of this component.
- Overrides:
- getAccessibleStateSet in interface JComponent.AccessibleJComponent
- Returns:
- the accessible state set of this component
public AccessibleText getAccessibleText()
Get the AccessibleText associated with this object. In the implementation of the Java Accessibility API for this class, return this object, which is responsible for implementing the AccessibleText interface on behalf of itself.
- Overrides:
- getAccessibleText in interface AccessibleContext
- Returns:
- this
- See Also:
AccessibleText
public String getAfterIndex(int part, int index)
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
, orAccessibleText.SENTENCE
index
- the 0-based character index
- Returns:
- the selection of text after that index, or null
public String getAtIndex(int part, int index)
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
, orAccessibleText.SENTENCE
index
- the 0-based character index
- Returns:
- the selection of text at that index, or null
public String getBeforeIndex(int part, int index)
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
, orAccessibleText.SENTENCE
index
- the 0-based character index
- Returns:
- the selection of text before that index, or null
public int getCaretPosition()
Returns the zero-based offset of the caret. Note: The character to the right of the caret will have the same index value as the offset (the caret is between two characters).
- Specified by:
- getCaretPosition in interface AccessibleText
- Returns:
- offset of caret
public int getCharCount()
Return the number of characters.
- Specified by:
- getCharCount in interface AccessibleText
- Returns:
- the character count
public AttributeSet getCharacterAttribute(int index)
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
public Rectangle getCharacterBounds(int index)
Determines the bounding box of the indexed character. Returns an empty rectangle if the index is out of bounds. The bounds are returned in local coordinates. If the index is invalid a null rectangle is returned. The screen coordinates returned are "unscrolled coordinates" if the JTextComponent is contained in a JScrollPane in which case the resulting rectangle should be composed with the parent coordinates. 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.
- Specified by:
- getCharacterBounds in interface AccessibleText
- Parameters:
index
- the 0-based character index
- Returns:
- the bounding box, may be empty or null.
public int getIndexAtPoint(Point p)
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:
p
- the point to look at
- Returns:
- the character index, or -1
public String getSelectedText()
Returns the portion of the text that is selected.
- Specified by:
- getSelectedText in interface AccessibleText
- Returns:
- null if no text is selected.
public int getSelectionEnd()
Returns the end offset within the selected text. If there is no selection, but there is a caret, the start and end offsets will be the same. Return 0 if the text is empty, or the caret position if no selection.
- Specified by:
- getSelectionEnd in interface AccessibleText
- Returns:
- index of the end of the text >= 0.
public int getSelectionStart()
Returns the start offset within the selected text. If there is no selection, but there is a caret, the start and end offsets will be the same. Return 0 if the text is empty, or the caret position if no selection.
- Specified by:
- getSelectionStart in interface AccessibleText
- Returns:
- index of the start of the text >= 0.
public String getTextRange(int start, int end)
Return the text between two points.
- Specified by:
- getTextRange in interface AccessibleEditableText
- Parameters:
start
- the start position, inclusiveend
- the end position, exclusive
public void insertTextAtIndex(int index, String s)
Inserts the given string at the specified location.
- Specified by:
- insertTextAtIndex in interface AccessibleEditableText
- Parameters:
index
- the index for insertions
- the new text
public void insertUpdate(DocumentEvent e)
Insert update. Fire appropriate property change event which is AccessibleContext.ACCESSIBLE_TEXT_PROPERTY.
- Specified by:
- insertUpdate in interface DocumentListener
- Parameters:
e
- - document event
public void paste(int start)
Paste the text from the system clipboard at the given index.
- Specified by:
- paste in interface AccessibleEditableText
- Parameters:
start
- the start position
public void removeUpdate(DocumentEvent e)
Remove update. Fire appropriate property change event which is AccessibleContext.ACCESSIBLE_TEXT_PROPERTY.
- Specified by:
- removeUpdate in interface DocumentListener
- Parameters:
e
- - document event
public void replaceText(int start, int end, String s)
Replace the text between two points with the given string.
- Specified by:
- replaceText in interface AccessibleEditableText
- Parameters:
start
- the start position, inclusiveend
- the end position, exclusives
- the string to paste
public void selectText(int start, int end)
Select the text between two points.
- Specified by:
- selectText in interface AccessibleEditableText
- Parameters:
start
- the start position, inclusiveend
- the end position, exclusive
public void setAttributes(int start, int end, AttributeSet s)
Set the attributes of text between two points.
- Specified by:
- setAttributes in interface AccessibleEditableText
- Parameters:
start
- the start position, inclusiveend
- the end position, exclusives
- the new attribute set for the range
public void setTextContents(String s)
Set the text contents to the given string.
- Specified by:
- setTextContents in interface AccessibleEditableText
- Parameters:
s
- the new text
GNU Classpath (0.91) |