Class JmixSideDialog

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<JmixSideDialogOverlay>
io.jmix.flowui.kit.component.sidedialog.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

public class JmixSideDialog extends com.vaadin.flow.component.Composite<JmixSideDialogOverlay> implements com.vaadin.flow.component.HasComponents
See Also:
  • Field Details

  • Constructor Details

    • JmixSideDialog

      public JmixSideDialog()
  • Method Details

    • add

      public void add(Collection<com.vaadin.flow.component.Component> components)
      Specified by:
      add in interface com.vaadin.flow.component.HasComponents
    • addComponentAtIndex

      public void addComponentAtIndex(int index, com.vaadin.flow.component.Component component)
      Specified by:
      addComponentAtIndex in interface com.vaadin.flow.component.HasComponents
    • getContentComponents

      public List<com.vaadin.flow.component.Component> getContentComponents()
      Returns:
      the content of the dialog
    • getHorizontalSize

      public @Nullable String getHorizontalSize()
      Returns the width of the dialog when horizontal position is configured (SideDialogPosition.LEFT, SideDialogPosition.RIGHT, SideDialogPosition.INLINE_START or SideDialogPosition.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 null if the width is not set
    • setHorizontalSize

      public void setHorizontalSize(@Nullable String size)
      Sets the width of the dialog when horizontal position is configured (SideDialogPosition.LEFT, SideDialogPosition.RIGHT, SideDialogPosition.INLINE_START or SideDialogPosition.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 is auto.

      Parameters:
      size - the width of the dialog or null to remove the inline width from the style
    • getHorizontalMaxSize

      public @Nullable String getHorizontalMaxSize()
      Returns the max-width of the dialog when horizontal position is configured (SideDialogPosition.LEFT, SideDialogPosition.RIGHT, SideDialogPosition.INLINE_START or SideDialogPosition.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 null if the width is not set
    • setHorizontalMaxSize

      public void setHorizontalMaxSize(@Nullable String maxSize)
      Sets the max-width of the dialog when horizontal position is configured (SideDialogPosition.LEFT, SideDialogPosition.RIGHT, SideDialogPosition.INLINE_START or SideDialogPosition.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 is 50%.

      Parameters:
      maxSize - the max-width of the dialog or null to remove the inline max-width property from the style
    • getHorizontalMinSize

      public @Nullable String getHorizontalMinSize()
      Returns the min-width of the dialog when horizontal position is configured (SideDialogPosition.LEFT, SideDialogPosition.RIGHT, SideDialogPosition.INLINE_START or SideDialogPosition.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 null if the min-width is not set
    • setHorizontalMinSize

      public void setHorizontalMinSize(@Nullable String minSize)
      Sets the min-width of the dialog when horizontal position is configured (SideDialogPosition.LEFT, SideDialogPosition.RIGHT, SideDialogPosition.INLINE_START or SideDialogPosition.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 is 16em.

      Parameters:
      minSize - the min-width of the dialog or null to remove the inline min-width property from the style
    • getVerticalSize

      public @Nullable String 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 null if the height is not set
    • setVerticalSize

      public void setVerticalSize(@Nullable String size)
      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 is auto.

      Parameters:
      size - the height of the dialog or null to remove the inline height property from the style
    • getVerticalMaxSize

      public @Nullable String 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 null if the max-height is not set
    • setVerticalMaxSize

      public void setVerticalMaxSize(@Nullable String maxSize)
      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 is 50vh.

      Parameters:
      maxSize - the max-height of the dialog or null to remove the inline max-height property from style
    • getVerticalMinSize

      public @Nullable String 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 null if the min-height is not set
    • setVerticalMinSize

      public void setVerticalMinSize(@Nullable String minSize)
      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 is 16em.

      Parameters:
      minSize - the min-height of the dialog or null to remove the inline min-height property from style
    • setClassName

      public void setClassName(String className)
      Specified by:
      setClassName in interface com.vaadin.flow.component.HasStyle
    • getClassNames

      public com.vaadin.flow.dom.ClassList getClassNames()
      Specified by:
      getClassNames in interface com.vaadin.flow.component.HasStyle
    • getStyle

      public com.vaadin.flow.dom.Style getStyle()
      Specified by:
      getStyle in interface com.vaadin.flow.component.HasStyle
    • isFullscreenOnSmallDevices

      public boolean isFullscreenOnSmallDevices()
      Returns:
      true if 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

      public SideDialogPosition getSideDialogPosition()
      Returns:
      the side dialog position
    • setSideDialogPosition

      public void setSideDialogPosition(SideDialogPosition position)
      Sets the side dialog position.

      The default value is SideDialogPosition.RIGHT.

      Parameters:
      position - the side dialog position
    • isOpened

      public boolean isOpened()
      Returns:
      true if the dialog is opened, false otherwise
    • open

      public void open()
      Opens the dialog.
    • close

      public void close()
      Closes the dialog.
    • isModal

      @Deprecated(since="3.0", forRemoval=true) public boolean isModal()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use getModality() to check if the dialog is modal
      Returns:
      true if the dialog is a modal dialog, false otherwise
    • setModal

      @Deprecated(since="3.0", forRemoval=true) public void setModal(boolean modal)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets 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 is ModalityMode.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 calls Dialog.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:
      true if 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:
      true if 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

      public String getHeaderTitle()
      Returns:
      the title to be rendered on the dialog header or empty string if not set
    • setHeaderTitle

      public void setHeaderTitle(@Nullable String title)
      Sets the title to be rendered on the dialog header.
      Parameters:
      title - the title to set or null to remove the header title
    • getOverlayRole

      @Deprecated(since="3.0", forRemoval=true) public @Nullable String getOverlayRole()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use getRole() instead
      Returns:
      the ARIA role for the overlay element or null if not set
    • setOverlayRole

      @Deprecated(since="3.0", forRemoval=true) public void setOverlayRole(String role)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use setRole(String) instead
      Sets the ARIA role for the overlay element, used by screen readers.
      Parameters:
      role - the ARIA role to set
    • getRole

      public @Nullable String getRole()
      Returns:
      the ARIA role for the dialog element or null if not set
    • setRole

      public void setRole(String role)
      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:
      setVisible in class com.vaadin.flow.component.Component
    • getHeader

      public JmixSideDialog.DrawerHeader getHeader()
      Returns:
      the header of the dialog
    • getFooter

      public JmixSideDialog.DrawerFooter getFooter()
      Returns:
      the footer of the dialog