|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.text.JTextComponent.InputMethodRequestsHandler
Constructor Summary | |
(package private) |
JTextComponent.InputMethodRequestsHandler()
|
Method Summary | |
AttributedCharacterIterator |
cancelLatestCommittedText(AttributedCharacterIterator.Attribute[] attributes)
Gets the latest committed text from the text editing component and removes it from the component's text body. |
void |
changedUpdate(DocumentEvent e)
Gives notification that an attribute or set of attributes changed. |
AttributedCharacterIterator |
getCommittedText(int beginIndex,
int endIndex,
AttributedCharacterIterator.Attribute[] attributes)
Gets an iterator providing access to the entire text and attributes contained in the text editing component except for uncommitted text. |
int |
getCommittedTextLength()
Gets the length of the entire text contained in the text editing component except for uncommitted (composed) text. |
int |
getInsertPositionOffset()
Gets the offset of the insert position in the committed text contained in the text editing component. |
TextHitInfo |
getLocationOffset(int x,
int y)
Gets the offset within the composed text for the specified absolute x and y coordinates on the screen. |
AttributedCharacterIterator |
getSelectedText(AttributedCharacterIterator.Attribute[] attributes)
Gets the currently selected text from the text editing component. |
Rectangle |
getTextLocation(TextHitInfo offset)
Gets the location of a specified offset in the current composed text, or of the selection in committed text. |
void |
insertUpdate(DocumentEvent e)
Gives notification that there was an insert into the document. |
void |
removeUpdate(DocumentEvent e)
Gives notification that a portion of the document has been removed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
JTextComponent.InputMethodRequestsHandler()
Method Detail |
public AttributedCharacterIterator cancelLatestCommittedText(AttributedCharacterIterator.Attribute[] attributes)
InputMethodRequests
Generally, this feature should only be supported immediately after the text was committed, not after the user performed other operations on the text. When the feature is not supported, return null.
The input method may provide a list of attributes that it is interested in. In that case, information about other attributes that the implementor may have need not be made accessible through the iterator. If the list is null, all available attribute information should be made accessible.
cancelLatestCommittedText
in interface InputMethodRequests
attributes
- a list of attributes that the input method is
interested in
public AttributedCharacterIterator getCommittedText(int beginIndex, int endIndex, AttributedCharacterIterator.Attribute[] attributes)
InputMethodRequests
The input method may provide a list of attributes that it is interested in. In that case, information about other attributes that the implementor may have need not be made accessible through the iterator. If the list is null, all available attribute information should be made accessible.
getCommittedText
in interface InputMethodRequests
beginIndex
- the index of the first characterendIndex
- the index of the character following the last characterattributes
- a list of attributes that the input method is
interested in
public int getCommittedTextLength()
InputMethodRequests
getCommittedTextLength
in interface InputMethodRequests
public int getInsertPositionOffset()
InputMethodRequests
getInsertPositionOffset
in interface InputMethodRequests
public TextHitInfo getLocationOffset(int x, int y)
InputMethodRequests
Return null if the location is outside the area occupied by the composed text.
getLocationOffset
in interface InputMethodRequests
x
- the absolute x coordinate on screeny
- the absolute y coordinate on screen
public Rectangle getTextLocation(TextHitInfo offset)
InputMethodRequests
If the component has composed text (because the most recent InputMethodEvent sent to it contained composed text), then the offset is relative to the composed text - offset 0 indicates the first character in the composed text. The location returned should be for this character.
If the component doesn't have composed text, the offset should be ignored, and the location returned should reflect the beginning (in line direction) of the highlight in the last line containing selected text. For example, for horizontal left-to-right text (such as English), the location to the left of the left-most character on the last line containing selected text is returned. For vertical top-to-bottom text, with lines proceding from right to left, the location to the top of the left-most line containing selected text is returned.
The location is represented as a 0-thickness caret, that is, it has 0 width if the text is drawn horizontally, and 0 height if the text is drawn vertically. Other text orientations need to be mapped to horizontal or vertical orientation. The rectangle uses absolute screen coordinates.
getTextLocation
in interface InputMethodRequests
offset
- the offset within the composed text, if there is composed
text; null otherwise
public AttributedCharacterIterator getSelectedText(AttributedCharacterIterator.Attribute[] attributes)
InputMethodRequests
The input method may provide a list of attributes that it is interested in. In that case, information about other attributes that the implementor may have need not be made accessible through the iterator. If the list is null, all available attribute information should be made accessible.
getSelectedText
in interface InputMethodRequests
attributes
- a list of attributes that the input method is
interested in
public void changedUpdate(DocumentEvent e)
DocumentListener
changedUpdate
in interface DocumentListener
e
- the document eventpublic void insertUpdate(DocumentEvent e)
DocumentListener
insertUpdate
in interface DocumentListener
e
- the document eventpublic void removeUpdate(DocumentEvent e)
DocumentListener
removeUpdate
in interface DocumentListener
e
- the document event
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |