java.lang.Object
java.util.EventObject
javafx.event.Event
javafx.scene.input.InputEvent
javafx.scene.input.InputMethodEvent
- All Implemented Interfaces:
- Serializable,- Cloneable
An event which indicates that the underlying input method notifies its
 text change in a 
Node.
 
 This event is delivered to the Node object that extends
 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.
- Since:
- JavaFX 2.0
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final EventType<InputMethodEvent> Common supertype for all input method event types.static final EventType<InputMethodEvent> The only valid EventType for the InputMethodEvent.Fields declared in class javafx.event.Eventconsumed, eventType, NULL_SOURCE_TARGET, targetFields declared in class java.util.EventObjectsource
- 
Constructor SummaryConstructorsConstructorDescriptionInputMethodEvent(Object source, EventTarget target, EventType<InputMethodEvent> eventType, List<InputMethodTextRun> composed, String committed, int caretPosition) Constructs new InputMethodEvent event.InputMethodEvent(EventType<InputMethodEvent> eventType, List<InputMethodTextRun> composed, String committed, int caretPosition) Constructs new InputMethodEvent event with empty source and target.
- 
Method SummaryModifier and TypeMethodDescriptioncopyFor(Object newSource, EventTarget newTarget) Creates and returns a copy of this event with the specified event source and target.final intThe input method caret position within the composed text.final StringGets the text that is committed by the input method as the result of the composition.final ObservableList<InputMethodTextRun> Gets the text under composition.Gets the event type of this event.toString()Returns a string representation of thisInputMethodEventobject.Methods declared in class java.util.EventObjectgetSource
- 
Field Details- 
INPUT_METHOD_TEXT_CHANGEDThe only valid EventType for the InputMethodEvent.
- 
ANYCommon supertype for all input method event types.- Since:
- JavaFX 8.0
 
 
- 
- 
Constructor Details- 
InputMethodEventpublic InputMethodEvent(Object source, EventTarget target, EventType<InputMethodEvent> eventType, List<InputMethodTextRun> composed, String committed, int caretPosition) Constructs new InputMethodEvent event.- Parameters:
- 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 composition
- committed- the text that is committed as a result of composition
- caretPosition- the current position of the caret.
- Since:
- JavaFX 8.0
 
- 
InputMethodEventpublic InputMethodEvent(EventType<InputMethodEvent> eventType, List<InputMethodTextRun> composed, String committed, int caretPosition) Constructs new InputMethodEvent event with empty source and target.- Parameters:
- eventType- The type of the event.
- composed- the text under composition
- committed- the text that is committed as a result of composition
- caretPosition- the current position of the caret.
- Since:
- JavaFX 8.0
 
 
- 
- 
Method Details- 
getComposedGets the text under composition. This text should be displayed with the appropriate visual feedback that represents theInputMethodHighlights attached to each run.- Returns:
- The text under composition
 
- 
getCommittedGets the text that is committed by the input method as the result of the composition.- Returns:
- The committed text
 
- 
getCaretPositionpublic final int getCaretPosition()The input method caret position within the composed text. If the position is -1, the caret should be invisible.- Returns:
- The input method caret position within the composed text
 
- 
toStringReturns a string representation of thisInputMethodEventobject.- Overrides:
- toStringin class- EventObject
- Returns:
- a string representation of this InputMethodEventobject.
 
- 
copyForDescription copied from class:EventCreates and returns a copy of this event with the specified event source and target. If the source or target is set tonull, it is replaced by theNULL_SOURCE_TARGETvalue.
- 
getEventTypeDescription copied from class:EventGets the event type of this event. Objects of the sameEventclass can have different event types. These event types further specify what kind of event occurred.- Overrides:
- getEventTypein class- Event
- Returns:
- the event type
 
 
-