Class GridSubMenu<T>
- java.lang.Object
-
- com.vaadin.flow.component.contextmenu.SubMenuBase<GridContextMenu<T>,GridMenuItem<T>,GridSubMenu<T>>
-
- com.vaadin.flow.component.grid.contextmenu.GridSubMenu<T>
-
- All Implemented Interfaces:
Serializable
public class GridSubMenu<T> extends SubMenuBase<GridContextMenu<T>,GridMenuItem<T>,GridSubMenu<T>>
API that allows adding content into the sub menus of aGridContextMenu
to create hierarchical menus. Get it by callingMenuItemBase.getSubMenu()
on the item component that should open the sub menu. Sub menu will be rendered only if content has been added inside it.- Author:
- Vaadin Ltd.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GridSubMenu(GridMenuItem<T> parentMenuItem, SerializableRunnable contentReset)
Creates a new instance of submenu using the associatedparentMenuItem
(item which opens the submenu) and reset context menu callback.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GridMenuItem<T>
addItem(Component component, ComponentEventListener<GridContextMenu.GridContextMenuItemClickEvent<T>> clickListener)
GridMenuItem<T>
addItem(String text, ComponentEventListener<GridContextMenu.GridContextMenuItemClickEvent<T>> clickListener)
protected MenuManager<GridContextMenu<T>,GridMenuItem<T>,GridSubMenu<T>>
createMenuManager()
Creates a (sub) menu manager instance which contains logic to control the (sub) menu content.-
Methods inherited from class com.vaadin.flow.component.contextmenu.SubMenuBase
add, addComponentAtIndex, addItem, addItem, getChildren, getItems, getMenuManager, getParentMenuItem, remove, removeAll
-
-
-
-
Constructor Detail
-
GridSubMenu
public GridSubMenu(GridMenuItem<T> parentMenuItem, SerializableRunnable contentReset)
Creates a new instance of submenu using the associatedparentMenuItem
(item which opens the submenu) and reset context menu callback.- Parameters:
parentMenuItem
- the associated menu item, notnull
contentReset
- the context menu reset callback, notnull
-
-
Method Detail
-
addItem
public GridMenuItem<T> addItem(String text, ComponentEventListener<GridContextMenu.GridContextMenuItemClickEvent<T>> clickListener)
-
addItem
public GridMenuItem<T> addItem(Component component, ComponentEventListener<GridContextMenu.GridContextMenuItemClickEvent<T>> clickListener)
-
createMenuManager
protected MenuManager<GridContextMenu<T>,GridMenuItem<T>,GridSubMenu<T>> createMenuManager()
Description copied from class:SubMenuBase
Creates a (sub) menu manager instance which contains logic to control the (sub) menu content.- Specified by:
createMenuManager
in classSubMenuBase<GridContextMenu<T>,GridMenuItem<T>,GridSubMenu<T>>
- Returns:
- a new menu manager instance
-
-