SimpleTask

org.scalafx.extras.BusyWorker.SimpleTask
trait SimpleTask[R]

A simple wrapper for a task that has a status message property and a progress property. Intended for use with org.scalafx.extras.BusyWorker.SimpleTask) BusyWorker#doTask method

Type parameters

R

returned value type.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def call(): R

Perform the main actions of this task.

Perform the main actions of this task.

Attributes

Concrete methods

def onCancelled(): Unit

Method called whenever the state of the Task has transitioned to the CANCELLED state. This method is invoked on the FX Application Thread after any listeners of the state property and after the Task has been fully transitioned to the new state.

Method called whenever the state of the Task has transitioned to the CANCELLED state. This method is invoked on the FX Application Thread after any listeners of the state property and after the Task has been fully transitioned to the new state.

Attributes

def onFailed(e: WorkerStateEvent): Unit

Method called whenever the state of the Task has transitioned to the FAILED state. This method is invoked on the FX Application Thread after any listeners of the state property and after the Task has been fully transitioned to the new state.

Method called whenever the state of the Task has transitioned to the FAILED state. This method is invoked on the FX Application Thread after any listeners of the state property and after the Task has been fully transitioned to the new state.

Implementation should consume the event to stop execution of automated error handling by the BusyWorker for this event.

When custom error handling is implemented, it may be more convenient to do it in onFinish, as more information about the failure can be accessed there using Try(result.get).

Value parameters

e

event state issued during the failure.

Attributes

def onFinish(result: Future[R], successful: Boolean): Unit

Perform some actions after after call() completed. This is executed regardless of success or failure of call(). Use this to prevent blocking while waiting for call() to finish. The default implementation does nothing.

Perform some actions after after call() completed. This is executed regardless of success or failure of call(). Use this to prevent blocking while waiting for call() to finish. The default implementation does nothing.

Value parameters

result

a future containing result returned by call(). The result can be obtained using result.get(). Only valid if call() completed successfully.

successful

will be true if call completed successfully (without exceptions and was not cancelled).

Attributes

def onRunning(): Unit

Method called whenever the state of the Task has transitioned to the RUNNING state. This method is invoked on the FX Application Thread after any listeners of the state property and after the Task has been fully transitioned to the new state.

Method called whenever the state of the Task has transitioned to the RUNNING state. This method is invoked on the FX Application Thread after any listeners of the state property and after the Task has been fully transitioned to the new state.

Attributes

def onScheduled(): Unit

Method called whenever the state of the Task has transitioned to the SCHEDULED state. This method is invoked on the FX Application Thread after any listeners of the state property and after the Task has been fully transitioned to the new state.

Method called whenever the state of the Task has transitioned to the SCHEDULED state. This method is invoked on the FX Application Thread after any listeners of the state property and after the Task has been fully transitioned to the new state.

Attributes

def onSucceeded(): Unit

called whenever the state of the Task has transitioned to the SUCCEEDED state. This method is invoked on the FX Application Thread after any listeners of the state property and after the Task has been fully transitioned to the new state.

called whenever the state of the Task has transitioned to the SUCCEEDED state. This method is invoked on the FX Application Thread after any listeners of the state property and after the Task has been fully transitioned to the new state.

Attributes

Concrete fields

val message: StringProperty

Message that can be updated while task is executed.

Message that can be updated while task is executed.

Attributes

val progress: DoubleProperty

Progress indicator that can be updated when task is executed.

Progress indicator that can be updated when task is executed.

Attributes