Class BackgroundWorkDialog<T extends Number,V>

java.lang.Object
io.jmix.ui.screen.Screen
io.jmix.ui.app.backgroundwork.BackgroundWorkDialog<T,V>
Type Parameters:
T - measure unit which shows progress of task
V - result type
All Implemented Interfaces:
FrameOwner

@UiController("backgroundWorkProgressScreen") @UiDescriptor("background-work-dialog.xml") @DialogMode(forceDialog=true) public class BackgroundWorkDialog<T extends Number,V> extends Screen
Dialog that indicates progress of the background task, shows progress bar and processed items' message.
Background task should have <T extends Number> as the progress measure unit. Progress measure passed to the publish() method is displayed in processed items'/percents' message. Total number of items should be specified before task execution.

On error:

  • Executes handle exception in background task
  • Closes background window
  • Shows Warning message if for background task specified owner window

  • Field Details

    • backgroundWorker

      @Autowired protected BackgroundWorker backgroundWorker
    • messages

      @Autowired protected Messages messages
    • text

      @Autowired protected Label<String> text
    • progressText

      @Autowired protected Label<String> progressText
    • cancelButton

      @Autowired protected Button cancelButton
    • taskProgressBar

      @Autowired protected ProgressBar taskProgressBar
    • task

      protected BackgroundTask<T extends Number,V> task
    • cancelAllowed

      protected boolean cancelAllowed
    • message

      protected String message
    • total

      protected Number total
    • showProgressInPercentage

      protected boolean showProgressInPercentage
    • taskHandler

      protected BackgroundTaskHandler<V> taskHandler
    • totalProgress

      protected T extends Number totalProgress
  • Constructor Details

    • BackgroundWorkDialog

      public BackgroundWorkDialog()
  • Method Details

    • onAfterShow

      @Subscribe public void onAfterShow(Screen.AfterShowEvent event)
    • onBeforeClose

      @Subscribe public void onBeforeClose(Screen.BeforeCloseEvent event)
    • onCancelButtonClick

      @Subscribe("cancelButton") public void onCancelButtonClick(Button.ClickEvent event)
    • getTask

      public BackgroundTask<T,V> getTask()
    • setTask

      public void setTask(BackgroundTask<T,V> task)
    • isCancelAllowed

      public boolean isCancelAllowed()
    • setCancelAllowed

      public void setCancelAllowed(boolean cancelAllowed)
    • getMessage

      public String getMessage()
    • setMessage

      public void setMessage(String message)
    • isShowProgressInPercentage

      public boolean isShowProgressInPercentage()
    • setShowProgressInPercentage

      public void setShowProgressInPercentage(boolean showProgressInPercentage)
    • getTotal

      public Number getTotal()
    • setTotal

      public void setTotal(Number total)
    • showProgress

      protected void showProgress(Number processedValue)