Interface Observable

    • Field Summary

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods 
      Modifier and Type Method Description
      Guard block()
      Deprecated.
      Prevents invalidation and change events from being emitted, until the returned guard is released.
      default void blockWhile​(java.lang.Runnable r)
      Deprecated.
      Runs the given computation, making sure the invalidation and change events are blocked.
      default <T> T blockWhile​(java.util.function.Supplier<T> f)
      Deprecated.
      Runs the given computation, making sure the invalidation and change events are blocked.
      default Guard guard()
      Deprecated.
      Equivalent to block().
      • Methods inherited from interface javafx.beans.Observable

        addListener, removeListener
    • Method Detail

      • block

        Guard block()
        Deprecated.
        Prevents invalidation and change events from being emitted, until the returned guard is released.
        Returns:
        a Guard instance that can be released to resume the delivery of invalidation and change events. If this observable has been invalidated one or more times before the guard is released, a single notification is passed to invalidation and change listeners of this observable. The returned Guard is AutoCloseable, which makes it convenient to use in try-with-resources.
      • blockWhile

        default void blockWhile​(java.lang.Runnable r)
        Deprecated.
        Runs the given computation, making sure the invalidation and change events are blocked. When done, previous blocked state is restored.

        Equivalent to

         try(Guard g = block()) {
             r.run();
         }
         
      • blockWhile

        default <T> T blockWhile​(java.util.function.Supplier<T> f)
        Deprecated.
        Runs the given computation, making sure the invalidation and change events are blocked. When done, previous blocked state is restored.
         T t = this.blockWhile(f);
         
        is equivalent to
         T t;
         try(Guard g = block()) {
             t = f.get();
         }