Package org.reactfx

Interface Toggle

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

public interface Toggle extends Val<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 Details

    • from

      static Toggle from(javafx.beans.value.ObservableValue<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.