java.lang.Object
is.codion.swing.common.ui.dialog.Dialogs
A utility class for displaying Dialogs.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <B extends ActionDialogBuilder<B>>
ActionDialogBuilder<B> actionDialog
(JComponent component) static CalendarDialogBuilder
static <T> ComboBoxSelectionDialogBuilder
<T> comboBoxSelectionDialog
(Collection<T> values) static ComponentDialogBuilder
componentDialog
(JComponent component) static void
displayExceptionDialog
(Throwable exception, Window dialogParent) Displays the given exception in a dialogstatic ExceptionDialogBuilder
static FileSelectionDialogBuilder
static <T> InputDialogBuilder
<T> inputDialog
(ComponentBuilder<T, ?, ?> componentBuilder) static <T> InputDialogBuilder
<T> inputDialog
(ComponentValue<T, ?> componentValue) static <T> ListSelectionDialogBuilder
<T> listSelectionDialog
(Collection<T> values) static LoginDialogBuilder
static OkCancelDialogBuilder
okCancelDialog
(JComponent component) static ProgressDialog.Builder
static <T,
V> ProgressWorkerDialogBuilder <T, V> Note, also sets the progress bar type to 'determinate'.static <V> ProgressWorkerDialogBuilder
<?, V> Note, also sets the progress bar type to 'determinate'.static <T> ProgressWorkerDialogBuilder
<T, ?> static ProgressWorkerDialogBuilder
<?, ?>
-
Method Details
-
componentDialog
- Parameters:
component
- the component to display- Returns:
- a new
ComponentDialogBuilder
instance.
-
progressDialog
- Returns:
- a new
ProgressDialog.Builder
instance.
-
progressWorkerDialog
- Parameters:
task
- the task to run- Returns:
- a new indeterminate
ProgressWorkerDialogBuilder
instance
-
progressWorkerDialog
public static <T> ProgressWorkerDialogBuilder<T,?> progressWorkerDialog(ProgressWorker.ResultTask<T> task) - Type Parameters:
T
- the worker result type- Parameters:
task
- the task to run- Returns:
- a new indeterminate
ProgressWorkerDialogBuilder
instance
-
progressWorkerDialog
public static <V> ProgressWorkerDialogBuilder<?,V> progressWorkerDialog(ProgressWorker.ProgressTask<V> task) Note, also sets the progress bar type to 'determinate'.- Type Parameters:
V
- the worker intermediate result type- Parameters:
task
- the task to run- Returns:
- a new determinate
ProgressWorkerDialogBuilder
instance - See Also:
-
progressWorkerDialog
public static <T,V> ProgressWorkerDialogBuilder<T,V> progressWorkerDialog(ProgressWorker.ProgressResultTask<T, V> task) Note, also sets the progress bar type to 'determinate'.- Type Parameters:
T
- the worker result typeV
- the worker intermediate result type- Parameters:
task
- the task to run- Returns:
- a new determinate
ProgressWorkerDialogBuilder
instance - See Also:
-
loginDialog
- Returns:
- a new login dialog builder
-
exceptionDialog
- Returns:
- a new exception dialog builder
-
fileSelectionDialog
- Returns:
- a new FileSelectionDialogBuilder
-
listSelectionDialog
- Type Parameters:
T
- the value type- Parameters:
values
- the values to select from- Returns:
- a new
JList
based selection dialog builder - Throws:
IllegalArgumentException
- in case values is empty
-
comboBoxSelectionDialog
- Type Parameters:
T
- the value type- Parameters:
values
- the values to select from- Returns:
- a new
JComboBox
based selection dialog builder - Throws:
IllegalArgumentException
- in case values is empty
-
okCancelDialog
- Parameters:
component
- the component to display- Returns:
- a new OkCancelDialogBuilder
-
actionDialog
public static <B extends ActionDialogBuilder<B>> ActionDialogBuilder<B> actionDialog(JComponent component) - Type Parameters:
B
- the builder type- Parameters:
component
- the component to display- Returns:
- a new ActionDialogBuilder
-
calendarDialog
- Returns:
- a new CalendarDialogBuilder
-
lookAndFeelSelectionDialog
- Returns:
- a builder for a dialog for selecting a look and feel
-
fontSizeSelectionDialog
- Returns:
- a builder for a dialog for selecting the font size
-
inputDialog
- Type Parameters:
T
- the value type- Parameters:
componentBuilder
- the builder which component to display- Returns:
- a builder for an input dialog
-
inputDialog
- Type Parameters:
T
- the value type- Parameters:
componentValue
- the value which component to display- Returns:
- a builder for an input dialog
-
displayExceptionDialog
Displays the given exception in a dialog- Parameters:
exception
- the exceptiondialogParent
- the dialog parent window
-