Package io.jmix.flowui.impl
Class DialogsImpl.BackgroundTaskDialogBuilderImpl<T extends Number,V>
java.lang.Object
io.jmix.flowui.impl.DialogsImpl.BackgroundTaskDialogBuilderImpl<T,V>
- All Implemented Interfaces:
Dialogs.BackgroundTaskDialogBuilder<T,
,V> Dialogs.Draggable<Dialogs.BackgroundTaskDialogBuilder<T,
,V>> Dialogs.HasHeader<Dialogs.BackgroundTaskDialogBuilder<T,
,V>> Dialogs.HasStyle<Dialogs.BackgroundTaskDialogBuilder<T,
,V>> Dialogs.HasText<Dialogs.BackgroundTaskDialogBuilder<T,
,V>> Dialogs.HasTheme<Dialogs.BackgroundTaskDialogBuilder<T,
,V>> Dialogs.Resizable<Dialogs.BackgroundTaskDialogBuilder<T,
V>>
- Enclosing class:
- DialogsImpl
public class DialogsImpl.BackgroundTaskDialogBuilderImpl<T extends Number,V>
extends Object
implements Dialogs.BackgroundTaskDialogBuilder<T,V>
-
Field Summary
Modifier and TypeFieldDescriptionprotected BackgroundTask<T,
V> protected boolean
protected com.vaadin.flow.component.button.Button
protected com.vaadin.flow.component.dialog.Dialog
protected com.vaadin.flow.component.html.Span
protected String
protected com.vaadin.flow.component.progressbar.ProgressBar
protected com.vaadin.flow.component.html.Span
protected boolean
protected BackgroundTaskHandler<V>
protected Number
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected com.vaadin.flow.component.dialog.Dialog
Gets the CSS class names for this component.getText()
Gets the theme names for this component.getTotal()
protected void
protected void
initDialog
(com.vaadin.flow.component.dialog.Dialog dialog) protected void
initDialogContent
(com.vaadin.flow.component.dialog.Dialog dialog) boolean
boolean
protected boolean
boolean
boolean
protected void
onCancelButtonClick
(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button> event) void
open()
Opens the dialog.protected void
protected void
updateProgress
(Number processedValue) withCancelAllowed
(boolean cancelAllowed) Determines whether the dialog can be closed.withClassName
(String className) Sets the CSS class names of this component.withDraggable
(boolean draggable) Sets whether dialog is enabled to be dragged by the user or not.withHeader
(String header) Sets a header text.withMaxHeight
(String maxHeight) Sets a dialog max height.withMaxWidth
(String maxWidth) Sets a dialog max width.withMinHeight
(String minHeight) Sets a dialog min height.withMinWidth
(String minWidth) Sets a dialog min width.withResizable
(boolean resizable) Sets whether dialog can be resized by user or not.withShowProgressInPercentage
(boolean percentProgress) Sets whether progress should be represented as percentage (rather than as raw number).Sets a text.withThemeName
(String themeName) Sets the theme names of the dialog.Sets amount of items to be processed by background task.
-
Field Details
-
dialog
protected com.vaadin.flow.component.dialog.Dialog dialog -
messageSpan
protected com.vaadin.flow.component.html.Span messageSpan -
progressTextSpan
protected com.vaadin.flow.component.html.Span progressTextSpan -
progressBar
protected com.vaadin.flow.component.progressbar.ProgressBar progressBar -
cancelButton
protected com.vaadin.flow.component.button.Button cancelButton -
backgroundTask
-
messageText
-
total
-
showProgressInPercentage
protected boolean showProgressInPercentage -
cancelAllowed
protected boolean cancelAllowed -
taskHandler
-
-
Constructor Details
-
BackgroundTaskDialogBuilderImpl
-
-
Method Details
-
createDialog
protected com.vaadin.flow.component.dialog.Dialog createDialog() -
initDialog
protected void initDialog(com.vaadin.flow.component.dialog.Dialog dialog) -
initDialogContent
protected void initDialogContent(com.vaadin.flow.component.dialog.Dialog dialog) -
withCancelAllowed
Description copied from interface:Dialogs.BackgroundTaskDialogBuilder
Determines whether the dialog can be closed.The default value is
false
.- Specified by:
withCancelAllowed
in interfaceDialogs.BackgroundTaskDialogBuilder<T extends Number,
V> - Parameters:
cancelAllowed
-true
if dialog is closeable- Returns:
- builder
-
isCancelAllowed
public boolean isCancelAllowed()- Specified by:
isCancelAllowed
in interfaceDialogs.BackgroundTaskDialogBuilder<T extends Number,
V> - Returns:
true
if the dialog can be closed
-
withTotal
Description copied from interface:Dialogs.BackgroundTaskDialogBuilder
Sets amount of items to be processed by background task.
UseTaskLifeCycle.publish(Object[])
to notify the dialog about progress completion.- Specified by:
withTotal
in interfaceDialogs.BackgroundTaskDialogBuilder<T extends Number,
V> - Parameters:
total
- amount of items to be processed by background task,- Returns:
- builder
-
getTotal
- Specified by:
getTotal
in interfaceDialogs.BackgroundTaskDialogBuilder<T extends Number,
V> - Returns:
- amount of items to be processed by background task
-
withShowProgressInPercentage
public Dialogs.BackgroundTaskDialogBuilder<T,V> withShowProgressInPercentage(boolean percentProgress) Description copied from interface:Dialogs.BackgroundTaskDialogBuilder
Sets whether progress should be represented as percentage (rather than as raw number).- Specified by:
withShowProgressInPercentage
in interfaceDialogs.BackgroundTaskDialogBuilder<T extends Number,
V> - Parameters:
percentProgress
-true
to show progress in percents- Returns:
- builder
-
isShowProgressInPercentage
public boolean isShowProgressInPercentage()- Specified by:
isShowProgressInPercentage
in interfaceDialogs.BackgroundTaskDialogBuilder<T extends Number,
V> - Returns:
true
if progress should is shown in percents
-
withHeader
Description copied from interface:Dialogs.HasHeader
Sets a header text.- Specified by:
withHeader
in interfaceDialogs.HasHeader<T extends Number>
- Parameters:
header
- header text- Returns:
- builder
-
getHeader
- Specified by:
getHeader
in interfaceDialogs.HasHeader<T extends Number>
- Returns:
- header text
-
withText
Description copied from interface:Dialogs.HasText
Sets a text.- Specified by:
withText
in interfaceDialogs.HasText<T extends Number>
- Parameters:
text
- a text- Returns:
- builder
-
getText
- Specified by:
getText
in interfaceDialogs.HasText<T extends Number>
- Returns:
- a text
-
withThemeName
Description copied from interface:Dialogs.HasTheme
Sets the theme names of the dialog. This method overwrites any previous set theme names.- Specified by:
withThemeName
in interfaceDialogs.HasTheme<T extends Number>
- Parameters:
themeName
- a space-separated string of theme names to set, or empty string to remove all theme names- Returns:
- builder
-
getThemeName
Description copied from interface:Dialogs.HasTheme
Gets the theme names for this component.- Specified by:
getThemeName
in interfaceDialogs.HasTheme<T extends Number>
- Returns:
- a space-separated string of theme names, empty string if there are no theme names
or
null
if attribute (theme) is not set at all
-
withClassName
Description copied from interface:Dialogs.HasStyle
Sets the CSS class names of this component. This method overwrites any previous set class names.- Specified by:
withClassName
in interfaceDialogs.HasStyle<T extends Number>
- Parameters:
className
- a space-separated string of class names to set, ornull
to remove all class names
-
getClassName
Description copied from interface:Dialogs.HasStyle
Gets the CSS class names for this component.- Specified by:
getClassName
in interfaceDialogs.HasStyle<T extends Number>
- Returns:
- a space-separated string of class names, or
null
if there are no class names
-
withDraggable
Description copied from interface:Dialogs.Draggable
Sets whether dialog is enabled to be dragged by the user or not.- Specified by:
withDraggable
in interfaceDialogs.Draggable<T extends Number>
- Parameters:
draggable
-true
to enable dragging of the dialog,false
otherwise- Returns:
- builder
-
isDraggable
public boolean isDraggable()- Specified by:
isDraggable
in interfaceDialogs.Draggable<T extends Number>
- Returns:
true
if dragging is enabled,false
otherwise
-
withResizable
Description copied from interface:Dialogs.Resizable
Sets whether dialog can be resized by user or not.By default, the dialog is not resizable.
- Specified by:
withResizable
in interfaceDialogs.Resizable<T extends Number>
- Parameters:
resizable
-true
to enabled resizing of the dialog,false
otherwise.- Returns:
- builder
-
isResizable
public boolean isResizable()- Specified by:
isResizable
in interfaceDialogs.Resizable<T extends Number>
- Returns:
true
if resizing is enabled,false
otherwise
-
withMinWidth
Description copied from interface:Dialogs.Resizable
Sets a dialog min width.- Specified by:
withMinWidth
in interfaceDialogs.Resizable<T extends Number>
- Parameters:
minWidth
- a dialog min width- Returns:
- builder
-
getMinWidth
- Specified by:
getMinWidth
in interfaceDialogs.Resizable<T extends Number>
- Returns:
- dialog min width value
-
withMinHeight
Description copied from interface:Dialogs.Resizable
Sets a dialog min height.- Specified by:
withMinHeight
in interfaceDialogs.Resizable<T extends Number>
- Parameters:
minHeight
- a dialog min height- Returns:
- builder
-
getMinHeight
- Specified by:
getMinHeight
in interfaceDialogs.Resizable<T extends Number>
- Returns:
- dialog min height value
-
withMaxWidth
Description copied from interface:Dialogs.Resizable
Sets a dialog max width.- Specified by:
withMaxWidth
in interfaceDialogs.Resizable<T extends Number>
- Parameters:
maxWidth
- a dialog max width- Returns:
- builder
-
getMaxWidth
- Specified by:
getMaxWidth
in interfaceDialogs.Resizable<T extends Number>
- Returns:
- dialog max width value
-
withMaxHeight
Description copied from interface:Dialogs.Resizable
Sets a dialog max height.- Specified by:
withMaxHeight
in interfaceDialogs.Resizable<T extends Number>
- Parameters:
maxHeight
- a dialog max height- Returns:
- builder
-
getMaxHeight
- Specified by:
getMaxHeight
in interfaceDialogs.Resizable<T extends Number>
- Returns:
- dialog max height value
-
open
public void open()Description copied from interface:Dialogs.BackgroundTaskDialogBuilder
Opens the dialog.- Specified by:
open
in interfaceDialogs.BackgroundTaskDialogBuilder<T extends Number,
V>
-
isIndeterminateMode
protected boolean isIndeterminateMode() -
startExecution
protected void startExecution() -
updateProgress
-
onCancelButtonClick
protected void onCancelButtonClick(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button> event) -
handleTaskWrapperCloseView
-