Package io.jmix.flowui.view
Class DialogWindow<V extends View<?>>
java.lang.Object
io.jmix.flowui.view.DialogWindow<V>
- All Implemented Interfaces:
com.vaadin.flow.component.HasElement
,com.vaadin.flow.component.HasSize
,com.vaadin.flow.component.HasStyle
,com.vaadin.flow.component.HasTheme
,Serializable
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.ApplicationContextAware
public class DialogWindow<V extends View<?>>
extends Object
implements com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasTheme, com.vaadin.flow.component.HasStyle, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
DialogWindow.AfterCloseEvent<V extends View<?>>
static class
DialogWindow.AfterOpenEvent<V extends View<?>>
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.Registration
addAfterCloseListener
(Consumer<DialogWindow.AfterCloseEvent<V>> listener) AddsDialogWindow.AfterCloseEvent
listener.com.vaadin.flow.shared.Registration
addAfterOpenListener
(Consumer<DialogWindow.AfterOpenEvent<V>> listener) AddsDialogWindow.AfterOpenEvent
listener.void
addClassName
(String className) void
addClassNames
(String... classNames) void
addThemeName
(String themeName) void
addThemeNames
(String... themeNames) void
protected void
applyDialogModeSettings
(V view) void
close()
Requests closing the dialog.void
close
(boolean force) Requests closing the dialog.protected void
protected com.vaadin.flow.component.dialog.Dialog
protected com.vaadin.flow.component.button.Button
protected com.vaadin.flow.component.Component
createViewWrapper
(V view) protected void
fireViewBeforeShowEvent
(View<?> view) protected void
fireViewReadyEvent
(View<?> view) com.vaadin.flow.dom.ClassList
com.vaadin.flow.dom.Element
protected EventHub
Optional<com.vaadin.flow.component.Unit>
com.vaadin.flow.dom.Style
getStyle()
com.vaadin.flow.dom.ThemeList
getView()
getWidth()
Optional<com.vaadin.flow.component.Unit>
boolean
hasClassName
(String className) boolean
hasThemeName
(String themeName) protected void
initDialog
(com.vaadin.flow.component.dialog.Dialog dialog) protected void
boolean
boolean
boolean
Sets whether dialog is enabled to be dragged by the user or not.boolean
isModal()
boolean
protected Messages
messages()
protected void
onCloseButtonClicked
(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button> event) protected void
onDialogCloseAction
(com.vaadin.flow.component.dialog.Dialog.DialogCloseActionEvent event) protected void
onDialogOpenedChanged
(com.vaadin.flow.component.dialog.GeneratedVaadinDialog.OpenedChangeEvent<com.vaadin.flow.component.dialog.Dialog> openedChangeEvent) protected void
onViewAfterClosed
(View.AfterCloseEvent closeEvent) void
open()
Opens the dialog.protected void
postInitDialog
(com.vaadin.flow.component.dialog.Dialog dialog) protected <E> void
boolean
removeClassName
(String className) void
removeClassNames
(String... classNames) boolean
removeThemeName
(String themeName) void
removeThemeNames
(String... themeNames) void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) void
setClassName
(String className) void
setClassName
(String className, boolean set) void
setCloseOnEsc
(boolean closeOnEsc) Sets whether this dialog can be closed by hitting the esc-key or not.void
setCloseOnOutsideClick
(boolean closeOnOutsideClick) Sets whether this dialog can be closed by clicking outside of it or not.void
setDraggable
(boolean draggable) void
setHeight
(float height, com.vaadin.flow.component.Unit unit) void
void
void
setMaxHeight
(float maxHeight, com.vaadin.flow.component.Unit unit) void
setMaxHeight
(String maxHeight) void
setMaxWidth
(float maxWidth, com.vaadin.flow.component.Unit unit) void
setMaxWidth
(String maxWidth) void
setMinHeight
(float minHeight, com.vaadin.flow.component.Unit unit) void
setMinHeight
(String minHeight) void
setMinWidth
(float minWidth, com.vaadin.flow.component.Unit unit) void
setMinWidth
(String minWidth) void
setModal
(boolean modal) Sets whether component will open modal or modeless dialog.void
setResizable
(boolean resizable) Sets whether dialog can be resized by user or not.void
void
void
setThemeName
(String themeName) void
setThemeName
(String themeName, boolean set) protected void
setValueIfPresent
(String value, Consumer<String> setter) void
setWidth
(float width, com.vaadin.flow.component.Unit unit) void
void
protected UiComponents
-
Field Details
-
BASE_CLASS_NAME
- See Also:
-
dialog
protected com.vaadin.flow.component.dialog.Dialog dialog -
view
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext
-
-
Constructor Details
-
DialogWindow
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
initView
-
createDialog
protected com.vaadin.flow.component.dialog.Dialog createDialog() -
initDialog
protected void initDialog(com.vaadin.flow.component.dialog.Dialog dialog) -
postInitDialog
protected void postInitDialog(com.vaadin.flow.component.dialog.Dialog dialog) -
applyDialogModeSettings
-
setValueIfPresent
-
createHeaderCloseButton
protected com.vaadin.flow.component.button.Button createHeaderCloseButton() -
onCloseButtonClicked
protected void onCloseButtonClicked(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button> event) -
createViewWrapper
-
getEventHub
-
publish
-
getView
- Returns:
- a view witch is opened in this dialog window
-
open
public void open()Opens the dialog. -
close
public void close()Requests closing the dialog. -
close
public void close(boolean force) Requests closing the dialog.- Parameters:
force
-true
to close the dialog without checking the state (e.g. unsaved changes),false
otherwise.
-
closeInternal
protected void closeInternal() -
onDialogOpenedChanged
protected void onDialogOpenedChanged(com.vaadin.flow.component.dialog.GeneratedVaadinDialog.OpenedChangeEvent<com.vaadin.flow.component.dialog.Dialog> openedChangeEvent) -
onViewAfterClosed
-
fireViewBeforeShowEvent
-
fireViewReadyEvent
-
onDialogCloseAction
protected void onDialogCloseAction(com.vaadin.flow.component.dialog.Dialog.DialogCloseActionEvent event) -
addAfterOpenListener
public com.vaadin.flow.shared.Registration addAfterOpenListener(Consumer<DialogWindow.AfterOpenEvent<V>> listener) AddsDialogWindow.AfterOpenEvent
listener.- Parameters:
listener
- the listener to add- Returns:
- a Registration for removing the event listener
-
addAfterCloseListener
public com.vaadin.flow.shared.Registration addAfterCloseListener(Consumer<DialogWindow.AfterCloseEvent<V>> listener) AddsDialogWindow.AfterCloseEvent
listener.- Parameters:
listener
- the listener to add- Returns:
- a Registration for removing the event listener
-
getElement
public com.vaadin.flow.dom.Element getElement()- Specified by:
getElement
in interfacecom.vaadin.flow.component.HasElement
-
isCloseOnEsc
public boolean isCloseOnEsc()- Returns:
- whether this dialog can be closed by hitting the esc-key or not.
-
setCloseOnEsc
public void setCloseOnEsc(boolean closeOnEsc) Sets whether this dialog can be closed by hitting the esc-key or not.- Parameters:
closeOnEsc
-true
to enable closing this dialog with the esc-key,false
to disable it
-
isCloseOnOutsideClick
public boolean isCloseOnOutsideClick()- Returns:
- whether this dialog can be closed by clicking outside of it or not.
-
setCloseOnOutsideClick
public void setCloseOnOutsideClick(boolean closeOnOutsideClick) Sets whether this dialog can be closed by clicking outside of it or not.- Parameters:
closeOnOutsideClick
-true
to enable closing this dialog with an outside click,false
to disable it
-
isModal
public boolean isModal()- Returns:
- whether component is set as modal or modeless dialog.
-
setModal
public void setModal(boolean modal) Sets whether component will open modal or modeless dialog.- Parameters:
modal
-false
to enable dialog to open as modeless modal,true
otherwise
-
isDraggable
public boolean isDraggable()Sets whether dialog is enabled to be dragged by the user or not.- Returns:
- whether dialog is enabled to be dragged or not.
-
setDraggable
public void setDraggable(boolean draggable) - Parameters:
draggable
-true
to enable dragging of the dialog,false
otherwise
-
isResizable
public boolean isResizable()- Returns:
- whether dialog is enabled to be resized or not.
-
setResizable
public void setResizable(boolean resizable) Sets whether dialog can be resized by user or not.- Parameters:
resizable
-true
to enabled resizing of the dialog,false
otherwise.
-
setWidth
- Specified by:
setWidth
in interfacecom.vaadin.flow.component.HasSize
-
setWidth
public void setWidth(float width, com.vaadin.flow.component.Unit unit) - Specified by:
setWidth
in interfacecom.vaadin.flow.component.HasSize
-
setMinWidth
- Specified by:
setMinWidth
in interfacecom.vaadin.flow.component.HasSize
-
setMinWidth
public void setMinWidth(float minWidth, com.vaadin.flow.component.Unit unit) - Specified by:
setMinWidth
in interfacecom.vaadin.flow.component.HasSize
-
setMaxWidth
- Specified by:
setMaxWidth
in interfacecom.vaadin.flow.component.HasSize
-
setMaxWidth
public void setMaxWidth(float maxWidth, com.vaadin.flow.component.Unit unit) - Specified by:
setMaxWidth
in interfacecom.vaadin.flow.component.HasSize
-
getWidth
- Specified by:
getWidth
in interfacecom.vaadin.flow.component.HasSize
-
getMinWidth
- Specified by:
getMinWidth
in interfacecom.vaadin.flow.component.HasSize
-
getMaxWidth
- Specified by:
getMaxWidth
in interfacecom.vaadin.flow.component.HasSize
-
getWidthUnit
- Specified by:
getWidthUnit
in interfacecom.vaadin.flow.component.HasSize
-
setHeight
- Specified by:
setHeight
in interfacecom.vaadin.flow.component.HasSize
-
setHeight
public void setHeight(float height, com.vaadin.flow.component.Unit unit) - Specified by:
setHeight
in interfacecom.vaadin.flow.component.HasSize
-
setMinHeight
- Specified by:
setMinHeight
in interfacecom.vaadin.flow.component.HasSize
-
setMinHeight
public void setMinHeight(float minHeight, com.vaadin.flow.component.Unit unit) - Specified by:
setMinHeight
in interfacecom.vaadin.flow.component.HasSize
-
setMaxHeight
- Specified by:
setMaxHeight
in interfacecom.vaadin.flow.component.HasSize
-
setMaxHeight
public void setMaxHeight(float maxHeight, com.vaadin.flow.component.Unit unit) - Specified by:
setMaxHeight
in interfacecom.vaadin.flow.component.HasSize
-
getHeight
- Specified by:
getHeight
in interfacecom.vaadin.flow.component.HasSize
-
getMinHeight
- Specified by:
getMinHeight
in interfacecom.vaadin.flow.component.HasSize
-
getMaxHeight
- Specified by:
getMaxHeight
in interfacecom.vaadin.flow.component.HasSize
-
getHeightUnit
- Specified by:
getHeightUnit
in interfacecom.vaadin.flow.component.HasSize
-
setSizeFull
public void setSizeFull()- Specified by:
setSizeFull
in interfacecom.vaadin.flow.component.HasSize
-
setWidthFull
public void setWidthFull()- Specified by:
setWidthFull
in interfacecom.vaadin.flow.component.HasSize
-
setHeightFull
public void setHeightFull()- Specified by:
setHeightFull
in interfacecom.vaadin.flow.component.HasSize
-
setSizeUndefined
public void setSizeUndefined()- Specified by:
setSizeUndefined
in interfacecom.vaadin.flow.component.HasSize
-
addThemeName
- Specified by:
addThemeName
in interfacecom.vaadin.flow.component.HasTheme
-
removeThemeName
- Specified by:
removeThemeName
in interfacecom.vaadin.flow.component.HasTheme
-
setThemeName
- Specified by:
setThemeName
in interfacecom.vaadin.flow.component.HasTheme
-
getThemeName
- Specified by:
getThemeName
in interfacecom.vaadin.flow.component.HasTheme
-
getThemeNames
public com.vaadin.flow.dom.ThemeList getThemeNames()- Specified by:
getThemeNames
in interfacecom.vaadin.flow.component.HasTheme
-
setThemeName
- Specified by:
setThemeName
in interfacecom.vaadin.flow.component.HasTheme
-
hasThemeName
- Specified by:
hasThemeName
in interfacecom.vaadin.flow.component.HasTheme
-
addThemeNames
- Specified by:
addThemeNames
in interfacecom.vaadin.flow.component.HasTheme
-
removeThemeNames
- Specified by:
removeThemeNames
in interfacecom.vaadin.flow.component.HasTheme
-
addClassName
- Specified by:
addClassName
in interfacecom.vaadin.flow.component.HasStyle
-
removeClassName
- Specified by:
removeClassName
in interfacecom.vaadin.flow.component.HasStyle
-
setClassName
- Specified by:
setClassName
in interfacecom.vaadin.flow.component.HasStyle
-
getClassName
- Specified by:
getClassName
in interfacecom.vaadin.flow.component.HasStyle
-
getClassNames
public com.vaadin.flow.dom.ClassList getClassNames()- Specified by:
getClassNames
in interfacecom.vaadin.flow.component.HasStyle
-
setClassName
- Specified by:
setClassName
in interfacecom.vaadin.flow.component.HasStyle
-
hasClassName
- Specified by:
hasClassName
in interfacecom.vaadin.flow.component.HasStyle
-
getStyle
public com.vaadin.flow.dom.Style getStyle()- Specified by:
getStyle
in interfacecom.vaadin.flow.component.HasStyle
-
addClassNames
- Specified by:
addClassNames
in interfacecom.vaadin.flow.component.HasStyle
-
removeClassNames
- Specified by:
removeClassNames
in interfacecom.vaadin.flow.component.HasStyle
-
messages
-
uiComponents
-