- java.lang.Object
-
- com.iamsoft.util.ui.javafx.EventUtil
-
public final class EventUtil extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T,U>
voidaddActionEventFilter(javafx.scene.control.Button pButton, Function<javafx.scene.control.Button,U> pOnAction, Function<U,T> pBackgroundOp, BiPredicate<javafx.scene.control.Button,T> pActionPredicate, BiConsumer<javafx.scene.control.Button,Exception> pOnError, long pTimeoutMillis)
Consumes action events, validates on a background thread and re-fire action events if validation is successful.static javafx.beans.property.ReadOnlyBooleanProperty
createKeyDownProperty(javafx.scene.input.KeyCode pKeyCode)
static javafx.beans.property.ReadOnlyBooleanProperty
createKeyDownProperty(javafx.scene.Node pNode, javafx.scene.input.KeyCode pKeyCode)
static javafx.beans.value.ObservableValue<Integer>
createMouseOverTextProperty(org.fxmisc.richtext.StyledTextArea<?,?> pTextArea, long pDelayMillis)
static void
onPostLayoutPulse(javafx.scene.Scene pScene, Runnable pRunnable)
The specified listener will be called only once, after the CSS and layout passes on the next pulse, but before any rendering is done.
-
-
-
Method Detail
-
createKeyDownProperty
public static javafx.beans.property.ReadOnlyBooleanProperty createKeyDownProperty(javafx.scene.Node pNode, javafx.scene.input.KeyCode pKeyCode)
-
createKeyDownProperty
public static javafx.beans.property.ReadOnlyBooleanProperty createKeyDownProperty(javafx.scene.input.KeyCode pKeyCode)
-
createMouseOverTextProperty
public static javafx.beans.value.ObservableValue<Integer> createMouseOverTextProperty(org.fxmisc.richtext.StyledTextArea<?,?> pTextArea, long pDelayMillis)
-
onPostLayoutPulse
public static void onPostLayoutPulse(javafx.scene.Scene pScene, Runnable pRunnable)
The specified listener will be called only once, after the CSS and layout passes on the next pulse, but before any rendering is done.
-
addActionEventFilter
public static <T,U> void addActionEventFilter(javafx.scene.control.Button pButton, Function<javafx.scene.control.Button,U> pOnAction, Function<U,T> pBackgroundOp, BiPredicate<javafx.scene.control.Button,T> pActionPredicate, BiConsumer<javafx.scene.control.Button,Exception> pOnError, long pTimeoutMillis)
Consumes action events, validates on a background thread and re-fire action events if validation is successful.- Type Parameters:
T
- The return type of the background operation.U
- Type of object to pass to the background operation.- Parameters:
pButton
- The button to add action event filter.pOnAction
- Invoked when an action event occurs on the specified button.pBackgroundOp
- Invoked on a background thread after an action event occurs on the specified button.pActionPredicate
- Invoked on the JavaFX thread after the specified background operation is done. If the predicate returnstrue
, the action event is re-fired. Note that the predicate might not be invoked at all if the specified background operator throws an exception.pTimeoutMillis
- Duration in milliseconds to wait for the background operator to finish before giving up. Negative value or zero means indefinitely.
-
-