com.vaadin.flow.component.contextmenu.
Interface HasMenuItems
All Superinterfaces:
All Known Implementing Classes:
A common interface for components that can have MenuItem
s with click
listeners inside them.
Author:
Vaadin Ltd.
See Also:
-
Method Summary
Modifier and TypeMethodDescriptionaddItem
(Component component, ComponentEventListener<ClickEvent<MenuItem>> clickListener) Creates a new menu item with the given component content and click listener and adds it to the context menu overlay.
addItem
(String text, ComponentEventListener<ClickEvent<MenuItem>> clickListener) Creates a new menu item with the given text content and click listener and adds it to the context menu overlay.
-
Method Details
-
addItem
Creates a new menu item with the given text content and click listener and adds it to the context menu overlay.
Parameters:
text
- the text content for the new itemclickListener
- the handler for clicking the new item, can benull
to not add listenerReturns:
the added
MenuItem
componentSee Also:
-
addItem
Creates a new menu item with the given component content and click listener and adds it to the context menu overlay.
Parameters:
component
- the component inside the new itemclickListener
- the handler for clicking the new item, can benull
to not add listenerReturns:
the added
MenuItem
componentSee Also:
-