Interface ProgressWorkerDialogBuilder<T,V>

Type Parameters:
T - the type of result this ProgressWorker produces.
V - the type of intermediate result this ProgressWorker produces.
All Superinterfaces:
DialogBuilder<ProgressWorkerDialogBuilder<T,V>>

public interface ProgressWorkerDialogBuilder<T,V> extends DialogBuilder<ProgressWorkerDialogBuilder<T,V>>
A builder for a ProgressWorker implementation which displays a progress bar in a modal dialog while background work is being performed. The progress bar can be of type 'indeterminate' or with the progress ranging from 0 to 100.
See Also:
  • Method Details

    • indeterminate

      ProgressWorkerDialogBuilder<T,V> indeterminate(boolean indeterminate)
      Parameters:
      indeterminate - true if the progress bar should be indeterminate
      Returns:
      this Builder instance
    • maximumProgress

      ProgressWorkerDialogBuilder<T,V> maximumProgress(int maximumProgress)
      Note that calling this method renders the progress bar determinate
      Parameters:
      maximumProgress - the maximum progress, 100 by default
      Returns:
      this Builder instance
      See Also:
    • stringPainted

      ProgressWorkerDialogBuilder<T,V> stringPainted(boolean stringPainted)
      Parameters:
      stringPainted - the string painted status of the progress bar
      Returns:
      this Builder instance
    • border

      Parameters:
      border - the border to add around the progress bar
      Returns:
      this Builder instance
    • northPanel

      ProgressWorkerDialogBuilder<T,V> northPanel(JPanel northPanel)
      Parameters:
      northPanel - if specified this panel will be added to the BorderLayout.NORTH position of the dialog
      Returns:
      this Builder instance
    • westPanel

      ProgressWorkerDialogBuilder<T,V> westPanel(JPanel westPanel)
      Parameters:
      westPanel - if specified this panel will be added to the BorderLayout.WEST position of the dialog
      Returns:
      this Builder instance
    • eastPanel

      ProgressWorkerDialogBuilder<T,V> eastPanel(JPanel eastPanel)
      Parameters:
      eastPanel - if specified this panel will be added to the BorderLayout.EAST position of the dialog
      Returns:
      this Builder instance
    • controls

      ProgressWorkerDialogBuilder<T,V> controls(Controls controls)
      Parameters:
      controls - if specified these controls will be displayed as buttons, useful for adding a cancel action
      Returns:
      this Builder instance
    • progressBarSize

      ProgressWorkerDialogBuilder<T,V> progressBarSize(Dimension progressBarSize)
      Parameters:
      progressBarSize - the size of the progress bar
      Returns:
      this Builder instance
    • onResult

      ProgressWorkerDialogBuilder<T,V> onResult(Runnable onResult)
      Parameters:
      onResult - executed on the EDT after a successful run
      Returns:
      this Builder instance
    • onResult

      ProgressWorkerDialogBuilder<T,V> onResult(Consumer<T> onResult)
      Parameters:
      onResult - executed on the EDT after a successful run
      Returns:
      this Builder instance
    • onResult

      ProgressWorkerDialogBuilder<T,V> onResult(String resultMessage)
      Parameters:
      resultMessage - if specified then this message is displayed after the task has successfully run
      Returns:
      this Builder instance
    • onException

      ProgressWorkerDialogBuilder<T,V> onException(Consumer<Throwable> onException)
      Parameters:
      onException - the exception handler
      Returns:
      this Builder instance
    • onException

      ProgressWorkerDialogBuilder<T,V> onException(String exceptionTitle)
      Parameters:
      exceptionTitle - the title of the exception dialog
      Returns:
      this Builder instance
    • execute

      ProgressWorker<T,V> execute()
      Builds and executes a new ProgressWorker based on this builder
      Returns:
      a ProgressWorker based on this builder
    • build

      ProgressWorker<T,V> build()
      Returns:
      a ProgressWorker based on this builder