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

      @Nullable public 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

      @Nullable public 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

      @Nullable public 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

      @Nullable public 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

      @Nullable public 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

      @Nullable public 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

      public boolean isModal()
      Returns:
      true if the dialog is a modal dialog, false otherwise
    • setModal

      public void setModal(boolean modal)
      Sets whether a component will open a modal or modeless dialog.
      Parameters:
      modal - modal option
    • 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

      @Nullable public String getOverlayRole()
      Returns:
      the ARIA role for the overlay element or null if not set
    • setOverlayRole

      public void setOverlayRole(String role)
      Sets the ARIA role for the overlay 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