public class GridMenuItem<T> extends MenuItemBase<GridContextMenu<T>,GridMenuItem<T>,GridSubMenu<T>>
GridContextMenu
and GridSubMenu
.
This component can be created and added to a menu overlay with
HasGridMenuItems.addItem(String, ComponentEventListener)
and similar
methods.Constructor and Description |
---|
GridMenuItem(GridContextMenu<T> contextMenu,
SerializableRunnable contentReset)
Creates a new instance using the context menu and its reset callback.
|
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() |
addThemeNames, executeJsWhenAttached, getContextMenu, getSubMenu, hasThemeName, isCheckable, isChecked, isParentItem, removeThemeNames, setCheckable, setChecked
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisible
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
add, add, addComponentAsFirst, addComponentAtIndex, remove, removeAll
isEnabled, setEnabled
getElement
addAttachListener
addDetachListener
public GridMenuItem(GridContextMenu<T> contextMenu, SerializableRunnable contentReset)
contextMenu
- the context menu, not null
contentReset
- the callback to reset the context menu, not null
public Registration addMenuItemClickListener(ComponentEventListener<GridContextMenu.GridContextMenuItemClickEvent<T>> clickListener)
GridContextMenu.GridContextMenuItemClickEvent
contains
information of which item inside the Grid was targeted when the context
menu was opened.clickListener
- the click listener to addprotected GridSubMenu<T> createSubMenu()
createSubMenu
in class MenuItemBase<GridContextMenu<T>,GridMenuItem<T>,GridSubMenu<T>>
Copyright © 2023. All rights reserved.