public final class InputMethodEvent extends InputEvent
Node
.
This event is delivered to the Node
object that extends
javafx.scene.control.TextInputControl
, when the text under composition
(composed text) is generated/changed/removed, the input method commits
the result text, or the input method caret position changes.
On receiving this event, the application is supposed to display the composed text with any visual feedback attributes to the user.
Note: this is a conditional feature. See
ConditionalFeature.INPUT_METHOD
for more information.
Modifier and Type | Field and Description |
---|---|
static <any> |
ANY
Common supertype for all input method event types.
|
private int |
caretPosition
The input method caret position within the composed text.
|
private java.lang.String |
committed
The text that is committed by the input method as the result of the
composition.
|
private <any> |
composed
The text under composition.
|
static <any> |
INPUT_METHOD_TEXT_CHANGED
The only valid EventType for the InputMethodEvent.
|
private static long |
serialVersionUID |
Constructor and Description |
---|
InputMethodEvent(<any> eventType,
java.util.List<InputMethodTextRun> composed,
java.lang.String committed,
int caretPosition)
Constructs new InputMethodEvent event with empty source and target.
|
InputMethodEvent(java.lang.Object source,
EventTarget target,
<any> eventType,
java.util.List<InputMethodTextRun> composed,
java.lang.String committed,
int caretPosition)
Constructs new InputMethodEvent event.
|
Modifier and Type | Method and Description |
---|---|
InputMethodEvent |
copyFor(java.lang.Object newSource,
EventTarget newTarget) |
int |
getCaretPosition()
The input method caret position within the composed text.
|
java.lang.String |
getCommitted()
Gets the text that is committed by the input method as the result of the
composition.
|
<any> |
getComposed()
Gets the text under composition.
|
<any> |
getEventType() |
private void |
readObject(java.io.ObjectInputStream ois) |
java.lang.String |
toString()
Returns a string representation of this
InputMethodEvent object. |
private void |
writeObject(java.io.ObjectOutputStream oos) |
private static final long serialVersionUID
public static final <any> INPUT_METHOD_TEXT_CHANGED
public static final <any> ANY
private transient <any> composed
InputMethodHighlight
s
attached to each run.private final java.lang.String committed
private final int caretPosition
public InputMethodEvent(java.lang.Object source, EventTarget target, <any> eventType, java.util.List<InputMethodTextRun> composed, java.lang.String committed, int caretPosition)
source
- the source of the event. Can be null.target
- the target of the event. Can be null.eventType
- The type of the event.composed
- the text under compositioncommitted
- the text that is committed as a result of compositioncaretPosition
- the current position of the caret.public InputMethodEvent(<any> eventType, java.util.List<InputMethodTextRun> composed, java.lang.String committed, int caretPosition)
eventType
- The type of the event.composed
- the text under compositioncommitted
- the text that is committed as a result of compositioncaretPosition
- the current position of the caret.public final <any> getComposed()
InputMethodHighlight
s
attached to each run.public final java.lang.String getCommitted()
public final int getCaretPosition()
public java.lang.String toString()
InputMethodEvent
object.InputMethodEvent
object.public InputMethodEvent copyFor(java.lang.Object newSource, EventTarget newTarget)
public <any> getEventType()
getEventType
in class InputEvent
private void writeObject(java.io.ObjectOutputStream oos) throws java.io.IOException
java.io.IOException
private void readObject(java.io.ObjectInputStream ois) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException