Interface HasComponentMenuItems

All Superinterfaces:
HasMenuItems
All Known Subinterfaces:
UserMenuItem.HasSubMenu.SubMenu
All Known Implementing Classes:
JmixUserMenu, JmixUserMenu.JmixUserMenuSubMenu, JmixUserMenuItemsDelegate, UserMenu, UserMenu.UserMenuSubMenu, UserMenuItemsDelegate

public interface HasComponentMenuItems extends HasMenuItems
Defines a set of methods for JmixUserMenu components where menu items can contain UI Component elements.
  • Method Details

    • addComponentItem

      ComponentUserMenuItem addComponentItem(String id, com.vaadin.flow.component.Component content)
      Adds a new menu item with a unique identifier and a custom UI Component as its content.
      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

      ComponentUserMenuItem addComponentItem(String id, com.vaadin.flow.component.Component content, int index)
      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.
      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

      ComponentUserMenuItem addComponentItem(String id, com.vaadin.flow.component.Component content, Consumer<UserMenuItem.HasClickListener.ClickEvent<ComponentUserMenuItem>> listener)
      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.
      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

      ComponentUserMenuItem addComponentItem(String id, com.vaadin.flow.component.Component content, Consumer<UserMenuItem.HasClickListener.ClickEvent<ComponentUserMenuItem>> listener, int index)
      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.
      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