Package com.bc.ceres.swing.progress
Class ProgressMonitorSwingWorker<T,V>
java.lang.Object
javax.swing.SwingWorker<T,V>
com.bc.ceres.swing.progress.ProgressMonitorSwingWorker<T,V>
- All Implemented Interfaces:
Runnable,Future<T>,RunnableFuture<T>
A swing worker which may pop-up a progress monitor dialog.
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.SwingWorker
SwingWorker.StateValueNested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedProgressMonitorSwingWorker(Component parentComponent, String title) -
Method Summary
Modifier and TypeMethodDescriptionprotected final TOverridden in order to call thedoInBackgroundmethod with aProgressMonitor.protected abstract TComputes a result, or throws an exception if unable to do so.final voidSimilar to theSwingWorker.execute()method, but blocks the current thread until this worker computed its result.Methods inherited from class javax.swing.SwingWorker
addPropertyChangeListener, cancel, done, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, process, publish, removePropertyChangeListener, run, setProgressMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.concurrent.Future
exceptionNow, resultNow, state
-
Constructor Details
-
ProgressMonitorSwingWorker
-
-
Method Details
-
doInBackground
Overridden in order to call thedoInBackgroundmethod with aProgressMonitor.- Specified by:
doInBackgroundin classSwingWorker<T,V> - Returns:
- the computed result
- Throws:
Exception- if unable to compute a result
-
doInBackground
Computes a result, or throws an exception if unable to do so.Note that this method is executed only once in a background thread.
- Parameters:
pm- the progress monitor- Returns:
- the computed result
- Throws:
Exception- if unable to compute a result
-
executeWithBlocking
public final void executeWithBlocking()Similar to theSwingWorker.execute()method, but blocks the current thread until this worker computed its result. However, this method will not block the Event Dispatch Thread. -
getDialogProgressMonitor
-