Package io.jmix.ui
Interface Dialogs
- All Known Implementing Classes:
DialogsImpl
public interface Dialogs
Utility dialogs API.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Dialogs.BackgroundWorkDialogBuilder<T extends Number,
V> Builder of background work dialog.static interface
Dialogs.DialogBuilder<T extends Dialogs.DialogBuilder>
Base class for all Dialog Builders.static interface
Builder of unhandled exception dialog.static interface
Marker interface for Dialog Builders that have caption.static interface
Marker interface for Dialog Builders that have content mode setting.static interface
Marker interface for Dialog Builders that have html sanitizer for dialog content.static interface
Marker interface for Dialog Builders that have message.static interface
Marker interface for Dialog Builders that have modal setting.static interface
Marker interface for Dialog Builders that have size setting.static interface
Marker interface for Dialog Builders that have stylename setting.static interface
Marker interface for Dialog Builders that have window mode for dialog window.static interface
Builder for dialogs with inputs.static interface
Builder of information dialog.static interface
Builder of dialog with option buttons. -
Method Summary
Modifier and TypeMethodDescription<T extends Number,
V>
Dialogs.BackgroundWorkDialogBuilder<T,V> createBackgroundWorkDialog
(FrameOwner owner, BackgroundTask<T, V> backgroundTask) Creates background work dialog builder.Creates exception dialog builder.createInputDialog
(FrameOwner owner) Creates input dialog builder.Creates message dialog builder.Creates option dialog builder.
-
Method Details
-
createOptionDialog
Dialogs.OptionDialogBuilder createOptionDialog()Creates option dialog builder.
Example of showing an option dialog:dialogs.createOptionDialog() .withCaption("Question") .withMessage("Do you want to discard data?") .withActions( new DialogAction(DialogAction.Type.YES).withHandler(e -> { // YES option selected }), new DialogAction(DialogAction.Type.NO).withHandler(e -> { // NO option selected }) ) .show();
- Returns:
- builder
-
createMessageDialog
Dialogs.MessageDialogBuilder createMessageDialog()Creates message dialog builder.
Example of showing a message dialog:dialogs.createMessageDialog() .withCaption("Alert") .withMessage("Report has been saved") .show();
- Returns:
- builder
-
createExceptionDialog
Dialogs.ExceptionDialogBuilder createExceptionDialog()Creates exception dialog builder.
Example of showing an exception dialog:dialogs.createExceptionDialog() .withCaption("Alert") .withMessage("Report has been saved") .withThrowable(exception) .show();
- Returns:
- builder
-
createInputDialog
Creates input dialog builder.Example of showing an input dialog:
dialogs.createInputDialog(this) .withParameters( stringParameter("name").withCaption("Name"), intParameter("count").withCaption("Count")) .withActions(DialogActions.OK_CANCEL) .withCloseListener(closeEvent -> notifications.create(Notifications.NotificationType.TRAY) .withCaption("Dialog is closed") .show()) .withCaption("Goods") .show();
- Parameters:
owner
- origin screen from input dialog is invoked- Returns:
- builder
-
createBackgroundWorkDialog
<T extends Number,V> Dialogs.BackgroundWorkDialogBuilder<T,V> createBackgroundWorkDialog(FrameOwner owner, BackgroundTask<T, V> backgroundTask) Creates background work dialog builder.Example of showing a background work dialog:
dialogs.createBackgroundWorkDialog(this, backgroundTask) .withCaption("Task") .withMessage("My Task is Running") .withTotal(total) .withShowProgressInPercentage(true) .withCancelAllowed(true) .show();
- Parameters:
owner
- origin screen from the dialog is invoked- Returns:
- builder
-