java.awt.event
public class InputMethodEvent extends AWTEvent
Since: 1.2
See Also: InputMethodListener
UNKNOWN: updated to 1.4
Field Summary | |
---|---|
static int | CARET_POSITION_CHANGED This event id indicates that the input method curor point has changed. |
static int | INPUT_METHOD_FIRST This is the first id in the range of event ids used by this class. |
static int | INPUT_METHOD_LAST This is the last id in the range of event ids used by this class. |
static int | INPUT_METHOD_TEXT_CHANGED This event id indicates that the text in the input method has changed. |
Constructor Summary | |
---|---|
InputMethodEvent(Component source, int id, long when, AttributedCharacterIterator text, int committedCharacterCount, TextHitInfo caret, TextHitInfo visiblePosition)
Initializes a new instance of InputMethodEvent with the
specified source, id, timestamp, text, char count, caret, and visible
position.
| |
InputMethodEvent(Component source, int id, AttributedCharacterIterator text, int committedCharacterCount, TextHitInfo caret, TextHitInfo visiblePosition)
Initializes a new instance of InputMethodEvent with the
specified source, id, text, char count, caret, and visible position.
| |
InputMethodEvent(Component source, int id, TextHitInfo caret, TextHitInfo visiblePosition)
Initializes a new instance of InputMethodEvent with the
specified source, id, caret, and visible position, and with a null
text and char count.
|
Method Summary | |
---|---|
void | consume()
This method consumes the event. |
TextHitInfo | getCaret()
Returns the caret position. |
int | getCommittedCharacterCount()
Returns the number of committed characters in the input method text.
|
AttributedCharacterIterator | getText()
This method returns the input method text. |
TextHitInfo | getVisiblePosition()
Returns the position that is most important to be visible, or null if
such a hint is not necessary. |
long | getWhen()
Return the timestamp of this event.
|
boolean | isConsumed()
This method tests whether or not this event has been consumed.
|
String | paramString()
This method returns a string identifying the event. |
InputMethodEvent
with the
specified source, id, timestamp, text, char count, caret, and visible
position.
Parameters: source the source that generated the event id the event id when the timestamp of the event text the input text committedCharacterCount the number of committed characters caret the caret position visiblePosition the position most important to make visible
Throws: IllegalArgumentException if source is null, id is invalid, id is CARET_POSITION_CHANGED and text is non-null, or if committedCharacterCount is out of range
Since: 1.4
InputMethodEvent
with the
specified source, id, text, char count, caret, and visible position.
Parameters: source the source that generated the event id the event id text the input text committedCharacterCount the number of committed characters caret the caret position visiblePosition the position most important to make visible
Throws: IllegalArgumentException if source is null, id is invalid, id is CARET_POSITION_CHANGED and text is non-null, or if committedCharacterCount is out of range
Since: 1.4
InputMethodEvent
with the
specified source, id, caret, and visible position, and with a null
text and char count.
Parameters: source the source that generated the event id the event id caret the caret position visiblePosition the position most important to make visible
Throws: IllegalArgumentException if source is null or id is invalid
Since: 1.4
INPUT_METHOD_TEXT_CHANGED
event.
Returns: the caret position, or null
Returns: the number of committed characters in the input method text
null
,
and will always be null for CARET_POSITION_CHANGED
events.
Characters from 0 to getCommittedCharacterCount()-1
have
been committed, the remaining characters are composed text.
Returns: the input method text, or null
INPUT_METHOD_TEXT_CHANGED
event.
Returns: the position that is most important to be visible
Returns: the timestamp
Since: 1.4
Returns: true if the event has been consumed
Returns: a string identifying the event