Package io.jmix.ui
Interface Dialogs
- All Known Implementing Classes:
DialogsImpl
public interface Dialogs
Utility dialogs API.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceDialogs.BackgroundWorkDialogBuilder<T extends Number,V> Builder of background work dialog.static interfaceDialogs.DialogBuilder<T extends Dialogs.DialogBuilder>Base class for all Dialog Builders.static interfaceBuilder of unhandled exception dialog.static interfaceMarker interface for Dialog Builders that have caption.static interfaceMarker interface for Dialog Builders that have content mode setting.static interfaceMarker interface for Dialog Builders that have html sanitizer for dialog content.static interfaceMarker interface for Dialog Builders that have message.static interfaceMarker interface for Dialog Builders that have modal setting.static interfaceMarker interface for Dialog Builders that have size setting.static interfaceMarker interface for Dialog Builders that have stylename setting.static interfaceMarker interface for Dialog Builders that have window mode for dialog window.static interfaceBuilder for dialogs with inputs.static interfaceBuilder of information dialog.static interfaceBuilder 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
-