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 CalendarDialogBuilderstatic ComponentDialogBuildercomponentDialog(JComponent component) static voiddisplayExceptionDialog(Throwable exception, Window dialogParent) Displays the given exception in a dialogstatic ExceptionDialogBuilderstatic FileSelectionDialogBuilderfontSizeSelectionDialog(String userPreferencePropertyName) static <T> InputDialogBuilder<T>inputDialog(ComponentValue<T, ?> componentValue) static LoginDialogBuilderstatic <T> SelectionDialogBuilder.MultiSelector<T>multiSelector(Supplier<Collection<T>> valueSupplier) Returns aSelectionDialogBuilder.MultiSelectorimplmentation based on a selection dialog.static OkCancelDialogBuilderokCancelDialog(JComponent component) static ProgressDialog.Builderstatic <T,V> ProgressWorkerDialogBuilder<T, V> progressWorkerDialog(is.codion.swing.common.model.worker.ProgressWorker.ProgressResultTask<T, V> task) Note, also sets the progress bar type to 'determinate'.static <T> ProgressWorkerDialogBuilder<T,?> progressWorkerDialog(is.codion.swing.common.model.worker.ProgressWorker.ResultTask<T> task) static ProgressWorkerDialogBuilder<?,?> static <T> SelectionDialogBuilder<T>selectionDialog(Collection<T> values) static <T> SelectionDialogBuilder.SingleSelector<T>singleSelector(Supplier<Collection<T>> valueSupplier) Returns aSelectionDialogBuilder.SingleSelectorimplmentation based on a selection dialog.
-
Method Details
-
componentDialog
- Parameters:
component- the component to display- Returns:
- a new
ComponentDialogBuilderinstance.
-
progressDialog
- Returns:
- a new
ProgressDialog.Builderinstance.
-
progressWorkerDialog
- Parameters:
task- the task to run- Returns:
- a new indeterminate
ProgressWorkerDialogBuilderinstance
-
progressWorkerDialog
public static <T> ProgressWorkerDialogBuilder<T,?> progressWorkerDialog(is.codion.swing.common.model.worker.ProgressWorker.ResultTask<T> task) - Type Parameters:
T- the worker result type- Parameters:
task- the task to run- Returns:
- a new indeterminate
ProgressWorkerDialogBuilderinstance
-
progressWorkerDialog
public static <T,V> ProgressWorkerDialogBuilder<T,V> progressWorkerDialog(is.codion.swing.common.model.worker.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
ProgressWorkerDialogBuilderinstance - 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
public static FontSizeSelectionDialogBuilder fontSizeSelectionDialog(String userPreferencePropertyName) - Parameters:
userPreferencePropertyName- the name of the property to use when saving the selected font size as a user preference- 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.SingleSelectorimplmentation 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.SingleSelectorbased on a selection dialog
-
multiSelector
public static <T> SelectionDialogBuilder.MultiSelector<T> multiSelector(Supplier<Collection<T>> valueSupplier) Returns aSelectionDialogBuilder.MultiSelectorimplmentation 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.MultiSelectorbased on a selection dialog
-
displayExceptionDialog
Displays the given exception in a dialog- Parameters:
exception- the exceptiondialogParent- the dialog parent window
-