public class GridContextMenu<T> extends com.vaadin.flow.component.contextmenu.ContextMenuBase<GridContextMenu<T>,GridMenuItem<T>,GridSubMenu<T>>
<vaadin-context-menu> to be used with
Grid.| Modifier and Type | Class and Description |
|---|---|
static class |
GridContextMenu.GridContextMenuItemClickEvent<T>
Event that is fired when a
GridMenuItem is clicked inside a
GridContextMenu. |
| Constructor and Description |
|---|
GridContextMenu()
Creates an empty context menu to be used with a Grid.
|
GridContextMenu(Grid<T> target)
Creates an empty context menu with the given target component.
|
| Modifier and Type | Method and Description |
|---|---|
GridMenuItem<T> |
addItem(com.vaadin.flow.component.Component component,
com.vaadin.flow.component.ComponentEventListener<GridContextMenu.GridContextMenuItemClickEvent<T>> clickListener)
Adds a new item component with the given component and click listener to
the context menu overlay.
|
GridMenuItem<T> |
addItem(String text,
com.vaadin.flow.component.ComponentEventListener<GridContextMenu.GridContextMenuItemClickEvent<T>> clickListener)
Adds a new item component with the given text content and click listener
to the context menu overlay.
|
protected com.vaadin.flow.component.contextmenu.MenuManager<GridContextMenu<T>,GridMenuItem<T>,GridSubMenu<T>> |
createMenuManager(com.vaadin.flow.function.SerializableRunnable contentReset) |
void |
setTarget(com.vaadin.flow.component.Component target) |
add, addComponentAtIndex, addItem, addItem, addOpenedChangeListener, close, getChildren, getItems, getMenuManager, getTarget, isOpened, isOpenOnClick, remove, removeAll, setOpenOnClickgetCloseOnString, getListenOnJsonObject, getOpenOnString, getSelectorString, isOpenedBoolean, open, setCloseOn, setListenOn, setOpenOn, setSelectoraddListener, fireEvent, from, get, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getUI, hasListener, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisibleclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNamepublic GridContextMenu()
public GridContextMenu(Grid<T> target)
target - the target component for this context menusetTarget(Component)public void setTarget(com.vaadin.flow.component.Component target)
setTarget in class com.vaadin.flow.component.contextmenu.ContextMenuBase<GridContextMenu<T>,GridMenuItem<T>,GridSubMenu<T>>IllegalArgumentException - if the given target is not an instance of Gridpublic GridMenuItem<T> addItem(String text, com.vaadin.flow.component.ComponentEventListener<GridContextMenu.GridContextMenuItemClickEvent<T>> clickListener)
This is a convenience method for the use case where you have a list of
highlightable GridMenuItems inside the overlay. If you want to
configure the contents of the overlay without wrapping them inside
GridMenuItems, or if you just want to add some non-highlightable
components between the items, use the
ContextMenuBase.add(Component...) method.
text - the text content for the new itemclickListener - the handler for clicking the new item, can be null to
not add listenerGridMenuItem componentaddItem(Component, ComponentEventListener),
ContextMenuBase.add(Component...),
SubMenuBase.add(Component...)public GridMenuItem<T> addItem(com.vaadin.flow.component.Component component, com.vaadin.flow.component.ComponentEventListener<GridContextMenu.GridContextMenuItemClickEvent<T>> clickListener)
This is a convenience method for the use case where you have a list of
highlightable GridMenuItems inside the overlay. If you want to
configure the contents of the overlay without wrapping them inside
GridMenuItems, or if you just want to add some non-highlightable
components between the items, use the
ContextMenuBase.add(Component...) method.
component - the component inside the new itemclickListener - the handler for clicking the new item, can be null to
not add listenerGridMenuItem componentaddItem(String, ComponentEventListener),
ContextMenuBase.add(Component...),
SubMenuBase.add(Component...)protected com.vaadin.flow.component.contextmenu.MenuManager<GridContextMenu<T>,GridMenuItem<T>,GridSubMenu<T>> createMenuManager(com.vaadin.flow.function.SerializableRunnable contentReset)
createMenuManager in class com.vaadin.flow.component.contextmenu.ContextMenuBase<GridContextMenu<T>,GridMenuItem<T>,GridSubMenu<T>>Copyright © 2019. All rights reserved.