Interface HasComponentMenuItems
- All Superinterfaces:
HasMenuItems
- All Known Subinterfaces:
UserMenuItem.HasSubMenu.SubMenu
- All Known Implementing Classes:
JmixUserMenu,JmixUserMenu.JmixUserMenuSubMenu,JmixUserMenuItemsDelegate,UserMenu,UserMenu.UserMenuSubMenu,UserMenuItemsDelegate
Defines a set of methods for
JmixUserMenu components where menu items
can contain UI Component elements.-
Method Summary
Modifier and TypeMethodDescriptionaddComponentItem(String id, com.vaadin.flow.component.Component content) Adds a new menu item with a unique identifier and a custom UIComponentas its content.addComponentItem(String id, com.vaadin.flow.component.Component content, int index) Adds a new menu item with a unique identifier, a custom UIComponentas its content, and inserts it at a specific position in the menu.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 UIComponentas its content, and a click listener to handle click events for the menu item.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 UIComponentas its content, a click listener to handle click events for the menu item, and inserts it at a specific position in the menu.Methods inherited from interface io.jmix.flowui.kit.component.usermenu.HasMenuItems
addSeparator, addSeparatorAtIndex, findItem, getItem, getItems, remove, remove, removeAll
-
Method Details
-
addComponentItem
Adds a new menu item with a unique identifier and a custom UIComponentas its content.- Parameters:
id- the unique identifier of the menu itemcontent- theComponentto be set as the content of the menu item- Returns:
- the created
ComponentUserMenuIteminstance
-
addComponentItem
ComponentUserMenuItem addComponentItem(String id, com.vaadin.flow.component.Component content, int index) Adds a new menu item with a unique identifier, a custom UIComponentas its content, and inserts it at a specific position in the menu.- Parameters:
id- the unique identifier of the menu itemcontent- theComponentto be set as the content of the menu itemindex- the position at which the menu item will be inserted- Returns:
- the created
ComponentUserMenuIteminstance
-
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 UIComponentas its content, and a click listener to handle click events for the menu item.- Parameters:
id- the unique identifier of the menu itemcontent- theComponentto be set as the content of the menu itemlistener- theConsumerthat handles the click events triggered by the menu item- Returns:
- the created
ComponentUserMenuIteminstance
-
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 UIComponentas 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 itemcontent- theComponentto be set as the content of the menu itemlistener- theConsumerthat handles the click events triggered by the menu itemindex- the position at which the menu item will be inserted- Returns:
- the created
ComponentUserMenuIteminstance
-