- 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 Summary
PropertiesTypePropertyDescriptionjavafx.beans.property.ReadOnlyStringPropertyjavafx.beans.property.ReadOnlyDoublePropertyjavafx.beans.property.ReadOnlyStringPropertyjavafx.beans.property.ReadOnlyDoublePropertyjavafx.beans.property.ReadOnlyObjectProperty<V> javafx.beans.property.ReadOnlyDoublePropertyProperties inherited from interface javafx.concurrent.Worker
exception, running, state -
Nested Class Summary
Nested classes/interfaces inherited from interface javafx.concurrent.Worker
javafx.concurrent.Worker.State -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringThe name of themessageProperty().static final StringThe name of theprogressProperty().static final Stringstatic final Stringstatic final StringThe name of thetitleProperty().static final StringThe name of thetotalWorkProperty().static final StringThe name of thevalueProperty().static final StringThe name of theworkDoneProperty(). -
Method Summary
Modifier and TypeMethodDescription@Nullable Stringdouble@Nullable StringgetTitle()double@Nullable VgetValue()doublebooleanReturns true if the worker associated to this work state should cancel.javafx.beans.property.ReadOnlyStringPropertyjavafx.beans.property.ReadOnlyDoublePropertyjavafx.beans.property.ReadOnlyStringPropertyjavafx.beans.property.ReadOnlyDoublePropertyvoidupdateException(Throwable value) Asynchronously updates the current exception of the work state.voidupdateMessage(@Nullable String value) Asynchronously updates the current message of the work state.voidupdateProgress(double value) Asynchronously updates the progress of the work state.voidupdateRunning(boolean value) Asynchronously updates the current running state of the work state.voidupdateState(javafx.concurrent.Worker.State value) Asynchronously updates the current state of the work state.voidupdateTitle(@Nullable String value) Asynchronously updates the current title of the work state.voidupdateValue(@Nullable V value) Asynchronously updates the current value of the work state.javafx.beans.property.ReadOnlyObjectProperty<V> javafx.beans.property.ReadOnlyDoublePropertyMethods inherited from interface javafx.concurrent.Worker
cancel, exceptionProperty, getException, getState, isRunning, runningProperty, stateProperty
-
Property Details
-
value
javafx.beans.property.ReadOnlyObjectProperty<V> valueProperty- Specified by:
valuePropertyin interfacejavafx.concurrent.Worker<V>- See Also:
-
workDone
javafx.beans.property.ReadOnlyDoubleProperty workDoneProperty- Specified by:
workDonePropertyin interfacejavafx.concurrent.Worker<V>- See Also:
-
totalWork
javafx.beans.property.ReadOnlyDoubleProperty totalWorkProperty- Specified by:
totalWorkPropertyin interfacejavafx.concurrent.Worker<V>- See Also:
-
progress
javafx.beans.property.ReadOnlyDoubleProperty progressProperty- Specified by:
progressPropertyin interfacejavafx.concurrent.Worker<V>- See Also:
-
message
javafx.beans.property.ReadOnlyStringProperty messageProperty- Specified by:
messagePropertyin interfacejavafx.concurrent.Worker<V>- See Also:
-
title
javafx.beans.property.ReadOnlyStringProperty titleProperty- Specified by:
titlePropertyin interfacejavafx.concurrent.Worker<V>- See Also:
-
-
Field Details
-
TITLE_PROPERTY
The name of thetitleProperty().- See Also:
-
MESSAGE_PROPERTY
The name of themessageProperty().- See Also:
-
RUNNING_PROPERTY
- See Also:
-
VALUE_PROPERTY
The name of thevalueProperty().- See Also:
-
STATE_PROPERTY
- See Also:
-
EXCEPTION_PROPERTY
- See Also:
-
WORK_DONE_PROPERTY
The name of theworkDoneProperty().- See Also:
-
TOTAL_WORK_PROPERTY
The name of thetotalWorkProperty().- See Also:
-
PROGRESS_PROPERTY
The name of theprogressProperty().- See Also:
-
-
Method Details
-
updateMessage
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
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
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
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:
getValuein interfacejavafx.concurrent.Worker<V>- See Also:
-
valueProperty
javafx.beans.property.ReadOnlyObjectProperty<V> valueProperty()- Specified by:
valuePropertyin interfacejavafx.concurrent.Worker<V>- Returns:
- the
valueproperty - See Also:
-
getWorkDone
double getWorkDone()- Specified by:
getWorkDonein interfacejavafx.concurrent.Worker<V>- See Also:
-
workDoneProperty
javafx.beans.property.ReadOnlyDoubleProperty workDoneProperty()- Specified by:
workDonePropertyin interfacejavafx.concurrent.Worker<V>- Returns:
- the
workDoneproperty - See Also:
-
getTotalWork
double getTotalWork()- Specified by:
getTotalWorkin interfacejavafx.concurrent.Worker<V>- See Also:
-
totalWorkProperty
javafx.beans.property.ReadOnlyDoubleProperty totalWorkProperty()- Specified by:
totalWorkPropertyin interfacejavafx.concurrent.Worker<V>- Returns:
- the
totalWorkproperty - See Also:
-
getProgress
double getProgress()- Specified by:
getProgressin interfacejavafx.concurrent.Worker<V>- See Also:
-
progressProperty
javafx.beans.property.ReadOnlyDoubleProperty progressProperty()- Specified by:
progressPropertyin interfacejavafx.concurrent.Worker<V>- Returns:
- the
progressproperty - See Also:
-
getMessage
@Nullable String getMessage()- Specified by:
getMessagein interfacejavafx.concurrent.Worker<V>- See Also:
-
messageProperty
javafx.beans.property.ReadOnlyStringProperty messageProperty()- Specified by:
messagePropertyin interfacejavafx.concurrent.Worker<V>- Returns:
- the
messageproperty - See Also:
-
getTitle
@Nullable String getTitle()- Specified by:
getTitlein interfacejavafx.concurrent.Worker<V>- See Also:
-
titleProperty
javafx.beans.property.ReadOnlyStringProperty titleProperty()- Specified by:
titlePropertyin interfacejavafx.concurrent.Worker<V>- Returns:
- the
titleproperty - See Also:
-