|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface InputMethodRequests
This interface handles requests made by input methods on text editing components. A component must specify a handler for input methods that implements this interface, and which supports one of two user interfaces:
Component.getInputMethodRequests()
,
InputMethodListener
Method Summary | |
---|---|
AttributedCharacterIterator |
cancelLatestCommittedText(AttributedCharacterIterator.Attribute[] attributes)
Gets the latest committed text, and removes it from the component's text body. |
AttributedCharacterIterator |
getCommittedText(int beginIndex,
int endIndex,
AttributedCharacterIterator.Attribute[] attributes)
Gets an interator which provides access to the text and its attributes, except for the uncommitted text. |
int |
getCommittedTextLength()
Gets the length of committed text. |
int |
getInsertPositionOffset()
Gets the offset where the committed text exists in the text editing component. |
TextHitInfo |
getLocationOffset(int x,
int y)
Get the text offset for the given screen coordinate. |
AttributedCharacterIterator |
getSelectedText(AttributedCharacterIterator.Attribute[] attributes)
Gets the currently selected text. |
Rectangle |
getTextLocation(TextHitInfo offset)
Gets the location of a given offset of the text. |
Method Detail |
---|
Rectangle getTextLocation(TextHitInfo offset)
If the component has composed text (from the most recent InputMethodEvent), then offset 0 indicates the location of the first character of this composed text. Otherwise, the offset is ignored, and the location should be the beginning of the final line of selected text (in horizontal left-to-right text, like English, this would be the lower left corner of the selction; in vertical top-to-bottom text, like Chinese, this would be the top right corner of the selection).
The location returned is a 0-thickness caret (either horizontal or vertical, depending on text flow), mapped to absolute screen coordinates.
offset
- offset within composed text, or null
TextHitInfo getLocationOffset(int x, int y)
x
- the x screen coordinatey
- the y screen coordinate
int getInsertPositionOffset()
AttributedCharacterIterator getCommittedText(int beginIndex, int endIndex, AttributedCharacterIterator.Attribute[] attributes)
beginIndex
- the index of the first character in the iterationendIndex
- the index of the last character in the iterationattributes
- a list of attributes interested in, or null
int getCommittedTextLength()
AttributedCharacterIterator cancelLatestCommittedText(AttributedCharacterIterator.Attribute[] attributes)
attributes
- a list of attributes interested in, or null
AttributedCharacterIterator getSelectedText(AttributedCharacterIterator.Attribute[] attributes)
attributes
- a list of attributes interested in, or null
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |