Class ProgressWorker<T,V>

java.lang.Object
javax.swing.SwingWorker<T,V>
is.codion.swing.common.model.worker.ProgressWorker<T,V>
Type Parameters:
T - the type of result this ProgressWorker produces.
V - the type of intermediate result produced by this ProgressWorker
All Implemented Interfaces:
Runnable, Future<T>, RunnableFuture<T>

public final class ProgressWorker<T,V> extends SwingWorker<T,V>

A SwingWorker implementation. Note that instances of this class are not reusable.

Note that this implementation does NOT coalesce progress reports or intermediate result publishing, but simply pushes those directly to the onProgress and onPublish handlers for running on the Event Dispatch Thread.

 
 ProgressWorker.builder(this::performTask)
   .onStarted(this::displayDialog)
   .onDone(this::closeDialog)
   .onResult(this::handleResult)
   .onProgress(this::displayProgress)
   .onPublish(this::publishMessage)
   .onCancelled(this::displayCancelledMessage)
   .onException(this::displayException)
   .execute();
 
 
See Also: