Package io.jmix.flowui.impl
Class DialogsImpl
java.lang.Object
io.jmix.flowui.impl.DialogsImpl
- All Implemented Interfaces:
Dialogs
Implementation of the
Dialogs interface, providing methods for creating different types of dialogs.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassImplementation ofDialogs.BackgroundTaskDialogBuilderthat facilitates creating and managing dialogs for running background tasks with progress display, cancel functionality, and customizable UI elements.classImplementation of theDialogs.InputDialogBuilderinterface designed to facilitate the creation and customization ofInputDialogcomponents.classImplementation of theDialogs.MessageDialogBuilderinterface that provides functionality for building and configuring a message dialog in a fluent manner.classImplementation of theDialogs.OptionDialogBuilderthat enables configuring and building option dialogs.Nested classes/interfaces inherited from interface io.jmix.flowui.Dialogs
Dialogs.BackgroundTaskDialogBuilder<T extends Number,V>, Dialogs.Closeable<T>, Dialogs.DialogBuilder<T extends Dialogs.DialogBuilder>, Dialogs.Draggable<T>, Dialogs.HasContent<T>, Dialogs.HasHeader<T>, Dialogs.HasModal<T>, Dialogs.HasPosition<T>, Dialogs.HasSize<T>, Dialogs.HasStyle<T>, Dialogs.HasText<T>, Dialogs.HasTheme<T>, Dialogs.InputDialogBuilder, Dialogs.MessageDialogBuilder, Dialogs.OptionDialogBuilder, Dialogs.Resizable<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContextprotected BackgroundWorkerprotected static final Stringprotected DialogWindowsprotected UiViewPropertiesprotected Messagesprotected static final Stringprotected UiComponents -
Constructor Summary
ConstructorsConstructorDescriptionDialogsImpl(org.springframework.context.ApplicationContext applicationContext, Messages messages, UiViewProperties flowUiViewProperties, DialogWindows dialogWindows, UiComponents uiComponents, BackgroundWorker backgroundWorker) -
Method Summary
Modifier and TypeMethodDescription<T extends Number,V>
Dialogs.BackgroundTaskDialogBuilder<T,V> createBackgroundTaskDialog(BackgroundTask<T, V> backgroundTask) Creates background task dialog builder.protected com.vaadin.flow.component.button.ButtoncreateButton(Action action, com.vaadin.flow.component.dialog.Dialog dialog) createInputDialog(View<?> origin) Creates input dialog builder.Creates message dialog builder.Creates option dialog builder.
-
Field Details
-
MIN_WIDTH
- See Also:
-
BUTTON_CLASS_NAMES_POSTFIX
- See Also:
-
messages
-
flowUiViewProperties
-
dialogWindows
-
uiComponents
-
backgroundWorker
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext
-
-
Constructor Details
-
DialogsImpl
public DialogsImpl(org.springframework.context.ApplicationContext applicationContext, Messages messages, UiViewProperties flowUiViewProperties, DialogWindows dialogWindows, UiComponents uiComponents, BackgroundWorker backgroundWorker)
-
-
Method Details
-
createOptionDialog
Description copied from interface:DialogsCreates option dialog builder.
Example of showing an option dialog:dialogs.createOptionDialog() .withHeader("Confirm") .withText("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 }) ) .open();- Specified by:
createOptionDialogin interfaceDialogs
-
createMessageDialog
Description copied from interface:DialogsCreates message dialog builder.
Example of showing a message dialog:dialogs.createMessageDialog() .withHeader("Attention") .withText("Report has been saved") .open();- Specified by:
createMessageDialogin interfaceDialogs- Returns:
- builder
-
createInputDialog
Description copied from interface:DialogsCreates input dialog builder.
Example of showing an input dialog:dialogs.createInputDialog(this) .withParameters( stringParameter("name").withLabel("Name"), intParameter("count").withLabel("Count")) .withActions(DialogActions.OK_CANCEL) .withCloseListener(closeEvent -> notifications.create("Dialog is closed") .show() ) .withHeader("Goods") .open();- Specified by:
createInputDialogin interfaceDialogs- Parameters:
origin- origin view from input dialog is invoked- Returns:
- builder
-
createBackgroundTaskDialog
public <T extends Number,V> Dialogs.BackgroundTaskDialogBuilder<T,V> createBackgroundTaskDialog(BackgroundTask<T, V> backgroundTask) Description copied from interface:DialogsCreates background task dialog builder.
Example of showing a background task dialog:dialogs.createBackgroundTaskDialog(backgroundTask) .withHeader("Task") .withText("My Task is Running") .withTotal(10) .withShowProgressInPercentage(true) .withCancelAllowed(true) .open();- Specified by:
createBackgroundTaskDialogin interfaceDialogs- Parameters:
backgroundTask- background task to run- Returns:
- builder
-
createButton
protected com.vaadin.flow.component.button.Button createButton(Action action, com.vaadin.flow.component.dialog.Dialog dialog)
-