Class InputMethodEventBuilder
java.lang.Object
io.github.sosuisen.jfxbuilder.graphics.InputMethodEventBuilder
The
InputMethodEventBuilder class constructs instances of the InputMethodEvent class
and offers a fluent interface for creating and configuring it.
This class includes a static create method that accepts the same arguments as the original InputMethodEvent constructor
and returns an instance of the InputMethodEventBuilder.
You can use method chaining to call the builder methods for configuring the InputMethodEvent.
Finally, invoke the build method to generate an instance of the InputMethodEvent class.
Note that intermediate builder methods are not evaluated until the build method
is called, meaning they are evaluated lazily.
- Author:
- Hidekazu Kubota <hidekazu.kubota@gmail.com>
-
Method Summary
Modifier and TypeMethodDescriptionfinal InputMethodEventBuilderaddComposed(Collection<? extends InputMethodTextRun> col) Calls theaddAllmethod on the ObservableList returned by theInputMethodEvent#getComposed()method.final InputMethodEventBuilderaddComposed(InputMethodTextRun... elements) Calls theaddAllmethod on the ObservableList returned by theInputMethodEvent#getComposed()method.apply(Consumer<InputMethodEvent> func) Applies a function to the InputMethodEvent instance being constructed.build()Builds and returns an instance of theInputMethodEventclass.static InputMethodEventBuildercreate(Object source, EventTarget target, EventType<InputMethodEvent> eventType, List<InputMethodTextRun> composed, String committed, int caretPosition) Accepts the constructor arguments ofInputMethodEvent(Object, EventTarget, EventType, List, String, int)and returns an instance ofInputMethodEventBuilder.static InputMethodEventBuildercreate(EventType<InputMethodEvent> eventType, List<InputMethodTextRun> composed, String committed, int caretPosition) Accepts the constructor arguments ofInputMethodEvent(EventType, List, String, int)and returns an instance ofInputMethodEventBuilder.
-
Method Details
-
create
public static InputMethodEventBuilder create(Object source, EventTarget target, EventType<InputMethodEvent> eventType, List<InputMethodTextRun> composed, String committed, int caretPosition) Accepts the constructor arguments ofInputMethodEvent(Object, EventTarget, EventType, List, String, int)and returns an instance ofInputMethodEventBuilder.- Returns:
- an instance of the
InputMethodEventBuilder.
-
create
public static InputMethodEventBuilder create(EventType<InputMethodEvent> eventType, List<InputMethodTextRun> composed, String committed, int caretPosition) Accepts the constructor arguments ofInputMethodEvent(EventType, List, String, int)and returns an instance ofInputMethodEventBuilder.- Returns:
- an instance of the
InputMethodEventBuilder.
-
build
Builds and returns an instance of theInputMethodEventclass.Intermediate builder methods are not evaluated until the
buildmethod is called; in other words, they are evaluated lazily.- Returns:
- new instance of the
InputMethodEventclass
-
apply
Applies a function to the InputMethodEvent instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-
addComposed
Calls theaddAllmethod on the ObservableList returned by theInputMethodEvent#getComposed()method.- Returns:
- builder instance
-
addComposed
Calls theaddAllmethod on the ObservableList returned by theInputMethodEvent#getComposed()method.- Returns:
- builder instance
-