Class JmixUserMenuItemsDelegate.SeparatorUserMenuItem

java.lang.Object
io.jmix.flowui.kit.component.usermenu.JmixUserMenuItemsDelegate.SeparatorUserMenuItem
All Implemented Interfaces:
com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasTheme, com.vaadin.flow.component.shared.HasThemeVariant<UserMenuItemVariant>, HasSubParts, UserMenuItem, Serializable
Enclosing class:
JmixUserMenuItemsDelegate

protected static class JmixUserMenuItemsDelegate.SeparatorUserMenuItem extends Object implements UserMenuItem
Blank item needed for correct insertion by index.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.jmix.flowui.kit.component.usermenu.UserMenuItem

    UserMenuItem.HasClickListener<ITEM extends UserMenuItem>, UserMenuItem.HasSubMenu
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final com.vaadin.flow.component.Component
     

    Fields inherited from interface io.jmix.flowui.kit.component.usermenu.UserMenuItem

    PROP_CHECKABLE, PROP_CHECKED, PROP_ENABLED, PROP_VISIBLE
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    SeparatorUserMenuItem(com.vaadin.flow.component.Component separator)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.vaadin.flow.shared.Registration
    Adds a listener to be notified about changes in the properties of the action.
    com.vaadin.flow.dom.Element
     
    Returns the unique identifier of the user menu item.
    Returns a sub part object by its name.
    boolean
    Returns whether this item toggles a checkmark icon when clicked.
    boolean
    Returns the checked state of this item.
    boolean
    Checks whether the user menu item is currently enabled.
    boolean
    Checks whether the user menu item is currently visible.
    void
    setCheckable(boolean checkable)
    Sets the checkable state of this menu item.
    void
    setChecked(boolean checked)
    Sets the checked state of this item.
    void
    setEnabled(boolean enabled)
    Enables or disables the user menu item.
    void
    setVisible(boolean visible)
    Sets the visibility of the user menu item.

    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.HasTheme

    addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName

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

    addThemeVariants, removeThemeVariants
  • Field Details

    • separator

      protected final com.vaadin.flow.component.Component separator
  • Constructor Details

    • SeparatorUserMenuItem

      protected SeparatorUserMenuItem(com.vaadin.flow.component.Component separator)
  • Method Details

    • getId

      public String getId()
      Description copied from interface: UserMenuItem
      Returns the unique identifier of the user menu item.
      Specified by:
      getId in interface UserMenuItem
      Returns:
      the unique identifier of the menu item
    • setVisible

      public void setVisible(boolean visible)
      Description copied from interface: UserMenuItem
      Sets the visibility of the user menu item. A visible item is rendered and can interact with users, while an invisible item is not displayed and cannot be interacted with.
      Specified by:
      setVisible in interface UserMenuItem
      Parameters:
      visible - if true, the item will be visible; otherwise, it will be hidden
    • isVisible

      public boolean isVisible()
      Description copied from interface: UserMenuItem
      Checks whether the user menu item is currently visible. A visible item is displayed in the dropdown and can interact with users, whereas an invisible item is hidden and cannot be interacted with.
      Specified by:
      isVisible in interface UserMenuItem
      Returns:
      true if the item is visible, false otherwise
    • setEnabled

      public void setEnabled(boolean enabled)
      Description copied from interface: UserMenuItem
      Enables or disables the user menu item. When the item is disabled, it cannot be interacted with.
      Specified by:
      setEnabled in interface UserMenuItem
      Parameters:
      enabled - if true, the item will be enabled; otherwise, it will be disabled
    • isEnabled

      public boolean isEnabled()
      Description copied from interface: UserMenuItem
      Checks whether the user menu item is currently enabled. An enabled item can be interacted with, whereas a disabled item cannot.
      Specified by:
      isEnabled in interface UserMenuItem
      Returns:
      true if the item is enabled, false otherwise
    • isCheckable

      public boolean isCheckable()
      Description copied from interface: UserMenuItem
      Returns whether this item toggles a checkmark icon when clicked.
      Specified by:
      isCheckable in interface UserMenuItem
      Returns:
      the checkable state of the item
      See Also:
    • setCheckable

      public void setCheckable(boolean checkable)
      Description copied from interface: UserMenuItem
      Sets the checkable state of this menu item. A checkable item toggles a checkmark icon when clicked. Changes in the checked state can be handled in the item's click handler with UserMenuItem.isChecked().

      Setting a checked item un-checkable also makes it un-checked.

      Specified by:
      setCheckable in interface UserMenuItem
      Parameters:
      checkable - true to enable toggling the checked-state of this menu item by clicking, false to disable it.
    • isChecked

      public boolean isChecked()
      Description copied from interface: UserMenuItem
      Returns the checked state of this item. The item can be checked and un-checked with UserMenuItem.setChecked(boolean) or by clicking it when it is checkable. A checked item displays a checkmark icon inside it.
      Specified by:
      isChecked in interface UserMenuItem
      Returns:
      true if the item is checked, false otherwise
      See Also:
    • setChecked

      public void setChecked(boolean checked)
      Description copied from interface: UserMenuItem
      Sets the checked state of this item. A checked item displays a checkmark icon next to it. The checked state is also toggled by clicking the item.

      Note that the item needs to be explicitly set as checkable via UserMenuItem.setCheckable(boolean) in order to check it.

      Specified by:
      setChecked in interface UserMenuItem
      Parameters:
      checked - true to check this item, false to un-check it
    • addPropertyChangeListener

      public com.vaadin.flow.shared.Registration addPropertyChangeListener(Consumer<PropertyChangeEvent> listener)
      Description copied from interface: UserMenuItem
      Adds a listener to be notified about changes in the properties of the action.
      Specified by:
      addPropertyChangeListener in interface UserMenuItem
      Parameters:
      listener - listener to add
      Returns:
      a registration object for removing an event listener
    • getElement

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

      @Nullable public Object getSubPart(String name)
      Description copied from interface: HasSubParts
      Returns a sub part object by its name.
      Specified by:
      getSubPart in interface HasSubParts
      Parameters:
      name - sub part name, e.g. component id
      Returns:
      a sub part object by its name, or null if not found