Module is.codion.swing.common.ui
Package is.codion.swing.common.ui.dialog
Interface ProgressWorkerDialogBuilder<T,V>
- Type Parameters:
T- the type of result thisProgressWorkerproduces.V- the type of intermediate result thisProgressWorkerproduces.
- 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:
-
to indicate work progress
-
Method Summary
Modifier and TypeMethodDescriptionbuild()execute()Builds and executes a newProgressWorkerbased on this builderindeterminate(boolean indeterminate) maximumProgress(int maximumProgress) Note that calling this method renders the progress bar determinatenorthPanel(JPanel northPanel) onException(String exceptionTitle) onException(Consumer<Exception> onException) progressBarSize(Dimension progressBarSize) stringPainted(boolean stringPainted) Methods inherited from interface is.codion.swing.common.ui.dialog.DialogBuilder
icon, keyEvent, location, locationRelativeTo, owner, owner, title, titleProvider
-
Method Details
-
indeterminate
- Parameters:
indeterminate- true if the progress bar should be indeterminate- Returns:
- this Builder instance
-
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
- 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
- Parameters:
northPanel- if specified this panel will be added to the BorderLayout.NORTH position of the dialog- Returns:
- this Builder instance
-
westPanel
- Parameters:
westPanel- if specified this panel will be added to the BorderLayout.WEST position of the dialog- Returns:
- this Builder instance
-
eastPanel
- Parameters:
eastPanel- if specified this panel will be added to the BorderLayout.EAST position of the dialog- Returns:
- this Builder instance
-
controls
- Parameters:
controls- if specified these controls will be displayed as buttons, useful for adding a cancel action- Returns:
- this Builder instance
-
progressBarSize
- Parameters:
progressBarSize- the size of the progress bar- Returns:
- this Builder instance
-
onResult
- Parameters:
onResult- executed on the EDT after a successful run- Returns:
- this Builder instance
-
onResult
- Parameters:
onResult- executed on the EDT after a successful run- Returns:
- this Builder instance
-
onResult
- Parameters:
resultMessage- if specified then this message is displayed after the task has successfully run- Returns:
- this Builder instance
-
onException
- Parameters:
onException- the exception handler- Returns:
- this Builder instance
-
onException
- Parameters:
exceptionTitle- the title of the exception dialog- Returns:
- this Builder instance
-
execute
Builds and executes a newProgressWorkerbased on this builder- Returns:
- a
ProgressWorkerbased on this builder
-
build
- Returns:
- a
ProgressWorkerbased on this builder
-