Class JmixUserMenu.JmixUserMenuSubMenu

java.lang.Object
io.jmix.flowui.kit.component.usermenu.JmixUserMenu.JmixUserMenuSubMenu
All Implemented Interfaces:
HasActionMenuItems, HasComponentMenuItems, HasMenuItems, HasTextMenuItems, UserMenuItem.HasSubMenu.SubMenu
Direct Known Subclasses:
UserMenu.UserMenuSubMenu
Enclosing class:
JmixUserMenu<USER>

protected static class JmixUserMenu.JmixUserMenuSubMenu extends Object implements UserMenuItem.HasSubMenu.SubMenu
  • Field Details

  • Constructor Details

  • Method Details

    • addTextItem

      public TextUserMenuItem addTextItem(String id, String text)
      Description copied from interface: HasTextMenuItems
      Adds a new menu item with the specified ID and text.
      Specified by:
      addTextItem in interface HasTextMenuItems
      Parameters:
      id - unique identifier for the menu item
      text - text to be displayed in the menu item
      Returns:
      newly created menu item
    • addTextItem

      public TextUserMenuItem addTextItem(String id, String text, int index)
      Description copied from interface: HasTextMenuItems
      Adds a new menu item with the specified ID and text at the given index.
      Specified by:
      addTextItem in interface HasTextMenuItems
      Parameters:
      id - unique identifier for the menu item
      text - text to be displayed in the menu item
      index - position at which to insert the menu item
      Returns:
      newly created menu item
    • addTextItem

      Description copied from interface: HasTextMenuItems
      Adds a new menu item with the specified ID, text and click listener.
      Specified by:
      addTextItem in interface HasTextMenuItems
      Parameters:
      id - unique identifier for the menu item
      text - text to be displayed in the menu item
      listener - callback to be invoked when the menu item is clicked
      Returns:
      newly created menu item
    • addTextItem

      public TextUserMenuItem addTextItem(String id, String text, Consumer<UserMenuItem.HasClickListener.ClickEvent<TextUserMenuItem>> listener, int index)
      Description copied from interface: HasTextMenuItems
      Adds a new menu item with the specified ID, text and click listener at the given index.
      Specified by:
      addTextItem in interface HasTextMenuItems
      Parameters:
      id - unique identifier for the menu item
      text - text to be displayed in the menu item
      listener - callback to be invoked when the menu item is clicked
      index - position at which to insert the menu item
      Returns:
      newly created menu item
    • addTextItem

      public TextUserMenuItem addTextItem(String id, String text, com.vaadin.flow.component.Component icon)
      Description copied from interface: HasTextMenuItems
      Adds a new menu item with the specified ID, text and icon.
      Specified by:
      addTextItem in interface HasTextMenuItems
      Parameters:
      id - unique identifier for the menu item
      text - text to be displayed in the menu item
      icon - icon component to be displayed in the menu item
      Returns:
      newly created menu item
    • addTextItem

      public TextUserMenuItem addTextItem(String id, String text, com.vaadin.flow.component.Component icon, int index)
      Description copied from interface: HasTextMenuItems
      Adds a new menu item with the specified ID, text and icon at the given index.
      Specified by:
      addTextItem in interface HasTextMenuItems
      Parameters:
      id - unique identifier for the menu item
      text - text to be displayed in the menu item
      icon - icon component to be displayed in the menu item
      index - position at which to insert the menu item
      Returns:
      newly created menu item
    • addTextItem

      public TextUserMenuItem addTextItem(String id, String text, com.vaadin.flow.component.Component icon, Consumer<UserMenuItem.HasClickListener.ClickEvent<TextUserMenuItem>> listener)
      Description copied from interface: HasTextMenuItems
      Adds a new menu item with the specified ID, text, icon and click listener.
      Specified by:
      addTextItem in interface HasTextMenuItems
      Parameters:
      id - unique identifier for the menu item
      text - text to be displayed in the menu item
      icon - icon component to be displayed in the menu item
      listener - callback to be invoked when the menu item is clicked
      Returns:
      newly created menu item
    • addTextItem

      public TextUserMenuItem addTextItem(String id, String text, com.vaadin.flow.component.Component icon, Consumer<UserMenuItem.HasClickListener.ClickEvent<TextUserMenuItem>> listener, int index)
      Description copied from interface: HasTextMenuItems
      Adds a new menu item with the specified ID, text, icon and click listener at the given index.
      Specified by:
      addTextItem in interface HasTextMenuItems
      Parameters:
      id - unique identifier for the menu item
      text - text to be displayed in the menu item
      icon - icon component to be displayed in the menu item
      listener - callback to be invoked when the menu item is clicked
      index - position at which to insert the menu item
      Returns:
      newly created menu item
    • addActionItem

      public ActionUserMenuItem addActionItem(String id, Action action)
      Description copied from interface: HasActionMenuItems
      Adds a new menu item with the specified identifier and associated action.
      Specified by:
      addActionItem in interface HasActionMenuItems
      Parameters:
      id - the unique identifier of the menu item
      action - the Action to associate with the menu item
      Returns:
      the created ActionUserMenuItem instance
    • addActionItem

      public ActionUserMenuItem addActionItem(String id, Action action, int index)
      Description copied from interface: HasActionMenuItems
      Adds a new menu item with the specified identifier, associated action, and specified index where the item should be inserted.
      Specified by:
      addActionItem in interface HasActionMenuItems
      Parameters:
      id - the unique identifier of the menu item
      action - the Action to associate with the menu item
      index - the position at which the menu item should be inserted
      Returns:
      the created ActionUserMenuItem instance
    • addComponentItem

      public ComponentUserMenuItem addComponentItem(String id, com.vaadin.flow.component.Component content)
      Description copied from interface: HasComponentMenuItems
      Adds a new menu item with a unique identifier and a custom UI Component as its content.
      Specified by:
      addComponentItem in interface HasComponentMenuItems
      Parameters:
      id - the unique identifier of the menu item
      content - the Component to be set as the content of the menu item
      Returns:
      the created ComponentUserMenuItem instance
    • addComponentItem

      public ComponentUserMenuItem addComponentItem(String id, com.vaadin.flow.component.Component content, int index)
      Description copied from interface: HasComponentMenuItems
      Adds a new menu item with a unique identifier, a custom UI Component as its content, and inserts it at a specific position in the menu.
      Specified by:
      addComponentItem in interface HasComponentMenuItems
      Parameters:
      id - the unique identifier of the menu item
      content - the Component to be set as the content of the menu item
      index - the position at which the menu item will be inserted
      Returns:
      the created ComponentUserMenuItem instance
    • addComponentItem

      public ComponentUserMenuItem addComponentItem(String id, com.vaadin.flow.component.Component content, Consumer<UserMenuItem.HasClickListener.ClickEvent<ComponentUserMenuItem>> listener)
      Description copied from interface: HasComponentMenuItems
      Adds a new menu item with a unique identifier, a custom UI Component as its content, and a click listener to handle click events for the menu item.
      Specified by:
      addComponentItem in interface HasComponentMenuItems
      Parameters:
      id - the unique identifier of the menu item
      content - the Component to be set as the content of the menu item
      listener - the Consumer that handles the click events triggered by the menu item
      Returns:
      the created ComponentUserMenuItem instance
    • addComponentItem

      public ComponentUserMenuItem addComponentItem(String id, com.vaadin.flow.component.Component content, Consumer<UserMenuItem.HasClickListener.ClickEvent<ComponentUserMenuItem>> listener, int index)
      Description copied from interface: HasComponentMenuItems
      Adds a new menu item with a unique identifier, a custom UI Component as its content, a click listener to handle click events for the menu item, and inserts it at a specific position in the menu.
      Specified by:
      addComponentItem in interface HasComponentMenuItems
      Parameters:
      id - the unique identifier of the menu item
      content - the Component to be set as the content of the menu item
      listener - the Consumer that handles the click events triggered by the menu item
      index - the position at which the menu item will be inserted
      Returns:
      the created ComponentUserMenuItem instance
    • addSeparator

      public void addSeparator()
      Description copied from interface: HasMenuItems
      Adds a separator to the menu. A separator is used to visually divide groups of menu items, enabling better organization and readability.
      Specified by:
      addSeparator in interface HasMenuItems
    • addSeparatorAtIndex

      public void addSeparatorAtIndex(int index)
      Description copied from interface: HasMenuItems
      Adds a separator to the menu at the specified index. A separator is used to visually divide groups of menu items, enhancing organization and readability. The given index determines the position where the separator is inserted.
      Specified by:
      addSeparatorAtIndex in interface HasMenuItems
      Parameters:
      index - the position in the menu where the separator will be added. The index must be within the valid range of current menu items.
    • findItem

      public Optional<UserMenuItem> findItem(String itemId)
      Description copied from interface: HasMenuItems
      Searches for a user menu item with the specified unique identifier.
      Specified by:
      findItem in interface HasMenuItems
      Parameters:
      itemId - the unique identifier of the menu item to find
      Returns:
      an Optional containing the UserMenuItem if found, or an empty Optional if the item does not exist
    • getItem

      public UserMenuItem getItem(String itemId)
      Description copied from interface: HasMenuItems
      Retrieves a user menu item with the specified unique identifier.
      Specified by:
      getItem in interface HasMenuItems
      Parameters:
      itemId - the unique identifier of the menu item to retrieve
      Returns:
      the UserMenuItem associated with the given identifier
    • getItems

      public List<UserMenuItem> getItems()
      Description copied from interface: HasMenuItems
      Returns a list of all items currently present in the user menu component.
      Specified by:
      getItems in interface HasMenuItems
      Returns:
      a list of all items currently present in the user menu component
    • remove

      public void remove(String itemId)
      Description copied from interface: HasMenuItems
      Removes a menu item identified by the specified unique identifier from the menu.
      Specified by:
      remove in interface HasMenuItems
      Parameters:
      itemId - the unique identifier of the menu item to be removed
    • remove

      public void remove(UserMenuItem menuItem)
      Description copied from interface: HasMenuItems
      Removes the specified menu item from the user menu.
      Specified by:
      remove in interface HasMenuItems
      Parameters:
      menuItem - the UserMenuItem to be removed from the menu
    • removeAll

      public void removeAll()
      Description copied from interface: HasMenuItems
      Removes all menu items from the user menu.
      Specified by:
      removeAll in interface HasMenuItems
    • getItemsDelegate

      protected JmixUserMenuItemsDelegate getItemsDelegate()
    • createUserMenuItemsDelegate

      protected JmixUserMenuItemsDelegate createUserMenuItemsDelegate()