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>

public abstract class ProgressMonitorSwingWorker<T,V> extends SwingWorker<T,V>
A swing worker which may pop-up a progress monitor dialog.
  • Constructor Details

    • ProgressMonitorSwingWorker

      protected ProgressMonitorSwingWorker(Component parentComponent, String title)
  • Method Details

    • doInBackground

      protected final T doInBackground() throws Exception
      Overridden in order to call the doInBackground method with a ProgressMonitor.
      Specified by:
      doInBackground in class SwingWorker<T,V>
      Returns:
      the computed result
      Throws:
      Exception - if unable to compute a result
    • doInBackground

      protected abstract T doInBackground(ProgressMonitor pm) throws Exception
      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 the SwingWorker.execute() method, but blocks the current thread until this worker computed its result. However, this method will not block the Event Dispatch Thread.
    • getDialogProgressMonitor

      public DialogProgressMonitor getDialogProgressMonitor()