T
- measure unit which shows progress of taskV
- result typepublic class BackgroundWorkProgressWindow<T extends java.lang.Number,V> extends AbstractWindow
On error:
io.jmix.ui.screen.Screen.AfterCloseEvent, io.jmix.ui.screen.Screen.AfterDetachEvent, io.jmix.ui.screen.Screen.AfterInitEvent, io.jmix.ui.screen.Screen.AfterShowEvent, io.jmix.ui.screen.Screen.BeforeCloseEvent, io.jmix.ui.screen.Screen.BeforeShowEvent, io.jmix.ui.screen.Screen.InitEvent
Window.BeforeCloseWithCloseButtonEvent, Window.BeforeCloseWithShortcutEvent, Window.CloseListener, Window.CloseWithCommitListener, Window.Editor<T>, Window.HasFoldersPane, Window.Lookup<T>, Window.TopLevelWindow, Window.Wrapper
io.jmix.ui.component.Window.BeforeCloseEvent, io.jmix.ui.component.Window.CloseOrigin, io.jmix.ui.component.Window.Committable, io.jmix.ui.component.Window.ContentSwitchMode, io.jmix.ui.component.Window.HasUserIndicator, io.jmix.ui.component.Window.HasWorkArea
Frame.MessageMode, Frame.MessageType, Frame.NotificationType
Modifier and Type | Field and Description |
---|---|
protected io.jmix.ui.executor.BackgroundWorker |
backgroundWorker |
protected boolean |
cancelAllowed |
protected io.jmix.ui.component.Button |
cancelButton |
protected io.jmix.core.Messages |
messages |
protected boolean |
percentProgress |
protected Label<java.lang.String> |
progressText |
protected io.jmix.ui.executor.BackgroundTaskHandler<V> |
taskHandler |
protected io.jmix.ui.component.ProgressBar |
taskProgressBar |
protected Label<java.lang.String> |
text |
protected T |
totalProgress |
frame, messageTools, UNKNOWN_CLOSE_ACTION_ID
Constructor and Description |
---|
BackgroundWorkProgressWindow() |
Modifier and Type | Method and Description |
---|---|
void |
cancel() |
void |
init(java.util.Map<java.lang.String,java.lang.Object> params)
Called by the framework after creation of all components and before showing the screen.
|
protected boolean |
preClose(java.lang.String actionId)
Hook to be implemented in subclasses.
|
static <T extends java.lang.Number,V> |
show(io.jmix.ui.executor.BackgroundTask<T,V> task,
java.lang.Number total)
Show modal window with default title and message which will last until task completes.
|
static <T extends java.lang.Number,V> |
show(io.jmix.ui.executor.BackgroundTask<T,V> task,
java.lang.Number total,
boolean cancelAllowed)
Show modal window with default title and message which will last until task completes.
|
static <T extends java.lang.Number,V> |
show(io.jmix.ui.executor.BackgroundTask<T,V> task,
java.lang.String title,
java.lang.String message,
java.lang.Number total)
Show modal window with message which will last until task completes.
|
static <T extends java.lang.Number,V> |
show(io.jmix.ui.executor.BackgroundTask<T,V> task,
java.lang.String title,
java.lang.String message,
java.lang.Number total,
boolean cancelAllowed)
Show modal window with message which will last until task completes.
|
static <T extends java.lang.Number,V> |
show(io.jmix.ui.executor.BackgroundTask<T,V> task,
java.lang.String title,
java.lang.String message,
java.lang.Number total,
boolean cancelAllowed,
boolean percentProgress)
Show modal window with message which will last until task completes.
|
protected void |
showProgress(java.lang.Number processedValue) |
add, add, addAction, addAction, addBeforeWindowCloseListener, addFacet, addStyleName, afterShow, applyDataLoadingSettings, applySettings, beforeClose, closeWithDiscard, deleteSettings, expand, expand, formatMessage, getAction, getActions, getActionsPermissions, getAlignment, getCaption, getCompanion, getComponent, getComponent, getComponent, getComponents, getComposition, getContentSwitchMode, getContext, getDescription, getDialogOptions, getDsContext, getExpandDirection, getExpandRatio, getFacet, getFacets, getFocusComponent, getFrame, getFrameOwner, getHeight, getHeightSizeUnit, getIcon, getMargin, getMaxHeight, getMaxWidth, getMessage, getMessagesPack, getMinHeight, getMinWidth, getOwnComponent, getOwnComponents, getOwnComponentsStream, getParent, getScreenHashCode, getSettings, getSpacing, getStyleName, getWidth, getWidthSizeUnit, getWindowManager, getWrappedFrame, getWrappedWindow, getXmlDescriptor, handleValidationErrors, hasUnsavedChanges, indexOf, init, initEnableEditingActionStub, isAttributeAccessControlEnabled, isCloseable, isEnabled, isEnabledRecursive, isExpanded, isResponsive, isSameScreen, isValid, isVisible, isVisibleRecursive, onAfterDetach, postValidate, ready, remove, removeAction, removeAction, removeAll, removeAllActions, removeBeforeWindowCloseListener, removeFacet, removeStyleName, resetExpanded, saveSettings, setAlignment, setCaption, setCloseable, setCompanion, setContentSwitchMode, setDescription, setDsContext, setEnabled, setExpandRatio, setFocusComponent, setFrame, setHeight, setIcon, setIconFromSet, setId, setMargin, setMaxHeight, setMaxWidth, setMessagesPack, setMinHeight, setMinWidth, setParent, setResponsive, setSpacing, setStyleName, setVisible, setWidth, setWindow, setXmlDescriptor, showValidationErrors, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, validate, validate, validateAdditionalRules, validateAll, withUnwrapped, withUnwrappedComposition
addAfterCloseListener, addAfterDetachListener, addAfterInitListener, addAfterShowListener, addBeforeCloseListener, addBeforeShowListener, addInitListener, addUrlParamsChangeListener, close, close, closeWithDefaultAction, fireEvent, getApplicationContext, getEventHub, getExtensions, getId, getScreenData, getUiEventListeners, getWindow, isMultipleOpen, setApplicationContext, setExtensions, setScreenData, setUiEventListeners, show
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addBeforeCloseWithCloseButtonListener, addBeforeCloseWithShortcutListener, addCloseListener, addCloseWithCommitListener, addListener, close, close, removeBeforeCloseWithCloseButtonListener, removeBeforeCloseWithShortcutListener, removeCloseListener, removeListener
focusFirstComponent, getComponentNN
openEditor, openEditor, openEditor, openEditor, openEditor, openEditor, openEditor, openFrame, openFrame, openLookup, openLookup, openLookup, openLookup, openWindow, openWindow, showMessageDialog, showNotification, showNotification, showNotification, showOptionDialog, showOptionDialog, showWebPage
@Autowired protected Label<java.lang.String> text
@Autowired protected Label<java.lang.String> progressText
@Autowired protected io.jmix.ui.component.Button cancelButton
@Autowired protected io.jmix.ui.component.ProgressBar taskProgressBar
@Autowired protected io.jmix.ui.executor.BackgroundWorker backgroundWorker
@Autowired protected io.jmix.core.Messages messages
protected io.jmix.ui.executor.BackgroundTaskHandler<V> taskHandler
protected boolean cancelAllowed
protected T extends java.lang.Number totalProgress
protected boolean percentProgress
public static <T extends java.lang.Number,V> void show(io.jmix.ui.executor.BackgroundTask<T,V> task, @Nullable java.lang.String title, @Nullable java.lang.String message, java.lang.Number total, boolean cancelAllowed, boolean percentProgress)
V
- task result typetask
- background task containing long operationtitle
- window title, optionalmessage
- window message, optionaltotal
- total number of items, that will be processedcancelAllowed
- show or not cancel buttonpercentProgress
- show progress in percentspublic static <T extends java.lang.Number,V> void show(io.jmix.ui.executor.BackgroundTask<T,V> task, @Nullable java.lang.String title, @Nullable java.lang.String message, java.lang.Number total, boolean cancelAllowed)
V
- task result typetask
- background task containing long operationtitle
- window title, optionalmessage
- window message, optionaltotal
- total number of items, that will be processedcancelAllowed
- show or not cancel buttonpublic static <T extends java.lang.Number,V> void show(io.jmix.ui.executor.BackgroundTask<T,V> task, java.lang.String title, java.lang.String message, java.lang.Number total)
V
- task result typetask
- background task containing long operationtitle
- window title, optionalmessage
- window message, optionaltotal
- total number of items, that will be processedpublic static <T extends java.lang.Number,V> void show(io.jmix.ui.executor.BackgroundTask<T,V> task, java.lang.Number total, boolean cancelAllowed)
V
- task result typetask
- background task containing long operationtotal
- total number of items, that will be processedcancelAllowed
- show or not cancel buttonpublic static <T extends java.lang.Number,V> void show(io.jmix.ui.executor.BackgroundTask<T,V> task, java.lang.Number total)
V
- task result typetask
- background task containing long operationtotal
- total number of items, that will be processedpublic void init(java.util.Map<java.lang.String,java.lang.Object> params)
AbstractWindow
init
in class AbstractWindow
params
- parameters passed from caller's code, usually from
HasWindowManager.openWindow(String, WindowManager.OpenType)
and similar methods, or set in
screens.xml
for this registered screenpublic void cancel()
protected boolean preClose(java.lang.String actionId)
AbstractWindow
preClose
in class AbstractWindow
actionId
- a string that is passed to one of Screen.close(io.jmix.ui.screen.CloseAction)
methods by calling code to identify itself.
Can be an Action
ID, or a constant like Window.COMMIT_ACTION_ID
or
Window.CLOSE_ACTION_ID
.protected void showProgress(java.lang.Number processedValue)