Interface HasMenuItems

All Superinterfaces:
Serializable
All Known Implementing Classes:
ContextMenu, SubMenu

public interface HasMenuItems extends Serializable
A common interface for components that can have MenuItems with click listeners inside them.
Author:
Vaadin Ltd.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    addItem(com.vaadin.flow.component.Component component, com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.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, com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.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

      MenuItem addItem(String text, com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.ClickEvent<MenuItem>> clickListener)
      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 item
      clickListener - the handler for clicking the new item, can be null to not add listener
      Returns:
      the added MenuItem component
      See Also:
    • addItem

      MenuItem addItem(com.vaadin.flow.component.Component component, com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.ClickEvent<MenuItem>> clickListener)
      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 item
      clickListener - the handler for clicking the new item, can be null to not add listener
      Returns:
      the added MenuItem component
      See Also: