Class JmixSidePanelLayout
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,Serializable
- Direct Known Subclasses:
SidePanelLayout
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.vaadin.flow.component.Componentprotected com.vaadin.flow.component.Component -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddComponent(com.vaadin.flow.component.Component... components) com.vaadin.flow.shared.RegistrationaddModalityCurtainClickListener(com.vaadin.flow.component.ComponentEventListener<ModalityCurtainClickEvent> listener) Adds a listener to handle modality curtain clicks.com.vaadin.flow.shared.RegistrationaddSidePanelAfterOpenListener(com.vaadin.flow.component.ComponentEventListener<SidePanelAfterOpenEvent> listener) Adds a listener to handle the side panel after open events.com.vaadin.flow.shared.RegistrationaddSidePanelBeforeOpenListener(com.vaadin.flow.component.ComponentEventListener<SidePanelBeforeOpenEvent> listener) Adds a listener to handle side panel open events.com.vaadin.flow.shared.RegistrationaddSidePanelCloseListener(com.vaadin.flow.component.ComponentEventListener<SidePanelCloseEvent> listener) Adds a listener to handle side panel close events.protected voidvoidCloses the side panel.createComponentInertManager(com.vaadin.flow.component.Component content) protected voiddoSetOpened(boolean opened, boolean fromClient) protected voidfireSidePanelBeforeOpenEvent(boolean fromClient) protected voidfireSidePanelCloseEvent(boolean fromClient) com.vaadin.flow.component.Componentcom.vaadin.flow.component.ComponentReturns the max-width of the side panel when horizontal position is configured (SidePanelPosition.LEFT,SidePanelPosition.RIGHT,SidePanelPosition.INLINE_STARTorSidePanelPosition.INLINE_END).Returns the min-width of the side panel when horizontal position is configured (SidePanelPosition.LEFT,SidePanelPosition.RIGHT,SidePanelPosition.INLINE_STARTorSidePanelPosition.INLINE_END).Returns the width of the side panel when horizontal position is configured (SidePanelPosition.LEFT,SidePanelPosition.RIGHT,SidePanelPosition.INLINE_STARTorSidePanelPosition.INLINE_END).Returns the max-height of the dialog when vertical position is configured (SidePanelPosition.TOP,SidePanelPosition.BOTTOM).Returns the min-height of the dialog when vertical position is configured (SidePanelPosition.TOP,SidePanelPosition.BOTTOM).Returns the height of the side panel when vertical position is configured (SidePanelPosition.TOP,SidePanelPosition.BOTTOM).booleanbooleanbooleanisModal()booleanbooleanprotected voidonAttach(com.vaadin.flow.component.AttachEvent attachEvent) protected voidonDetach(com.vaadin.flow.component.DetachEvent detachEvent) protected voidonSidePanelOpenedChanged(com.vaadin.flow.dom.PropertyChangeEvent event) voidOpens the side panel.protected voidremoveComponent(com.vaadin.flow.component.Component... components) voidsetCloseOnOutsideClick(boolean closeOnOutsideClick) Sets whether the side panel should be closed when the user clicks on outside of panel but within theJmixSidePanelLayout.voidsetContent(com.vaadin.flow.component.Component content) Sets the content that should be overlapped or pushed aside by the side panel.voidsetDisplayAsOverlayOnSmallDevices(boolean displayAsOverlay) Sets whether the side panel should be displayed as an overlay on small screens.voidsetModal(boolean modal) Sets whether the side panel should be modal.voidsetOverlayAriaLabel(String ariaLabel) Sets the aria-label for the overlay.voidsetSidePanelContent(com.vaadin.flow.component.Component sidePanelContent) Sets the side panel content components.voidsetSidePanelHorizontalMaxSize(String maxSize) Sets the max-width of the side panel when position is horizontal (SidePanelPosition.LEFT,SidePanelPosition.RIGHT,SidePanelPosition.INLINE_START,SidePanelPosition.INLINE_END).voidsetSidePanelHorizontalMinSize(String minSize) Sets the min-width of the side panel when position is horizontal (SidePanelPosition.LEFT,SidePanelPosition.RIGHT,SidePanelPosition.INLINE_START,SidePanelPosition.INLINE_END).voidSets the width of the side panel when position is horizontal (SidePanelPosition.LEFT,SidePanelPosition.RIGHT,SidePanelPosition.INLINE_START,SidePanelPosition.INLINE_END).voidsetSidePanelOverlay(boolean overlay) Sets whether the side panel should overlay layout content when it is opened.voidsetSidePanelPosition(SidePanelPosition position) Sets the side panel position.voidsetSidePanelVerticalMaxSize(String maxSize) Sets the max-height of the side panel when side panel position is horizontal (SidePanelPosition.TOP,SidePanelPosition.BOTTOM).voidsetSidePanelVerticalMinSize(String minSize) Sets the min-height of the side panel when position is horizontal (SidePanelPosition.TOP,SidePanelPosition.BOTTOM).voidSets the height of the side panel when side position is horizontal (SidePanelPosition.TOP,SidePanelPosition.BOTTOM).voidOpens or closes the side panel depending on the panel's state.protected voidupdateContentInert(boolean modal) protected voidupdateSlot(String slot, com.vaadin.flow.component.Component... components) Methods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisibleMethods 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.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Field Details
-
protected com.vaadin.flow.component.Component content
-
sidePanelContent
protected com.vaadin.flow.component.Component sidePanelContent -
componentInertManager
-
-
Constructor Details
-
JmixSidePanelLayout
public JmixSidePanelLayout()
-
-
Method Details
-
getContent
@Nullable public com.vaadin.flow.component.Component getContent()- Returns:
- the layout content
-
setContent
public void setContent(@Nullable com.vaadin.flow.component.Component content) Sets the content that should be overlapped or pushed aside by the side panel.- Parameters:
content- the content to set
-
getSidePanelContent
@Nullable public com.vaadin.flow.component.Component getSidePanelContent()- Returns:
- side panel content components or
nullif no side panel content is set
-
setSidePanelContent
public void setSidePanelContent(@Nullable com.vaadin.flow.component.Component sidePanelContent) Sets the side panel content components.- Parameters:
sidePanelContent- content to set
-
isModal
public boolean isModal()- Returns:
- whether the side panel is modal
-
setModal
public void setModal(boolean modal) Sets whether the side panel should be modal. Iftrue, thecontentwill not receive requests from client-side even if the modality curtain is removed.The default value is
true.- Parameters:
modal- whether the side panel should be modal
-
isSidePanelOverlay
public boolean isSidePanelOverlay()- Returns:
trueif the side panel should overlay layout content when it is opened
-
setSidePanelOverlay
public void setSidePanelOverlay(boolean overlay) Sets whether the side panel should overlay layout content when it is opened.The default value is
true.- Parameters:
overlay- overlay option
-
getSidePanelPosition
- Returns:
- the side panel position
-
setSidePanelPosition
Sets the side panel position.- Parameters:
position- side panel position to set
-
isCloseOnOutsideClick
public boolean isCloseOnOutsideClick()- Returns:
- whether the side panel should be closed when the user clicks on outside of panel but within
the
JmixSidePanelLayout
-
setCloseOnOutsideClick
public void setCloseOnOutsideClick(boolean closeOnOutsideClick) Sets whether the side panel should be closed when the user clicks on outside of panel but within theJmixSidePanelLayout.The default value is
true.- Parameters:
closeOnOutsideClick- closeOnClick option
-
isDisplayAsOverlayOnSmallDevices
public boolean isDisplayAsOverlayOnSmallDevices()- Returns:
- whether the side panel should be displayed as an overlay on small screens.
-
setDisplayAsOverlayOnSmallDevices
public void setDisplayAsOverlayOnSmallDevices(boolean displayAsOverlay) Sets whether the side panel should be displayed as an overlay on small screens. When enabled, the overlay appears in fullscreen mode.The default value is
true.- Parameters:
displayAsOverlay- displayAsOverlay option
-
getOverlayAriaLabel
- Returns:
- the aria-label for the overlay or
nullif no aria-label is set.
-
setOverlayAriaLabel
Sets the aria-label for the overlay.- Parameters:
ariaLabel- aria-label to set- See Also:
-
getSidePanelHorizontalSize
Returns the width of the side panel when horizontal position is configured (SidePanelPosition.LEFT,SidePanelPosition.RIGHT,SidePanelPosition.INLINE_STARTorSidePanelPosition.INLINE_END).Note that this does not return the actual size of the side panel but the width which has been set using
setSidePanelHorizontalSize(String).- Returns:
- the width defined for the side panel or
nullif width is not set
-
setSidePanelHorizontalSize
Sets the width of the side panel when position is horizontal (SidePanelPosition.LEFT,SidePanelPosition.RIGHT,SidePanelPosition.INLINE_START,SidePanelPosition.INLINE_END).The width should be in a format understood by the browser, e.g. "100px" or "2.5em".
The default value is taken from the CSS property
--jmix-side-panel-layout-horizontal-size. If it is not set, the default value isauto.- Parameters:
size- width to set ornullto remove the inline width from the style
-
getSidePanelHorizontalMaxSize
Returns the max-width of the side panel when horizontal position is configured (SidePanelPosition.LEFT,SidePanelPosition.RIGHT,SidePanelPosition.INLINE_STARTorSidePanelPosition.INLINE_END).Note that this does not return the actual size of the side panel but the max-width which has been set using
setSidePanelHorizontalMaxSize(String).- Returns:
- the max-width defined for the side panel or
nullif max-width is not set
-
setSidePanelHorizontalMaxSize
Sets the max-width of the side panel when position is horizontal (SidePanelPosition.LEFT,SidePanelPosition.RIGHT,SidePanelPosition.INLINE_START,SidePanelPosition.INLINE_END).The max-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-panel-layout-horizontal-max-size. If it is not set, the default value is50%.- Parameters:
maxSize- max-width to set ornullto remove the inline max-width property from the style
-
getSidePanelHorizontalMinSize
Returns the min-width of the side panel when horizontal position is configured (SidePanelPosition.LEFT,SidePanelPosition.RIGHT,SidePanelPosition.INLINE_STARTorSidePanelPosition.INLINE_END).Note that this does not return the actual size of the side panel but the min-width which has been set using
setSidePanelHorizontalMinSize(String).- Returns:
- the min-width defined for the side panel or
nullif the min-width is not set
-
setSidePanelHorizontalMinSize
Sets the min-width of the side panel when position is horizontal (SidePanelPosition.LEFT,SidePanelPosition.RIGHT,SidePanelPosition.INLINE_START,SidePanelPosition.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-panel-layout-horizontal-min-size. If it is not set, the default value is14em.- Parameters:
minSize- min-width to set ornullto remove the inline min-width property from the style
-
getSidePanelVerticalSize
Returns the height of the side panel when vertical position is configured (SidePanelPosition.TOP,SidePanelPosition.BOTTOM).Note that this does not return the actual size of the side panel but the height which has been set using
setSidePanelVerticalSize(String).- Returns:
- the height defined for the side panel or
nullif the height is not set
-
setSidePanelVerticalSize
Sets the height of the side panel when side position is horizontal (SidePanelPosition.TOP,SidePanelPosition.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-panel-layout-vertical-size. If it is not set, the default value isauto.- Parameters:
size- height to set ornullto remove the inline height property from the style
-
getSidePanelVerticalMaxSize
Returns the max-height of the dialog when vertical position is configured (SidePanelPosition.TOP,SidePanelPosition.BOTTOM).Note that this does not return the actual size of the side panel but the max-height which has been set using
setSidePanelVerticalMaxSize(String).- Returns:
- the max-height defined for the side panel or
nullif the max-height is not set
-
setSidePanelVerticalMaxSize
Sets the max-height of the side panel when side panel position is horizontal (SidePanelPosition.TOP,SidePanelPosition.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-panel-layout-vertical-max-size. If it is not set, the default value is50%.- Parameters:
maxSize- max-height to set ornullto remove the inline max-height property from style
-
getSidePanelVerticalMinSize
Returns the min-height of the dialog when vertical position is configured (SidePanelPosition.TOP,SidePanelPosition.BOTTOM).Note that this does not return the actual size of the side panel but the min-height which has been set using
setSidePanelVerticalMinSize(String).- Returns:
- the min-height defined for the side panel or
nullif the min-height is not set
-
setSidePanelVerticalMinSize
Sets the min-height of the side panel when position is horizontal (SidePanelPosition.TOP,SidePanelPosition.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-panel-layout-vertical-min-size. If it is not set, the default value is10em.- Parameters:
minSize- min-height to set ornullto remove the inline min-height property from style
-
isSidePanelOpened
@Synchronize(property="sidePanelOpened", value="side-panel-opened-changed", allowInert=true) public boolean isSidePanelOpened()- Returns:
- whether the side panel is opened
-
openSidePanel
public void openSidePanel()Opens the side panel. -
closeSidePanel
public void closeSidePanel()Closes the side panel. -
toggleSidePanel
public void toggleSidePanel()Opens or closes the side panel depending on the panel's state. -
addModalityCurtainClickListener
public com.vaadin.flow.shared.Registration addModalityCurtainClickListener(com.vaadin.flow.component.ComponentEventListener<ModalityCurtainClickEvent> listener) Adds a listener to handle modality curtain clicks.- Parameters:
listener- listener to add- Returns:
- a registration for removing the listener
-
addSidePanelBeforeOpenListener
public com.vaadin.flow.shared.Registration addSidePanelBeforeOpenListener(com.vaadin.flow.component.ComponentEventListener<SidePanelBeforeOpenEvent> listener) Adds a listener to handle side panel open events.- Parameters:
listener- listener to add- Returns:
- a registration for removing the listener
-
addSidePanelAfterOpenListener
public com.vaadin.flow.shared.Registration addSidePanelAfterOpenListener(com.vaadin.flow.component.ComponentEventListener<SidePanelAfterOpenEvent> listener) Adds a listener to handle the side panel after open events.- Parameters:
listener- listener to add- Returns:
- a registration for removing the listener
-
addSidePanelCloseListener
public com.vaadin.flow.shared.Registration addSidePanelCloseListener(com.vaadin.flow.component.ComponentEventListener<SidePanelCloseEvent> listener) Adds a listener to handle side panel close events.- Parameters:
listener- listener to add- Returns:
- a registration for removing the listener
-
doSetOpened
protected void doSetOpened(boolean opened, boolean fromClient) -
fireSidePanelBeforeOpenEvent
protected void fireSidePanelBeforeOpenEvent(boolean fromClient) -
fireSidePanelCloseEvent
protected void fireSidePanelCloseEvent(boolean fromClient) -
addComponent
protected void addComponent(com.vaadin.flow.component.Component... components) -
removeComponent
protected void removeComponent(com.vaadin.flow.component.Component... components) -
updateContentInert
protected void updateContentInert(boolean modal) -
updateSlot
-
attachSidePanelOpenedChangedListener
protected void attachSidePanelOpenedChangedListener() -
onSidePanelOpenedChanged
protected void onSidePanelOpenedChanged(com.vaadin.flow.dom.PropertyChangeEvent event) -
createComponentInertManager
protected JmixSidePanelLayout.ComponentInertManager createComponentInertManager(com.vaadin.flow.component.Component content) -
onAttach
protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent) - Overrides:
onAttachin classcom.vaadin.flow.component.Component
-
onDetach
protected void onDetach(com.vaadin.flow.component.DetachEvent detachEvent) - Overrides:
onDetachin classcom.vaadin.flow.component.Component
-