The text included with the input method event consists of two parts: committed text and composed text. Either part may be empty. The two parts together replace any uncommitted composed text sent in previous events, or the currently selected committed text. Committed text should be integrated into the text component's persistent data, it will not be sent again. Composed text may be sent repeatedly, with changes to reflect the user's editing operations. Committed text always precedes composed text.
| Modifier and Type | Field and Description |
|---|---|
| private transient TextHitInfo | |
| public static final int | CARET_POSITION_CHANGED
The event type indicating a changed insertion point in input method text. |
| private transient int | |
| public static final int | INPUT_METHOD_FIRST
Marks the first integer id for the range of input method event ids. |
| public static final int | INPUT_METHOD_LAST
Marks the last integer id for the range of input method event ids. |
| public static final int | INPUT_METHOD_TEXT_CHANGED
The event type indicating changed input method text. |
| private static final long | serialVersionUID
Use serialVersionUID from JDK 1.4 for interoperability.
|
| private transient AttributedCharacterIterator | |
| private transient TextHitInfo | |
| pack-priv long | when
The time stamp that indicates when the event was created. |
| Access | Constructor and Description |
|---|---|
| public | InputMethodEvent(Component
the object where the event originated source, int the event type id, long a long integer that specifies the time the event occurred when, AttributedCharacterIterator the combined committed and composed text,
committed text first; must be text, int null
when the event type is CARET_POSITION_CHANGED;
may be null for
INPUT_METHOD_TEXT_CHANGED if there's no
committed or composed textthe number of committed
characters in the text committedCharacterCount, TextHitInfo the caret (a.k.a. insertion point);
caret, TextHitInfo null if there's no caret within current
composed textthe position that's most important
to be visible; visiblePosition)null if there's no
recommendation for a visible position within current
composed textConstructs an |
| public | InputMethodEvent(Component
the object where the event originated source, int the event type id, AttributedCharacterIterator the combined committed and composed text,
committed text first; must be text, int null
when the event type is CARET_POSITION_CHANGED;
may be null for
INPUT_METHOD_TEXT_CHANGED if there's no
committed or composed textthe number of committed
characters in the text committedCharacterCount, TextHitInfo the caret (a.k.a. insertion point);
caret, TextHitInfo null if there's no caret within current
composed textthe position that's most important
to be visible; visiblePosition)null if there's no
recommendation for a visible position within current
composed textConstructs an |
| public | InputMethodEvent(Component
the object where the event originated source, int the event type id, TextHitInfo the caret (a.k.a. insertion point);
caret, TextHitInfo null if there's no caret within current
composed textthe position that's most important
to be visible; visiblePosition)null if there's no
recommendation for a visible position within current
composed textConstructs an |
| Modifier and Type | Method and Description |
|---|---|
| public void | consume()
Overrides java. Consumes this event so that it will not be processed in the default manner by the source which originated it. |
| public TextHitInfo | Returns: the caret (a.k.a. insertion point). Null if there's no caret within current composed text.Gets the caret. |
| public int | Returns: the number of committed characters in the textGets the number of committed characters in the text. |
| private static long | Returns: most recent event time in theEventQueuethe source of the event source)Get the most recent event time in the |
| public AttributedCharacterIterator | Returns: the text. Always null for CARET_POSITION_CHANGED; may be null for INPUT_METHOD_TEXT_CHANGED if there's no composed or committed text.Gets the combined committed and composed text. |
| public TextHitInfo | Returns: the position that's most important to be visible. Null if there's no recommendation for a visible position within current composed text.Gets the position that's most important to be visible. |
| public long | |
| public boolean | isConsumed()
Overrides java. Returns whether or not this event has been consumed. |
| public String | Returns: a string identifying the event and its attributesOverrides java. Returns a parameter string identifying this event. |
| private void | readObject(ObjectInputStream
the s)ObjectInputStream to readInitializes the |
| caret | back to summary |
|---|---|
| private transient TextHitInfo caret | |
| CARET_POSITION_CHANGED | back to summary |
|---|---|
| public static final int CARET_POSITION_CHANGED The event type indicating a changed insertion point in input method text. This event is generated by input methods while processing input if only the caret changed. | |
| committedCharacterCount | back to summary |
|---|---|
| private transient int committedCharacterCount | |
| INPUT_METHOD_FIRST | back to summary |
|---|---|
| public static final int INPUT_METHOD_FIRST Marks the first integer id for the range of input method event ids. | |
| INPUT_METHOD_LAST | back to summary |
|---|---|
| public static final int INPUT_METHOD_LAST Marks the last integer id for the range of input method event ids. | |
| INPUT_METHOD_TEXT_CHANGED | back to summary |
|---|---|
| public static final int INPUT_METHOD_TEXT_CHANGED The event type indicating changed input method text. This event is generated by input methods while processing input. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. Use serialVersionUID from JDK 1.4 for interoperability. | |
| text | back to summary |
|---|---|
| private transient AttributedCharacterIterator text | |
| visiblePosition | back to summary |
|---|---|
| private transient TextHitInfo visiblePosition | |
| when | back to summary |
|---|---|
| pack-priv long when The time stamp that indicates when the event was created.
| |
| InputMethodEvent | back to summary |
|---|---|
| public InputMethodEvent(Component source, int id, long when, AttributedCharacterIterator text, int committedCharacterCount, TextHitInfo caret, TextHitInfo visiblePosition) Constructs an
The offsets of caret and visiblePosition are relative to the current
composed text; that is, the composed text within Note that passing in an invalid
| |
| InputMethodEvent | back to summary |
|---|---|
| public InputMethodEvent(Component source, int id, AttributedCharacterIterator text, int committedCharacterCount, TextHitInfo caret, TextHitInfo visiblePosition) Constructs an
The offsets of caret and visiblePosition are relative to the current
composed text; that is, the composed text within Note that passing in an invalid
| |
| InputMethodEvent | back to summary |
|---|---|
| public InputMethodEvent(Component source, int id, TextHitInfo caret, TextHitInfo visiblePosition) Constructs an
The offsets of Note that passing in an invalid
| |
| consume | back to summary |
|---|---|
| public void consume() Overrides java. Consumes this event so that it will not be processed in the default manner by the source which originated it. | |
| getCaret | back to summary |
|---|---|
| public TextHitInfo getCaret() Gets the caret.
The offset of the caret is relative to the current
composed text; that is, the composed text within getText()
if this is an
| |
| getCommittedCharacterCount | back to summary |
|---|---|
| public int getCommittedCharacterCount() Gets the number of committed characters in the text.
| |
| getMostRecentEventTimeForSource | back to summary |
|---|---|
| private static long getMostRecentEventTimeForSource(Object source) Get the most recent event time in the
| |
| getText | back to summary |
|---|---|
| public AttributedCharacterIterator getText() Gets the combined committed and composed text.
Characters from index 0 to index
| |
| getVisiblePosition | back to summary |
|---|---|
| public TextHitInfo getVisiblePosition() Gets the position that's most important to be visible.
The offset of the visible position is relative to the current
composed text; that is, the composed text within getText()
if this is an
| |
| getWhen | back to summary |
|---|---|
| public long getWhen() Returns the time stamp of when this event occurred.
| |
| isConsumed | back to summary |
|---|---|
| public boolean isConsumed() Overrides java. Returns whether or not this event has been consumed.
| |
| paramString | back to summary |
|---|---|
| public String paramString() Overrides java. Returns a parameter string identifying this event. This method is useful for event-logging and for debugging. It contains the event ID in text form, the characters of the committed and composed text separated by "+", the number of committed characters, the caret, and the visible position.
| |
| readObject | back to summary |
|---|---|
| private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException Initializes the
| |