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.
caretUpdate
public void caretUpdate(CaretEvent e)
throws gnu.classpath.NotImplementedException
Handle a change in the caret position and fire any applicable
property change events.
- caretUpdate in interface CaretListener
e
- - the caret update event
cut
public void cut(int start,
int end)
Cuts the text between two indexes. The text is put
into the system clipboard.
- cut in interface AccessibleEditableText
start
- - the starting index (inclusive)end
- - the ending index (exclusive)
delete
public void delete(int start,
int end)
Deletes the text between two indexes.
- delete in interface AccessibleEditableText
start
- - the starting index (inclusive)end
- - the ending index (exclusive)
doAccessibleAction
public boolean doAccessibleAction(int i)
throws gnu.classpath.NotImplementedException
Performs the i-th action. Nothing happens if i is
out of bounds.
- doAccessibleAction in interface AccessibleAction
i
- - the action to perform
- true if the action was performed successfully
getAfterIndex
public String getAfterIndex(int part,
int index)
throws gnu.classpath.NotImplementedException
Gets the text located after index. null is returned if the index
or part is invalid.
- getAfterIndex in interface AccessibleText
- the part of text after that index, or null
getAtIndex
public String getAtIndex(int part,
int index)
throws gnu.classpath.NotImplementedException
Gets the text located at index. null is returned if the index
or part is invalid.
- getAtIndex in interface AccessibleText
- the part of text at that index, or null
getBeforeIndex
public String getBeforeIndex(int part,
int index)
throws gnu.classpath.NotImplementedException
Gets the text located before index. null is returned if the index
or part is invalid.
- getBeforeIndex in interface AccessibleText
- the part of text before that index, or null
getCharacterBounds
public Rectangle getCharacterBounds(int index)
throws gnu.classpath.NotImplementedException
Calculate the bounding box of the character at the given index.
The returned x and y co-ordinates are relative to this text
component's top-left corner. If the index is invalid this
method returns null.
- getCharacterBounds in interface AccessibleText
index
- - the character index
- a character's bounding box, or null
getIndexAtPoint
public int getIndexAtPoint(Point p)
throws gnu.classpath.NotImplementedException
Get the index of the character at the given point, in component
pixel co-ordinates. If the point argument is invalid this
method returns -1.
- getIndexAtPoint in interface AccessibleText
p
- - a point in component pixel co-ordinates
getSelectionEnd
public int getSelectionEnd()
Retrieve the index of the last character in the current text
selection. If there is no text in the text component, this
method returns 0. If there is text in the text component, but
there is no selection, this method returns the current caret
position.
- getSelectionEnd in interface AccessibleText
- the index of the last character in the selection, the
current caret position or 0
getSelectionStart
public int getSelectionStart()
Retrieve the index of the first character in the current text
selection. If there is no text in the text component, this
method returns 0. If there is text in the text component, but
there is no selection, this method returns the current caret
position.
- getSelectionStart in interface AccessibleText
- the index of the first character in the selection, the
current caret position or 0
insertUpdate
public void insertUpdate(DocumentEvent e)
throws gnu.classpath.NotImplementedException
Handle a text insertion event and fire an
AccessibleContext.ACCESSIBLE_TEXT_PROPERTY property change
event.
- insertUpdate in interface DocumentListener
e
- - the insertion event
paste
public void paste(int start)
Pastes the text from the system clipboard to the given index.
- paste in interface AccessibleEditableText
start
- - the starting index
replaceText
public void replaceText(int start,
int end,
String s)
Replaces the text between two indexes with the given text.
- replaceText in interface AccessibleEditableText
start
- - the starting index (inclusive)end
- - the ending index (exclusive)s
- - the text to paste
selectText
public void selectText(int start,
int end)
Selects the text between two indexes.
- selectText in interface AccessibleEditableText
start
- - the starting index (inclusive)end
- - the ending index (exclusive)
setAttributes
public void setAttributes(int start,
int end,
AttributeSet s)
throws gnu.classpath.NotImplementedException
Sets the attributes of all the text between two indexes.
- 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
JTextComponent.java --
Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.