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 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
(ComponentValue<T, ?> componentValue) static LoginDialogBuilder
static <T> SelectionDialogBuilder.MultiSelector<T>
multiSelector
(Supplier<Collection<T>> valueSupplier) Returns aSelectionDialogBuilder.MultiSelector
implmentation based on a selection dialog.static OkCancelDialogBuilder
okCancelDialog
(JComponent component) static ProgressDialog.Builder
static <T,
V> ProgressWorkerDialogBuilder<T, V> Note, also sets the progress bar type to 'determinate'.static <T> ProgressWorkerDialogBuilder<T,
?> static ProgressWorkerDialogBuilder<?,
?> static <T> SelectionDialogBuilder<T>
selectionDialog
(Collection<T> values) static <T> SelectionDialogBuilder.SingleSelector<T>
singleSelector
(Supplier<Collection<T>> valueSupplier) Returns aSelectionDialogBuilder.SingleSelector
implmentation based on a selection dialog.
-
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 <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
-
selectionDialog
- Type Parameters:
T
- the value type- Parameters:
values
- the values to select from- Returns:
- a new 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:
componentValue
- the value which component to display- Returns:
- a builder for a input dialog
-
singleSelector
public static <T> SelectionDialogBuilder.SingleSelector<T> singleSelector(Supplier<Collection<T>> valueSupplier) Returns aSelectionDialogBuilder.SingleSelector
implmentation based on a selection dialog.- Type Parameters:
T
- the type of values being looked up- Parameters:
valueSupplier
- supplies the values for the selection dialog- Returns:
- a new
SelectionDialogBuilder.SingleSelector
based on a selection dialog
-
multiSelector
public static <T> SelectionDialogBuilder.MultiSelector<T> multiSelector(Supplier<Collection<T>> valueSupplier) Returns aSelectionDialogBuilder.MultiSelector
implmentation based on a selection dialog.- Type Parameters:
T
- the type of values being looked up- Parameters:
valueSupplier
- supplies the values for the selection dialog- Returns:
- a new
SelectionDialogBuilder.MultiSelector
based on a selection dialog
-
displayExceptionDialog
Displays the given exception in a dialog- Parameters:
exception
- the exceptiondialogParent
- the dialog parent window
-