Package org.reactfx

Interface Toggle

  • All Superinterfaces:
    javafx.beans.Observable, Observable<java.util.function.Consumer<? super java.lang.Boolean>>, javafx.beans.value.ObservableValue<java.lang.Boolean>, Suspendable, Val<java.lang.Boolean>
    All Known Implementing Classes:
    SuspendableBoolean, SuspendableNo, SuspendableYes, ToggleFromVal

    public interface Toggle
    extends Val<java.lang.Boolean>, Suspendable
    Observable boolean that changes value when suspended. Which boolean value is the value of the base state and which is the value of the suspended state depends on the implementation.
    • Method Detail

      • from

        static Toggle from​(javafx.beans.value.ObservableValue<java.lang.Boolean> obs,
                           Suspendable suspender)
        Creates a Toggle view of an observable boolean and a Suspendable whose suspension causes the boolean value to switch.
        Parameters:
        obs - boolean value that indicates suspension of suspender.
        suspender - Assumed to switch the value of obs when suspended and switch back when resumed, unless there are other suspenders keeping it in the value corresponding to the suspended state.