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 InputMethodEventBuilder
addComposed
(Collection<? extends InputMethodTextRun> col) Calls theaddAll
method on the ObservableList returned by theInputMethodEvent#getComposed()
method.final InputMethodEventBuilder
addComposed
(InputMethodTextRun... elements) Calls theaddAll
method 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 theInputMethodEvent
class.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
.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
.
-
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 theInputMethodEvent
class.Intermediate builder methods are not evaluated until the
build
method is called; in other words, they are evaluated lazily.- Returns:
- new instance of the
InputMethodEvent
class
-
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 theaddAll
method on the ObservableList returned by theInputMethodEvent#getComposed()
method.- Returns:
- builder instance
-
addComposed
Calls theaddAll
method on the ObservableList returned by theInputMethodEvent#getComposed()
method.- Returns:
- builder instance
-