com.vaadin.flow.component.grid.contextmenu.
Class GridMenuItem<T>
- java.lang.Object
-
- com.vaadin.flow.component.Component
-
- com.vaadin.flow.component.contextmenu.MenuItemBase<GridContextMenu<T>,GridMenuItem<T>,GridSubMenu<T>>
-
- com.vaadin.flow.component.grid.contextmenu.GridMenuItem<T>
-
All Implemented Interfaces:
AttachNotifier, DetachNotifier, HasComponents, HasElement, HasEnabled, HasText, Serializable
public class GridMenuItem<T> extends MenuItemBase<GridContextMenu<T>,GridMenuItem<T>,GridSubMenu<T>>
Item component used inside
GridContextMenu
andGridSubMenu
. This component can be created and added to a menu overlay withHasGridMenuItems.addItem(String, ComponentEventListener)
and similar methods.Author:
Vaadin Ltd.
See Also:
-
-
Constructor Summary
Constructors Constructor and Description GridMenuItem(GridContextMenu<T> contextMenu, SerializableRunnable contentReset)
Creates a new instance using the context menu and its reset callback.
-
Method Summary
All Methods Modifier and Type Method and Description Registration
addMenuItemClickListener(ComponentEventListener<GridContextMenu.GridContextMenuItemClickEvent<T>> clickListener)
Adds the given click listener for this menu item.
protected GridSubMenu<T>
createSubMenu()
-
Methods inherited from class com.vaadin.flow.component.contextmenu.MenuItemBase
getContextMenu, getSubMenu, isCheckable, isChecked, isParentItem, setCheckable, setChecked
-
Methods inherited from class com.vaadin.flow.component.Component
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisible
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.flow.component.HasComponents
add, add, addComponentAsFirst, addComponentAtIndex, remove, removeAll
-
Methods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabled
-
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
-
Methods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListener
-
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
-
-
-
-
Constructor Detail
-
GridMenuItem
public GridMenuItem(GridContextMenu<T> contextMenu, SerializableRunnable contentReset)
Creates a new instance using the context menu and its reset callback.
Parameters:
contextMenu
- the context menu, notnull
contentReset
- the callback to reset the context menu, notnull
-
-
Method Detail
-
addMenuItemClickListener
public Registration addMenuItemClickListener(ComponentEventListener<GridContextMenu.GridContextMenuItemClickEvent<T>> clickListener)
Adds the given click listener for this menu item. The fired
GridContextMenu.GridContextMenuItemClickEvent
contains information of which item inside the Grid was targeted when the context menu was opened.Parameters:
clickListener
- the click listener to addReturns:
a handle for removing the listener
-
createSubMenu
protected GridSubMenu<T> createSubMenu()
Specified by:
createSubMenu
in classMenuItemBase<GridContextMenu<T>,GridMenuItem<T>,GridSubMenu<T>>
-
-