Module is.codion.swing.common.ui
Package is.codion.swing.common.ui.dialog
Interface ProgressWorkerDialogBuilder<T,V>
- Type Parameters:
T
- the type of result thisProgressWorker
produces.V
- the type of intermediate result thisProgressWorker
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 Summary
Modifier and TypeMethodDescriptionbuild()
control
(Control.Builder<?, ?> controlBuilder) execute()
Builds and executes a newProgressWorker
based 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, title
-
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
-
control
- Parameters:
controlBuilder
- the control built by this builder will be added to the dialog as a button- Returns:
- this Builder instance
-
control
- Parameters:
control
- this control will be added to the dialog as a button- 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
ProgressWorker<T,V> execute()Builds and executes a newProgressWorker
based on this builder- Returns:
- a
ProgressWorker
based on this builder
-
build
ProgressWorker<T,V> build()- Returns:
- a
ProgressWorker
based on this builder
-