Class MainTabSheetMenuItemActionWrapper

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<com.vaadin.flow.component.html.Div>
io.jmix.tabbedmode.component.tabsheet.contextmenu.MainTabSheetMenuItemActionWrapper
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, com.vaadin.flow.component.HasText, com.vaadin.flow.component.shared.HasPrefix, com.vaadin.flow.component.shared.HasSuffix, com.vaadin.flow.component.shared.HasTooltip, HasAction, Serializable

public class MainTabSheetMenuItemActionWrapper extends com.vaadin.flow.component.Composite<com.vaadin.flow.component.html.Div> implements com.vaadin.flow.component.HasText, com.vaadin.flow.component.HasComponents, com.vaadin.flow.component.shared.HasPrefix, com.vaadin.flow.component.shared.HasSuffix, com.vaadin.flow.component.shared.HasTooltip, HasAction
A wrapper class for handling MainTabSheet's menu item actions and related UI content.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasText

    com.vaadin.flow.component.HasText.WhiteSpace
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
    protected static final String
     
     
    protected static final String
     
    protected com.vaadin.flow.component.Component
     
    protected static final String
     
    protected com.vaadin.flow.component.Component
     
    protected static final String
     
    protected com.vaadin.flow.component.html.Span
     
    protected com.vaadin.flow.component.shared.Tooltip
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(com.vaadin.flow.component.Component... components)
     
    void
    add(String text)
     
    void
    addComponentAsFirst(com.vaadin.flow.component.Component component)
     
    void
    addComponentAtIndex(int index, com.vaadin.flow.component.Component component)
     
    com.vaadin.flow.shared.Registration
    addMenuItemClickListener(com.vaadin.flow.component.ComponentEventListener<MainTabSheetContextMenu.MainTabSheetContextMenuItemClickEvent> clickListener)
    Adds a click listener to the associated menu item.
     
    @Nullable Action
     
     
    Returns the menu item.
    @Nullable com.vaadin.flow.component.Component
     
    @Nullable com.vaadin.flow.component.Component
     
    @Nullable String
     
    com.vaadin.flow.component.shared.Tooltip
     
    protected com.vaadin.flow.component.shared.Tooltip
     
    com.vaadin.flow.component.HasText.WhiteSpace
     
    protected com.vaadin.flow.component.html.Div
     
    boolean
    Checks if the content is empty.
    void
    remove(com.vaadin.flow.component.Component... components)
     
    void
     
    void
    setAction(@Nullable Action action, boolean overrideComponentProperties)
    Sets the action to the component.
    void
    setMenuItem(@Nullable MainTabSheetMenuItem menuItem)
    Sets the menu item.
    void
    setPrefixComponent(@Nullable com.vaadin.flow.component.Component component)
     
    protected void
    setPrefixComponentInternal(@Nullable com.vaadin.flow.component.Component prefixComponent)
     
    void
    setSuffixComponent(@Nullable com.vaadin.flow.component.Component component)
     
    protected void
    setSuffixComponentInternal(@Nullable com.vaadin.flow.component.Component suffixComponent)
     
    void
    setText(@Nullable String text)
     
    protected void
    setTextComponentInternal(@Nullable com.vaadin.flow.component.html.Span textComponent)
     
    com.vaadin.flow.component.shared.Tooltip
    setTooltipText(@Nullable String text)
     
    void
    setWhiteSpace(com.vaadin.flow.component.HasText.WhiteSpace value)
     
    protected void
    updateContent(@Nullable com.vaadin.flow.component.Component prefixComponent, @Nullable com.vaadin.flow.component.html.Span textComponent, @Nullable com.vaadin.flow.component.Component suffixComponent)
     

    Methods inherited from class com.vaadin.flow.component.Composite

    getChildren, getContent, getElement

    Methods 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, setTestId, setVisible

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.flow.component.AttachNotifier

    addAttachListener

    Methods inherited from interface com.vaadin.flow.component.DetachNotifier

    addDetachListener

    Methods inherited from interface io.jmix.flowui.kit.component.HasAction

    setAction

    Methods inherited from interface com.vaadin.flow.component.HasComponents

    add, bindChildren, getChildren, getComponentAt, getComponentCount, indexOf, remove, replace

    Methods inherited from interface com.vaadin.flow.component.HasElement

    getElement

    Methods inherited from interface com.vaadin.flow.component.HasEnabled

    bindEnabled, isEnabled, setEnabled

    Methods inherited from interface com.vaadin.flow.component.HasStyle

    addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName

    Methods inherited from interface com.vaadin.flow.component.HasText

    bindText

    Methods inherited from interface com.vaadin.flow.component.shared.HasTooltip

    setTooltipMarkdown
  • Field Details

    • ITEM_COMPONENT_CLASS_NAME

      protected static final String ITEM_COMPONENT_CLASS_NAME
      See Also:
    • PREFIX_COMPONENT_CLASS_NAME

      protected static final String PREFIX_COMPONENT_CLASS_NAME
      See Also:
    • TEXT_COMPONENT_CLASS_NAME

      protected static final String TEXT_COMPONENT_CLASS_NAME
      See Also:
    • SUFFIX_COMPONENT_CLASS_NAME

      protected static final String SUFFIX_COMPONENT_CLASS_NAME
      See Also:
    • textComponent

      protected com.vaadin.flow.component.html.Span textComponent
    • prefixComponent

      protected com.vaadin.flow.component.Component prefixComponent
    • suffixComponent

      protected com.vaadin.flow.component.Component suffixComponent
    • tooltip

      protected com.vaadin.flow.component.shared.Tooltip tooltip
    • actionSupport

      protected MainTabSheetMenuItemActionSupport actionSupport
  • Constructor Details

    • MainTabSheetMenuItemActionWrapper

      public MainTabSheetMenuItemActionWrapper()
  • Method Details

    • initContent

      protected com.vaadin.flow.component.html.Div initContent()
      Overrides:
      initContent in class com.vaadin.flow.component.Composite<com.vaadin.flow.component.html.Div>
    • getMenuItem

      public @Nullable MainTabSheetMenuItem getMenuItem()
      Returns the menu item.
      Returns:
      the associated menu item or null if the item is not set
    • setMenuItem

      public void setMenuItem(@Nullable MainTabSheetMenuItem menuItem)
      Sets the menu item.
      Parameters:
      menuItem - menu item to set, or null to remove
    • getAction

      public @Nullable Action getAction()
      Specified by:
      getAction in interface HasAction
      Returns:
      an action or null
    • setAction

      public void setAction(@Nullable Action action, boolean overrideComponentProperties)
      Description copied from interface: HasAction
      Sets the action to the component. If overrideComponentProperties is true then the action properties will override component's properties, otherwise the component's properties will be overridden if they are null.

      List of properties that the action and the component have and which can be overridden:

      • text
      • description
      • shortcutCombination
      • enabled
      • visible
      • icon
      • variant
      Specified by:
      setAction in interface HasAction
      Parameters:
      action - an action to set
      overrideComponentProperties - whether action properties override component properties
    • addMenuItemClickListener

      public com.vaadin.flow.shared.Registration addMenuItemClickListener(com.vaadin.flow.component.ComponentEventListener<MainTabSheetContextMenu.MainTabSheetContextMenuItemClickEvent> clickListener)
      Adds a click listener to the associated menu item. The listener is triggered when the menu item is clicked.
      Parameters:
      clickListener - the listener to handle a menu item click events
      Returns:
      a Registration object that can be used to remove the listener
    • getText

      public @Nullable String getText()
      Specified by:
      getText in interface com.vaadin.flow.component.HasText
    • setText

      public void setText(@Nullable String text)
      Specified by:
      setText in interface com.vaadin.flow.component.HasText
    • updateContent

      protected void updateContent(@Nullable com.vaadin.flow.component.Component prefixComponent, @Nullable com.vaadin.flow.component.html.Span textComponent, @Nullable com.vaadin.flow.component.Component suffixComponent)
    • setPrefixComponentInternal

      protected void setPrefixComponentInternal(@Nullable com.vaadin.flow.component.Component prefixComponent)
    • setTextComponentInternal

      protected void setTextComponentInternal(@Nullable com.vaadin.flow.component.html.Span textComponent)
    • setSuffixComponentInternal

      protected void setSuffixComponentInternal(@Nullable com.vaadin.flow.component.Component suffixComponent)
    • getPrefixComponent

      public @Nullable com.vaadin.flow.component.Component getPrefixComponent()
      Specified by:
      getPrefixComponent in interface com.vaadin.flow.component.shared.HasPrefix
    • setPrefixComponent

      public void setPrefixComponent(@Nullable com.vaadin.flow.component.Component component)
      Specified by:
      setPrefixComponent in interface com.vaadin.flow.component.shared.HasPrefix
    • getSuffixComponent

      public @Nullable com.vaadin.flow.component.Component getSuffixComponent()
      Specified by:
      getSuffixComponent in interface com.vaadin.flow.component.shared.HasSuffix
    • setSuffixComponent

      public void setSuffixComponent(@Nullable com.vaadin.flow.component.Component component)
      Specified by:
      setSuffixComponent in interface com.vaadin.flow.component.shared.HasSuffix
    • getTooltip

      public com.vaadin.flow.component.shared.Tooltip getTooltip()
      Specified by:
      getTooltip in interface com.vaadin.flow.component.shared.HasTooltip
    • getTooltipInternal

      protected com.vaadin.flow.component.shared.Tooltip getTooltipInternal()
    • setTooltipText

      public com.vaadin.flow.component.shared.Tooltip setTooltipText(@Nullable String text)
      Specified by:
      setTooltipText in interface com.vaadin.flow.component.shared.HasTooltip
    • getWhiteSpace

      public com.vaadin.flow.component.HasText.WhiteSpace getWhiteSpace()
      Specified by:
      getWhiteSpace in interface com.vaadin.flow.component.HasText
    • setWhiteSpace

      public void setWhiteSpace(com.vaadin.flow.component.HasText.WhiteSpace value)
      Specified by:
      setWhiteSpace in interface com.vaadin.flow.component.HasText
    • add

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

      public void add(String text)
      Specified by:
      add in interface com.vaadin.flow.component.HasComponents
    • remove

      public void remove(com.vaadin.flow.component.Component... components)
      Specified by:
      remove in interface com.vaadin.flow.component.HasComponents
    • removeAll

      public void removeAll()
      Specified by:
      removeAll 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
    • addComponentAsFirst

      public void addComponentAsFirst(com.vaadin.flow.component.Component component)
      Specified by:
      addComponentAsFirst in interface com.vaadin.flow.component.HasComponents
    • isEmpty

      public boolean isEmpty()
      Checks if the content is empty.
      Returns:
      true if the content has no children, otherwise false
    • getActionSupport

      protected MainTabSheetMenuItemActionSupport getActionSupport()
    • createActionSupport

      protected MainTabSheetMenuItemActionSupport createActionSupport()