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,HasAriaLabel,HasComponents,HasElement,HasEnabled,HasStyle,HasText,Serializable
public class GridMenuItem<T>
extends MenuItemBase<GridContextMenu<T>,GridMenuItem<T>,GridSubMenu<T>>
Item component used inside
GridContextMenu and GridSubMenu.
This component can be created and added to a menu overlay with
HasGridMenuItems.addItem(String, ComponentEventListener) and similar
methods.- Author:
- Vaadin Ltd.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasText
HasText.WhiteSpace -
Constructor Summary
ConstructorsConstructorDescriptionGridMenuItem(GridContextMenu<T> contextMenu, SerializableRunnable contentReset) Creates a new instance using the context menu and its reset callback. -
Method Summary
Modifier and TypeMethodDescriptionaddMenuItemClickListener(ComponentEventListener<GridContextMenu.GridContextMenuItemClickEvent<T>> clickListener) Adds the given click listener for this menu item.protected GridSubMenu<T>Methods inherited from class com.vaadin.flow.component.contextmenu.MenuItemBase
addThemeNames, executeJsWhenAttached, getContextMenu, getSubMenu, hasThemeName, isCheckable, isChecked, isDisableOnClick, isKeepOpen, isParentItem, removeThemeNames, setCheckable, setChecked, setDisableOnClick, setEnabled, setKeepOpenMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasAriaLabel
getAriaLabel, getAriaLabelledBy, setAriaLabel, setAriaLabelledByMethods inherited from interface com.vaadin.flow.component.HasComponents
add, add, add, addComponentAsFirst, addComponentAtIndex, remove, remove, removeAllMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabledMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasText
getText, getWhiteSpace, setText, setWhiteSpace
-
Constructor Details
-
Method Details
-
addMenuItemClickListener
public Registration addMenuItemClickListener(ComponentEventListener<GridContextMenu.GridContextMenuItemClickEvent<T>> clickListener) Adds the given click listener for this menu item. The firedGridContextMenu.GridContextMenuItemClickEventcontains information of which item inside the Grid was targeted when the context menu was opened.- Parameters:
clickListener- the click listener to add- Returns:
- a handle for removing the listener
-
createSubMenu
- Specified by:
createSubMenuin classMenuItemBase<GridContextMenu<T>,GridMenuItem<T>, GridSubMenu<T>>
-