Interface WorkState<V>

Type Parameters:
V - the type of the result value
All Superinterfaces:
javafx.concurrent.Worker<V>
All Known Implementing Classes:
BlackHoleWorkState, SimpleWorkState

public interface WorkState<V> extends javafx.concurrent.Worker<V>
Work state can be used to report the current state of work, and provides an ability to cancel work in progress.
  • Property Details

    • value

      javafx.beans.property.ReadOnlyObjectProperty<V> valueProperty
      Specified by:
      valueProperty in interface javafx.concurrent.Worker<V>
      See Also:
    • workDone

      javafx.beans.property.ReadOnlyDoubleProperty workDoneProperty
      Specified by:
      workDoneProperty in interface javafx.concurrent.Worker<V>
      See Also:
    • totalWork

      javafx.beans.property.ReadOnlyDoubleProperty totalWorkProperty
      Specified by:
      totalWorkProperty in interface javafx.concurrent.Worker<V>
      See Also:
    • progress

      javafx.beans.property.ReadOnlyDoubleProperty progressProperty
      Specified by:
      progressProperty in interface javafx.concurrent.Worker<V>
      See Also:
    • message

      javafx.beans.property.ReadOnlyStringProperty messageProperty
      Specified by:
      messageProperty in interface javafx.concurrent.Worker<V>
      See Also:
    • title

      javafx.beans.property.ReadOnlyStringProperty titleProperty
      Specified by:
      titleProperty in interface javafx.concurrent.Worker<V>
      See Also:
  • Field Details

  • Method Details

    • updateMessage

      void updateMessage(@Nullable String value)
      Asynchronously updates the current message of the work state.

      Calls to this method are coalesced and run later on the FX application thread, so calls to this method, even from the FX Application thread, may not necessarily result in immediate updates to the property, and intermediate values may be coalesced to save on event notifications.

      Parameters:
      value - the new value
    • updateState

      void updateState(javafx.concurrent.Worker.State value)
      Asynchronously updates the current state of the work state.

      Calls to this method are coalesced as described in updateMessage(String).

      Parameters:
      value - the new value
    • updateException

      void updateException(Throwable value)
      Asynchronously updates the current exception of the work state.

      Calls to this method are coalesced as described in updateMessage(String).

      Parameters:
      value - the new value
    • updateRunning

      void updateRunning(boolean value)
      Asynchronously updates the current running state of the work state.

      Calls to this method are coalesced as described in updateMessage(String).

      Parameters:
      value - the new value
    • updateTitle

      void updateTitle(@Nullable String value)
      Asynchronously updates the current title of the work state.

      Calls to this method are coalesced as described in updateMessage(String).

      Parameters:
      value - the new value
    • updateValue

      void updateValue(@Nullable V value)
      Asynchronously updates the current value of the work state.

      Calls to this method are coalesced as described in updateMessage(String).

      Parameters:
      value - the new value
    • updateProgress

      void updateProgress(double value)
      Asynchronously updates the progress of the work state.

      Calls to this method are coalesced as described in updateMessage(String).

      Parameters:
      value - the new value
    • isCancelled

      boolean isCancelled()
      Returns true if the worker associated to this work state should cancel.
      Returns:
      true if cancelled
    • getValue

      @Nullable V getValue()
      Specified by:
      getValue in interface javafx.concurrent.Worker<V>
      See Also:
      • Worker.getValue()
    • valueProperty

      javafx.beans.property.ReadOnlyObjectProperty<V> valueProperty()
      Specified by:
      valueProperty in interface javafx.concurrent.Worker<V>
      Returns:
      the value property
      See Also:
    • getWorkDone

      double getWorkDone()
      Specified by:
      getWorkDone in interface javafx.concurrent.Worker<V>
      See Also:
      • Worker.getWorkDone()
    • workDoneProperty

      javafx.beans.property.ReadOnlyDoubleProperty workDoneProperty()
      Specified by:
      workDoneProperty in interface javafx.concurrent.Worker<V>
      Returns:
      the workDone property
      See Also:
    • getTotalWork

      double getTotalWork()
      Specified by:
      getTotalWork in interface javafx.concurrent.Worker<V>
      See Also:
      • Worker.getTotalWork()
    • totalWorkProperty

      javafx.beans.property.ReadOnlyDoubleProperty totalWorkProperty()
      Specified by:
      totalWorkProperty in interface javafx.concurrent.Worker<V>
      Returns:
      the totalWork property
      See Also:
    • getProgress

      double getProgress()
      Specified by:
      getProgress in interface javafx.concurrent.Worker<V>
      See Also:
      • Worker.getProgress()
    • progressProperty

      javafx.beans.property.ReadOnlyDoubleProperty progressProperty()
      Specified by:
      progressProperty in interface javafx.concurrent.Worker<V>
      Returns:
      the progress property
      See Also:
    • getMessage

      @Nullable String getMessage()
      Specified by:
      getMessage in interface javafx.concurrent.Worker<V>
      See Also:
      • Worker.getMessage()
    • messageProperty

      javafx.beans.property.ReadOnlyStringProperty messageProperty()
      Specified by:
      messageProperty in interface javafx.concurrent.Worker<V>
      Returns:
      the message property
      See Also:
    • getTitle

      @Nullable String getTitle()
      Specified by:
      getTitle in interface javafx.concurrent.Worker<V>
      See Also:
      • Worker.getTitle()
    • titleProperty

      javafx.beans.property.ReadOnlyStringProperty titleProperty()
      Specified by:
      titleProperty in interface javafx.concurrent.Worker<V>
      Returns:
      the title property
      See Also: