Class JmixSideDialog
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasComponents,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasStyle,Serializable
- Direct Known Subclasses:
SideDialog
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classclassRepresents the footer section of the side dialog.classRepresents the header section of the side dialog. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JmixSideDialog.DrawerFooterprotected JmixSideDialog.DrawerHeader -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(Collection<com.vaadin.flow.component.Component> components) voidaddComponentAtIndex(int index, com.vaadin.flow.component.Component component) voidclose()Closes the dialog.com.vaadin.flow.dom.ClassListList<com.vaadin.flow.component.Component> @Nullable StringReturns the max-width of the dialog when horizontal position is configured (SideDialogPosition.LEFT,SideDialogPosition.RIGHT,SideDialogPosition.INLINE_STARTorSideDialogPosition.INLINE_END).@Nullable StringReturns the min-width of the dialog when horizontal position is configured (SideDialogPosition.LEFT,SideDialogPosition.RIGHT,SideDialogPosition.INLINE_STARTorSideDialogPosition.INLINE_END).@Nullable StringReturns the width of the dialog when horizontal position is configured (SideDialogPosition.LEFT,SideDialogPosition.RIGHT,SideDialogPosition.INLINE_STARTorSideDialogPosition.INLINE_END).com.vaadin.flow.component.ModalityModeReturns the modality mode of the dialog.@Nullable StringDeprecated, for removal: This API element is subject to removal in a future version.@Nullable StringgetRole()com.vaadin.flow.dom.StylegetStyle()@Nullable StringReturns the max-height of the dialog when vertical position is configured (SideDialogPosition.TOP,SideDialogPosition.BOTTOM).@Nullable StringReturns the min-height of the dialog when vertical position is configured (SideDialogPosition.TOP,SideDialogPosition.BOTTOM).@Nullable StringReturns the height of the dialog when vertical position is configured (SideDialogPosition.TOP,SideDialogPosition.BOTTOM).booleanbooleanbooleanbooleanisModal()Deprecated, for removal: This API element is subject to removal in a future version.UsegetModality()to check if the dialog is modalbooleanisOpened()voidopen()Opens the dialog.voidsetClassName(String className) voidsetCloseOnEsc(boolean closeOnEsc) Sets whether this dialog can be closed by hitting the ESC key or not.voidsetCloseOnOutsideClick(boolean closeOnOutsideClick) Sets whether this dialog can be closed by clicking outside it or not.voidsetFullscreenOnSmallDevices(boolean fullscreenOnSmallDevice) Sets whether the dialog should be displayed in fullscreen mode on small devices.voidsetHeaderTitle(@Nullable String title) Sets the title to be rendered on the dialog header.voidsetHorizontalMaxSize(@Nullable String maxSize) Sets the max-width of the dialog when horizontal position is configured (SideDialogPosition.LEFT,SideDialogPosition.RIGHT,SideDialogPosition.INLINE_STARTorSideDialogPosition.INLINE_END).voidsetHorizontalMinSize(@Nullable String minSize) Sets the min-width of the dialog when horizontal position is configured (SideDialogPosition.LEFT,SideDialogPosition.RIGHT,SideDialogPosition.INLINE_STARTorSideDialogPosition.INLINE_END).voidsetHorizontalSize(@Nullable String size) Sets the width of the dialog when horizontal position is configured (SideDialogPosition.LEFT,SideDialogPosition.RIGHT,SideDialogPosition.INLINE_STARTorSideDialogPosition.INLINE_END).voidsetModal(boolean modal) Deprecated, for removal: This API element is subject to removal in a future version.UsesetModality(ModalityMode)insteadvoidsetModality(com.vaadin.flow.component.ModalityMode mode) Sets the modality of the dialog.voidsetOverlayRole(String role) Deprecated, for removal: This API element is subject to removal in a future version.UsesetRole(String)insteadvoidSets the ARIA role for the dialog element, used by screen readers.voidsetSideDialogPosition(SideDialogPosition position) Sets the side dialog position.voidsetVerticalMaxSize(@Nullable String maxSize) Sets the max-height of the dialog when vertical position is configured (SideDialogPosition.TOP,SideDialogPosition.BOTTOM).voidsetVerticalMinSize(@Nullable String minSize) Sets the min-height of the dialog when vertical position is configured (SideDialogPosition.TOP,SideDialogPosition.BOTTOM).voidsetVerticalSize(@Nullable String size) Sets the height of the dialog when vertical position is configured (SideDialogPosition.TOP,SideDialogPosition.BOTTOM).voidsetVisible(boolean visible) Methods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElement, initContentMethods inherited from class com.vaadin.flow.component.Component
addListener, bindVisible, findAncestor, fireEvent, from, get, getEventBus, getId, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestIdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasComponents
add, add, addComponentAsFirst, bindChildren, getChildren, getComponentAt, getComponentCount, indexOf, remove, remove, removeAll, replaceMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
bindEnabled, isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, bindClassName, bindClassNames, getClassName, hasClassName, removeClassName, removeClassNames, setClassName
-
Field Details
-
header
-
-
Constructor Details
-
JmixSideDialog
public JmixSideDialog()
-
-
Method Details
-
add
- Specified by:
addin interfacecom.vaadin.flow.component.HasComponents
-
addComponentAtIndex
public void addComponentAtIndex(int index, com.vaadin.flow.component.Component component) - Specified by:
addComponentAtIndexin interfacecom.vaadin.flow.component.HasComponents
-
getContentComponents
- Returns:
- the content of the dialog
-
getHorizontalSize
Returns the width of the dialog when horizontal position is configured (SideDialogPosition.LEFT,SideDialogPosition.RIGHT,SideDialogPosition.INLINE_STARTorSideDialogPosition.INLINE_END).Note that this does not return the actual size of the dialog but the width which has been set using
setHorizontalSize(String).- Returns:
- the width of the dialog or
nullif the width is not set
-
setHorizontalSize
Sets the width of the dialog when horizontal position is configured (SideDialogPosition.LEFT,SideDialogPosition.RIGHT,SideDialogPosition.INLINE_STARTorSideDialogPosition.INLINE_END).The width should be in a format understood by the browser, e.g. "100px" or "2.5em".
The default width is taken from the theme variable
--jmix-side-dialog-horizontal-size. If it is not set, the default value isauto.- Parameters:
size- the width of the dialog ornullto remove the inline width from the style
-
getHorizontalMaxSize
Returns the max-width of the dialog when horizontal position is configured (SideDialogPosition.LEFT,SideDialogPosition.RIGHT,SideDialogPosition.INLINE_STARTorSideDialogPosition.INLINE_END).Note that this does not return the actual size of the dialog but the max-width which has been set using
setHorizontalMaxSize(String).- Returns:
- the max-width of the dialog or
nullif the width is not set
-
setHorizontalMaxSize
Sets the max-width of the dialog when horizontal position is configured (SideDialogPosition.LEFT,SideDialogPosition.RIGHT,SideDialogPosition.INLINE_STARTorSideDialogPosition.INLINE_END).The width should be in a format understood by the browser, e.g. "100px" or "2.5em".
The default max-width is taken from the theme variable
--jmix-side-dialog-horizontal-max-size. If it is not set, the default value is50%.- Parameters:
maxSize- the max-width of the dialog ornullto remove the inline max-width property from the style
-
getHorizontalMinSize
Returns the min-width of the dialog when horizontal position is configured (SideDialogPosition.LEFT,SideDialogPosition.RIGHT,SideDialogPosition.INLINE_STARTorSideDialogPosition.INLINE_END).Note that this does not return the actual size of the dialog but the min-width which has been set using
setHorizontalMinSize(String).- Returns:
- the min-width of the dialog or
nullif the min-width is not set
-
setHorizontalMinSize
Sets the min-width of the dialog when horizontal position is configured (SideDialogPosition.LEFT,SideDialogPosition.RIGHT,SideDialogPosition.INLINE_STARTorSideDialogPosition.INLINE_END).The min-width should be in a format understood by the browser, e.g. "100px" or "2.5em".
The default min-width is taken from the theme variable
--jmix-side-dialog-horizontal-min-size. If it is not set, the default value is16em.- Parameters:
minSize- the min-width of the dialog ornullto remove the inline min-width property from the style
-
getVerticalSize
Returns the height of the dialog when vertical position is configured (SideDialogPosition.TOP,SideDialogPosition.BOTTOM).Note that this does not return the actual size of the dialog but the height which has been set using
setVerticalSize(String).- Returns:
- the height of the dialog or
nullif the height is not set
-
setVerticalSize
Sets the height of the dialog when vertical position is configured (SideDialogPosition.TOP,SideDialogPosition.BOTTOM).The height should be in a format understood by the browser, e.g. "100px" or "2.5em".
The default height is taken from the theme variable
--jmix-side-dialog-vertical-size. If it is not set, the default value isauto.- Parameters:
size- the height of the dialog ornullto remove the inline height property from the style
-
getVerticalMaxSize
Returns the max-height of the dialog when vertical position is configured (SideDialogPosition.TOP,SideDialogPosition.BOTTOM).Note that this does not return the actual size of the side panel but the max-height which has been set using
setVerticalMaxSize(String).- Returns:
- the max-height of the dialog or
nullif the max-height is not set
-
setVerticalMaxSize
Sets the max-height of the dialog when vertical position is configured (SideDialogPosition.TOP,SideDialogPosition.BOTTOM).The max-height should be in a format understood by the browser, e.g. "100px" or "2.5em".
The default max-height is taken from the theme variable
--jmix-side-dialog-vertical-max-size. If it is not set, the default value is50vh.- Parameters:
maxSize- the max-height of the dialog ornullto remove the inline max-height property from style
-
getVerticalMinSize
Returns the min-height of the dialog when vertical position is configured (SideDialogPosition.TOP,SideDialogPosition.BOTTOM).Note that this does not return the actual size of the side panel but the min-height which has been set using
setVerticalMinSize(String).- Returns:
- the min-height of the dialog or
nullif the min-height is not set
-
setVerticalMinSize
Sets the min-height of the dialog when vertical position is configured (SideDialogPosition.TOP,SideDialogPosition.BOTTOM).The min-height should be in a format understood by the browser, e.g. "100px" or "2.5em".
The default min-height is taken from the theme variable
--jmix-side-dialog-vertical-min-size. If it is not set, the default value is16em.- Parameters:
minSize- the min-height of the dialog ornullto remove the inline min-height property from style
-
setClassName
- Specified by:
setClassNamein interfacecom.vaadin.flow.component.HasStyle
-
getClassNames
public com.vaadin.flow.dom.ClassList getClassNames()- Specified by:
getClassNamesin interfacecom.vaadin.flow.component.HasStyle
-
getStyle
public com.vaadin.flow.dom.Style getStyle()- Specified by:
getStylein interfacecom.vaadin.flow.component.HasStyle
-
isFullscreenOnSmallDevices
public boolean isFullscreenOnSmallDevices()- Returns:
trueif the dialog should be displayed in fullscreen mode on small devices
-
setFullscreenOnSmallDevices
public void setFullscreenOnSmallDevices(boolean fullscreenOnSmallDevice) Sets whether the dialog should be displayed in fullscreen mode on small devices.The default value is
true.- Parameters:
fullscreenOnSmallDevice- fullscreen option
-
getSideDialogPosition
- Returns:
- the side dialog position
-
setSideDialogPosition
Sets the side dialog position.The default value is
SideDialogPosition.RIGHT.- Parameters:
position- the side dialog position
-
isOpened
public boolean isOpened()- Returns:
trueif the dialog is opened,falseotherwise
-
open
public void open()Opens the dialog. -
close
public void close()Closes the dialog. -
isModal
Deprecated, for removal: This API element is subject to removal in a future version.UsegetModality()to check if the dialog is modal- Returns:
trueif the dialog is a modal dialog,falseotherwise
-
setModal
Deprecated, for removal: This API element is subject to removal in a future version.UsesetModality(ModalityMode)insteadSets whether a component will open a modal or modeless dialog.- Parameters:
modal- modal option
-
getModality
public com.vaadin.flow.component.ModalityMode getModality()Returns the modality mode of the dialog. The default value isModalityMode.VISUAL.- Returns:
- the modality mode
-
setModality
public void setModality(com.vaadin.flow.component.ModalityMode mode) Sets the modality of the dialog. The following modes are available:ModalityMode.STRICT: The dialog shows a modality curtain and users can not interact with components outside the dialog. Client-side events and RPC calls from components outside the dialog are blocked.ModalityMode.VISUAL: The dialog shows a modality curtain and users can not interact with components outside the dialog. However, client-side events and RPC calls from components outside the dialog are allowed.ModalityMode.MODELESS: The dialog does not show a modality curtain and users can interact with components outside the dialog. Client-side events and RPC calls from components outside the dialog are allowed.
Note: When dialog is set to be
ModalityMode.MODELESS, then it's up to you to provide means for it to be closed (e.g. a button that callsDialog.close()). The reason being that a modeless dialog allows user to interact with the interface under it and won't be closed by clicking outside or the ESC key.- Parameters:
mode- the modality mode, not null
-
isCloseOnEsc
public boolean isCloseOnEsc()- Returns:
trueif the dialog should be closed when hitting the ESC key
-
setCloseOnEsc
public void setCloseOnEsc(boolean closeOnEsc) Sets whether this dialog can be closed by hitting the ESC key or not.The default value is
true.- Parameters:
closeOnEsc- closeOnEsc option
-
isCloseOnOutsideClick
public boolean isCloseOnOutsideClick()- Returns:
trueif the dialog should be closed when clicking outside it
-
setCloseOnOutsideClick
public void setCloseOnOutsideClick(boolean closeOnOutsideClick) Sets whether this dialog can be closed by clicking outside it or not.The default value is
true.- Parameters:
closeOnOutsideClick- closeOnOutsideClick option
-
getHeaderTitle
- Returns:
- the title to be rendered on the dialog header or empty string if not set
-
setHeaderTitle
Sets the title to be rendered on the dialog header.- Parameters:
title- the title to set ornullto remove the header title
-
getOverlayRole
Deprecated, for removal: This API element is subject to removal in a future version.UsegetRole()instead- Returns:
- the ARIA role for the overlay element or
nullif not set
-
setOverlayRole
Deprecated, for removal: This API element is subject to removal in a future version.UsesetRole(String)insteadSets the ARIA role for the overlay element, used by screen readers.- Parameters:
role- the ARIA role to set
-
getRole
- Returns:
- the ARIA role for the dialog element or
nullif not set
-
setRole
Sets the ARIA role for the dialog element, used by screen readers.- Parameters:
role- the ARIA role to set
-
setVisible
public void setVisible(boolean visible) - Overrides:
setVisiblein classcom.vaadin.flow.component.Component
-
getHeader
- Returns:
- the header of the dialog
-
getRole()instead