Class EventUtil

java.lang.Object
com.iamsoft.util.ui.javafx.EventUtil

public final class EventUtil extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    static <T> void
    addIdentityChangeListener(javafx.beans.value.ObservableValue<T> pValue, javafx.beans.value.ChangeListener<T> pListener)
    Sometimes important change events might be missed when values are compared using the equals method.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • 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 returns true, 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.
    • addIdentityChangeListener

      public static <T> void addIdentityChangeListener(javafx.beans.value.ObservableValue<T> pValue, javafx.beans.value.ChangeListener<T> pListener)
      Sometimes important change events might be missed when values are compared using the equals method. For example, when comparing two different lists, which are both empty or with equal elements.