Class AbstractDialogWindow<V extends View<?>>

java.lang.Object
io.jmix.flowui.view.AbstractDialogWindow<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
Direct Known Subclasses:
DialogWindow, DialogWindow

public class AbstractDialogWindow<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:
  • Field Details

    • BASE_CLASS_NAME

      protected static final String BASE_CLASS_NAME
      See Also:
    • dialog

      protected com.vaadin.flow.component.dialog.Dialog dialog
    • view

      protected V extends View<?> view
    • applicationContext

      protected org.springframework.context.ApplicationContext applicationContext
    • headerContent

      protected com.vaadin.flow.component.orderedlayout.HorizontalLayout headerContent
  • Constructor Details

    • AbstractDialogWindow

      public AbstractDialogWindow(V view)
  • Method Details

    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Throws:
      org.springframework.beans.BeansException
    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
    • initView

      protected void initView(View<?> view)
    • createDialog

      protected com.vaadin.flow.component.dialog.Dialog createDialog()
    • initDialog

      protected void initDialog(com.vaadin.flow.component.dialog.Dialog dialog)
    • getHeaderContent

      protected com.vaadin.flow.component.HasComponents getHeaderContent()
    • getFooterContent

      protected com.vaadin.flow.component.HasComponents getFooterContent()
    • onDialogCloseAction

      protected void onDialogCloseAction(com.vaadin.flow.component.dialog.Dialog.DialogCloseActionEvent event)
    • postInitDialog

      protected void postInitDialog(com.vaadin.flow.component.dialog.Dialog dialog)
    • applyDialogModeSettings

      protected void applyDialogModeSettings(V view)
    • setValueIfPresent

      protected void setValueIfPresent(@Nullable String value, Consumer<String> setter)
    • configureDialogWindowHeaderFooter

      protected void configureDialogWindowHeaderFooter()
    • createHeaderCloseButton

      @Nullable protected com.vaadin.flow.component.button.Button createHeaderCloseButton()
    • onCloseButtonClicked

      protected void onCloseButtonClicked(com.vaadin.flow.component.ClickEvent<com.vaadin.flow.component.button.Button> event)
    • createHeaderWrapper

      protected com.vaadin.flow.component.html.Div createHeaderWrapper()
    • createViewWrapper

      protected com.vaadin.flow.component.Component createViewWrapper(V view)
    • publish

      protected <E> void publish(Class<E> eventType, E event)
    • getView

      public V 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()
    • getElement

      public com.vaadin.flow.dom.Element getElement()
      Specified by:
      getElement in interface com.vaadin.flow.component.HasElement
    • addDraggedListener

      public com.vaadin.flow.shared.Registration addDraggedListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.dialog.Dialog.DialogDraggedEvent> listener)
      Adds a listener that is called after user finishes dragging the dialog. It is called only if dragging is enabled.

      Note: By default, the component will sync the top/left values after every dragging.

      Parameters:
      listener - the listener to add
      Returns:
      a Registration for removing the event listener
      See Also:
    • addResizeListener

      public com.vaadin.flow.shared.Registration addResizeListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.dialog.Dialog.DialogResizeEvent> listener)
      Adds a listener that is called after user finishes resizing the dialog. It is called only if resizing is enabled (see setResizable(boolean).

      Note: By default, the component will sync the width/height and top/left values after every resizing.

      Parameters:
      listener - the listener to add
      Returns:
      registration for removal of listener
    • 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.
    • getLeft

      public String getLeft()
      Gets the left position of the overlay.
      Returns:
      the left position of the overlay
    • setLeft

      public void setLeft(String left)
      Sets the distance of the overlay from the left of its container. If a unitless number is provided, pixels are assumed.

      Note that the overlay left edge may not be the same as the viewport left edge (e.g. the Lumo theme defines some spacing to prevent the overlay from stretching all the way to the left of the viewport).

      Parameters:
      left - the left position of the overlay
    • getTop

      public String getTop()
      Gets the top position of the overlay.
      Returns:
      the top position of the overlay
    • setTop

      public void setTop(String top)
      Sets the top position of the overlay. If a unitless number is provided, pixels are assumed.

      Note that the overlay top edge may not be the same as the viewport top edge (e.g. the Lumo theme defines some spacing to prevent the overlay from stretching all the way to the top of the viewport).

      Parameters:
      top - the top position of the overlay
    • setWidth

      public void setWidth(String width)
      Specified by:
      setWidth in interface com.vaadin.flow.component.HasSize
    • setWidth

      public void setWidth(float width, com.vaadin.flow.component.Unit unit)
      Specified by:
      setWidth in interface com.vaadin.flow.component.HasSize
    • setMinWidth

      public void setMinWidth(String minWidth)
      Specified by:
      setMinWidth in interface com.vaadin.flow.component.HasSize
    • setMinWidth

      public void setMinWidth(float minWidth, com.vaadin.flow.component.Unit unit)
      Specified by:
      setMinWidth in interface com.vaadin.flow.component.HasSize
    • setMaxWidth

      public void setMaxWidth(String maxWidth)
      Specified by:
      setMaxWidth in interface com.vaadin.flow.component.HasSize
    • setMaxWidth

      public void setMaxWidth(float maxWidth, com.vaadin.flow.component.Unit unit)
      Specified by:
      setMaxWidth in interface com.vaadin.flow.component.HasSize
    • getWidth

      public String getWidth()
      Specified by:
      getWidth in interface com.vaadin.flow.component.HasSize
    • getMinWidth

      public String getMinWidth()
      Specified by:
      getMinWidth in interface com.vaadin.flow.component.HasSize
    • getMaxWidth

      public String getMaxWidth()
      Specified by:
      getMaxWidth in interface com.vaadin.flow.component.HasSize
    • getWidthUnit

      public Optional<com.vaadin.flow.component.Unit> getWidthUnit()
      Specified by:
      getWidthUnit in interface com.vaadin.flow.component.HasSize
    • setHeight

      public void setHeight(String height)
      Specified by:
      setHeight in interface com.vaadin.flow.component.HasSize
    • setHeight

      public void setHeight(float height, com.vaadin.flow.component.Unit unit)
      Specified by:
      setHeight in interface com.vaadin.flow.component.HasSize
    • setMinHeight

      public void setMinHeight(String minHeight)
      Specified by:
      setMinHeight in interface com.vaadin.flow.component.HasSize
    • setMinHeight

      public void setMinHeight(float minHeight, com.vaadin.flow.component.Unit unit)
      Specified by:
      setMinHeight in interface com.vaadin.flow.component.HasSize
    • setMaxHeight

      public void setMaxHeight(String maxHeight)
      Specified by:
      setMaxHeight in interface com.vaadin.flow.component.HasSize
    • setMaxHeight

      public void setMaxHeight(float maxHeight, com.vaadin.flow.component.Unit unit)
      Specified by:
      setMaxHeight in interface com.vaadin.flow.component.HasSize
    • getHeight

      public String getHeight()
      Specified by:
      getHeight in interface com.vaadin.flow.component.HasSize
    • getMinHeight

      public String getMinHeight()
      Specified by:
      getMinHeight in interface com.vaadin.flow.component.HasSize
    • getMaxHeight

      public String getMaxHeight()
      Specified by:
      getMaxHeight in interface com.vaadin.flow.component.HasSize
    • getHeightUnit

      public Optional<com.vaadin.flow.component.Unit> getHeightUnit()
      Specified by:
      getHeightUnit in interface com.vaadin.flow.component.HasSize
    • setSizeFull

      public void setSizeFull()
      Specified by:
      setSizeFull in interface com.vaadin.flow.component.HasSize
    • setWidthFull

      public void setWidthFull()
      Specified by:
      setWidthFull in interface com.vaadin.flow.component.HasSize
    • setHeightFull

      public void setHeightFull()
      Specified by:
      setHeightFull in interface com.vaadin.flow.component.HasSize
    • setSizeUndefined

      public void setSizeUndefined()
      Specified by:
      setSizeUndefined in interface com.vaadin.flow.component.HasSize
    • addThemeName

      public void addThemeName(String themeName)
      Specified by:
      addThemeName in interface com.vaadin.flow.component.HasTheme
    • removeThemeName

      public boolean removeThemeName(String themeName)
      Specified by:
      removeThemeName in interface com.vaadin.flow.component.HasTheme
    • setThemeName

      public void setThemeName(String themeName)
      Specified by:
      setThemeName in interface com.vaadin.flow.component.HasTheme
    • getThemeName

      public String getThemeName()
      Specified by:
      getThemeName in interface com.vaadin.flow.component.HasTheme
    • getThemeNames

      public com.vaadin.flow.dom.ThemeList getThemeNames()
      Specified by:
      getThemeNames in interface com.vaadin.flow.component.HasTheme
    • setThemeName

      public void setThemeName(String themeName, boolean set)
      Specified by:
      setThemeName in interface com.vaadin.flow.component.HasTheme
    • hasThemeName

      public boolean hasThemeName(String themeName)
      Specified by:
      hasThemeName in interface com.vaadin.flow.component.HasTheme
    • addThemeNames

      public void addThemeNames(String... themeNames)
      Specified by:
      addThemeNames in interface com.vaadin.flow.component.HasTheme
    • removeThemeNames

      public void removeThemeNames(String... themeNames)
      Specified by:
      removeThemeNames in interface com.vaadin.flow.component.HasTheme
    • addClassName

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

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

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

      public String getClassName()
      Specified by:
      getClassName 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
    • setClassName

      public void setClassName(String className, boolean set)
      Specified by:
      setClassName in interface com.vaadin.flow.component.HasStyle
    • hasClassName

      public boolean hasClassName(String className)
      Specified by:
      hasClassName 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
    • addClassNames

      public void addClassNames(String... classNames)
      Specified by:
      addClassNames in interface com.vaadin.flow.component.HasStyle
    • removeClassNames

      public void removeClassNames(String... classNames)
      Specified by:
      removeClassNames in interface com.vaadin.flow.component.HasStyle
    • getEventHub

      protected EventHub getEventHub()
    • messages

      protected Messages messages()
    • uiComponents

      protected UiComponents uiComponents()