Class DialogsImpl

java.lang.Object
io.jmix.flowui.impl.DialogsImpl
All Implemented Interfaces:
Dialogs

@Component("flowui_Dialogs") public class DialogsImpl extends Object implements Dialogs
  • Field Details

  • Constructor Details

  • Method Details

    • createOptionDialog

      public Dialogs.OptionDialogBuilder createOptionDialog()
      Description copied from interface: Dialogs
      Creates 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:
      createOptionDialog in interface Dialogs
    • createMessageDialog

      public Dialogs.MessageDialogBuilder createMessageDialog()
      Description copied from interface: Dialogs
      Creates message dialog builder.
      Example of showing a message dialog:
      
       dialogs.createMessageDialog()
               .withHeader("Attention")
               .withText("Report has been saved")
               .open();
       
      Specified by:
      createMessageDialog in interface Dialogs
      Returns:
      builder
    • createInputDialog

      public Dialogs.InputDialogBuilder createInputDialog(View<?> origin)
      Description copied from interface: Dialogs
      Creates 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:
      createInputDialog in interface Dialogs
      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: Dialogs
      Creates 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:
      createBackgroundTaskDialog in interface Dialogs
      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)