Class DialogsImpl

java.lang.Object
io.jmix.ui.sys.DialogsImpl
All Implemented Interfaces:
Dialogs

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

    • messages

      @Autowired protected Messages messages
    • backgroundWorker

      @Autowired protected BackgroundWorker backgroundWorker
    • iconResolver

      @Autowired protected IconResolver iconResolver
    • icons

      @Autowired protected Icons icons
    • componentProperties

      @Autowired protected UiComponentProperties componentProperties
    • screenProperties

      @Autowired protected UiScreenProperties screenProperties
    • htmlSanitizer

      @Autowired protected HtmlSanitizer htmlSanitizer
    • applicationContext

      @Autowired protected org.springframework.context.ApplicationContext applicationContext
    • ui

      protected AppUI ui
    • screenBuilders

      protected ScreenBuilders screenBuilders
  • Constructor Details

    • DialogsImpl

      public DialogsImpl()
  • Method Details

    • setAppUi

      @Autowired public void setAppUi(AppUI ui)
    • setScreenBuilders

      @Autowired public void setScreenBuilders(ScreenBuilders screenBuilders)
    • createOptionDialog

      public Dialogs.OptionDialogBuilder createOptionDialog()
      Description copied from interface: Dialogs
      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();
       
      Specified by:
      createOptionDialog in interface Dialogs
      Returns:
      builder
    • createMessageDialog

      public Dialogs.MessageDialogBuilder createMessageDialog()
      Description copied from interface: Dialogs
      Creates message dialog builder.
      Example of showing a message dialog:
      
       dialogs.createMessageDialog()
               .withCaption("Alert")
               .withMessage("Report has been saved")
               .show();
       
      Specified by:
      createMessageDialog in interface Dialogs
      Returns:
      builder
    • createExceptionDialog

      public Dialogs.ExceptionDialogBuilder createExceptionDialog()
      Description copied from interface: Dialogs
      Creates exception dialog builder.
      Example of showing an exception dialog:
      
       dialogs.createExceptionDialog()
               .withCaption("Alert")
               .withMessage("Report has been saved")
               .withThrowable(exception)
               .show();
       
      Specified by:
      createExceptionDialog in interface Dialogs
      Returns:
      builder
    • createInputDialog

      public Dialogs.InputDialogBuilder createInputDialog(FrameOwner owner)
      Description copied from interface: Dialogs
      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();
       
      Specified by:
      createInputDialog in interface Dialogs
      Parameters:
      owner - origin screen from input dialog is invoked
      Returns:
      builder
    • createBackgroundWorkDialog

      public Dialogs.BackgroundWorkDialogBuilder createBackgroundWorkDialog(FrameOwner owner, BackgroundTask backgroundTask)
      Description copied from interface: Dialogs
      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();
       
      Specified by:
      createBackgroundWorkDialog in interface Dialogs
      Parameters:
      owner - origin screen from the dialog is invoked
      Returns:
      builder
    • createButton

      public JmixButton createButton(Action action)