Package io.jmix.ui.app.backgroundwork
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 taskV
- 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.
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
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.ui.screen.Screen
Screen.AfterCloseEvent, Screen.AfterDetachEvent, Screen.AfterInitEvent, Screen.AfterShowEvent, Screen.BeforeCloseEvent, Screen.BeforeShowEvent, Screen.InitEvent
-
Field Summary
Modifier and TypeFieldDescriptionprotected BackgroundWorker
protected boolean
protected Button
protected String
protected Messages
protected boolean
protected BackgroundTask<T,
V> protected BackgroundTaskHandler<V>
protected ProgressBar
protected Number
protected T
Fields inherited from interface io.jmix.ui.screen.FrameOwner
NO_OPTIONS, WINDOW_CLOSE_ACTION, WINDOW_COMMIT_AND_CLOSE_ACTION, WINDOW_DISCARD_AND_CLOSE_ACTION
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetTask()
getTotal()
boolean
boolean
void
onAfterShow
(Screen.AfterShowEvent event) void
void
void
setCancelAllowed
(boolean cancelAllowed) void
setMessage
(String message) void
setShowProgressInPercentage
(boolean showProgressInPercentage) void
setTask
(BackgroundTask<T, V> task) void
protected void
showProgress
(Number processedValue) Methods inherited from class io.jmix.ui.screen.Screen
addAfterCloseListener, addAfterDetachListener, addAfterInitListener, addAfterShowListener, addBeforeCloseListener, addBeforeShowListener, addInitListener, addUrlParamsChangeListener, close, close, closeWithDefaultAction, fireEvent, getApplicationContext, getEventHub, getExtensions, getId, getScreenData, getUiEventListeners, getWindow, isMultipleOpen, isSameScreen, isScreenAction, setApplicationContext, setExtensions, setId, setScreenData, setUiEventListeners, setWindow, show
-
Field Details
-
backgroundWorker
-
messages
-
text
-
progressText
-
cancelButton
-
taskProgressBar
-
task
-
cancelAllowed
protected boolean cancelAllowed -
message
-
total
-
showProgressInPercentage
protected boolean showProgressInPercentage -
taskHandler
-
totalProgress
-
-
Constructor Details
-
BackgroundWorkDialog
public BackgroundWorkDialog()
-
-
Method Details
-
onAfterShow
-
onBeforeClose
-
onCancelButtonClick
-
getTask
-
setTask
-
isCancelAllowed
public boolean isCancelAllowed() -
setCancelAllowed
public void setCancelAllowed(boolean cancelAllowed) -
getMessage
-
setMessage
-
isShowProgressInPercentage
public boolean isShowProgressInPercentage() -
setShowProgressInPercentage
public void setShowProgressInPercentage(boolean showProgressInPercentage) -
getTotal
-
setTotal
-
showProgress
-