Interface HasTextMenuItems
- 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 text and icon.-
Method Summary
Modifier and TypeMethodDescriptionaddTextItem(String id, String text) Adds a new menu item with the specified ID and text.addTextItem(String id, String text, int index) Adds a new menu item with the specified ID and text at the given index.addTextItem(String id, String text, com.vaadin.flow.component.Component icon) Adds a new menu item with the specified ID, text and icon.addTextItem(String id, String text, com.vaadin.flow.component.Component icon, int index) Adds a new menu item with the specified ID, text and icon at the given index.addTextItem(String id, String text, com.vaadin.flow.component.Component icon, Consumer<UserMenuItem.HasClickListener.ClickEvent<TextUserMenuItem>> listener) Adds a new menu item with the specified ID, text, icon and click listener.addTextItem(String id, String text, com.vaadin.flow.component.Component icon, Consumer<UserMenuItem.HasClickListener.ClickEvent<TextUserMenuItem>> listener, int index) Adds a new menu item with the specified ID, text, icon and click listener at the given index.addTextItem(String id, String text, Consumer<UserMenuItem.HasClickListener.ClickEvent<TextUserMenuItem>> listener) Adds a new menu item with the specified ID, text and click listener.addTextItem(String id, String text, Consumer<UserMenuItem.HasClickListener.ClickEvent<TextUserMenuItem>> listener, int index) Adds a new menu item with the specified ID, text and click listener at the given index.Methods inherited from interface io.jmix.flowui.kit.component.usermenu.HasMenuItems
addSeparator, addSeparatorAtIndex, findItem, getItem, getItems, remove, remove, removeAll
-
Method Details
-
addTextItem
Adds a new menu item with the specified ID and text.- Parameters:
id- unique identifier for the menu itemtext- text to be displayed in the menu item- Returns:
- newly created menu item
-
addTextItem
Adds a new menu item with the specified ID and text at the given index.- Parameters:
id- unique identifier for the menu itemtext- text to be displayed in the menu itemindex- position at which to insert the menu item- Returns:
- newly created menu item
-
addTextItem
TextUserMenuItem addTextItem(String id, String text, Consumer<UserMenuItem.HasClickListener.ClickEvent<TextUserMenuItem>> listener) Adds a new menu item with the specified ID, text and click listener.- Parameters:
id- unique identifier for the menu itemtext- text to be displayed in the menu itemlistener- callback to be invoked when the menu item is clicked- Returns:
- newly created menu item
-
addTextItem
TextUserMenuItem addTextItem(String id, String text, Consumer<UserMenuItem.HasClickListener.ClickEvent<TextUserMenuItem>> listener, int index) Adds a new menu item with the specified ID, text and click listener at the given index.- Parameters:
id- unique identifier for the menu itemtext- text to be displayed in the menu itemlistener- callback to be invoked when the menu item is clickedindex- position at which to insert the menu item- Returns:
- newly created menu item
-
addTextItem
Adds a new menu item with the specified ID, text and icon.- Parameters:
id- unique identifier for the menu itemtext- text to be displayed in the menu itemicon- icon component to be displayed in the menu item- Returns:
- newly created menu item
-
addTextItem
TextUserMenuItem addTextItem(String id, String text, com.vaadin.flow.component.Component icon, int index) Adds a new menu item with the specified ID, text and icon at the given index.- Parameters:
id- unique identifier for the menu itemtext- text to be displayed in the menu itemicon- icon component to be displayed in the menu itemindex- position at which to insert the menu item- Returns:
- newly created menu item
-
addTextItem
TextUserMenuItem addTextItem(String id, String text, com.vaadin.flow.component.Component icon, Consumer<UserMenuItem.HasClickListener.ClickEvent<TextUserMenuItem>> listener) Adds a new menu item with the specified ID, text, icon and click listener.- Parameters:
id- unique identifier for the menu itemtext- text to be displayed in the menu itemicon- icon component to be displayed in the menu itemlistener- callback to be invoked when the menu item is clicked- Returns:
- newly created menu item
-
addTextItem
TextUserMenuItem addTextItem(String id, String text, com.vaadin.flow.component.Component icon, Consumer<UserMenuItem.HasClickListener.ClickEvent<TextUserMenuItem>> listener, int index) Adds a new menu item with the specified ID, text, icon and click listener at the given index.- Parameters:
id- unique identifier for the menu itemtext- text to be displayed in the menu itemicon- icon component to be displayed in the menu itemlistener- callback to be invoked when the menu item is clickedindex- position at which to insert the menu item- Returns:
- newly created menu item
-