Class JmixMenuManager<C extends com.vaadin.flow.component.Component,I extends com.vaadin.flow.component.contextmenu.MenuItemBase<?,I,S>,S extends com.vaadin.flow.component.contextmenu.SubMenuBase<?,I,S>>

java.lang.Object
com.vaadin.flow.component.contextmenu.MenuManager<C,I,S>
io.jmix.flowui.kit.component.contextmenu.JmixMenuManager<C,I,S>
Type Parameters:
C - the context menu type
I - the menu item type
S - the sub menu type
All Implemented Interfaces:
Serializable

public class JmixMenuManager<C extends com.vaadin.flow.component.Component,I extends com.vaadin.flow.component.contextmenu.MenuItemBase<?,I,S>,S extends com.vaadin.flow.component.contextmenu.SubMenuBase<?,I,S>> extends com.vaadin.flow.component.contextmenu.MenuManager<C,I,S>
Common management logic for context menus and sub menus. Maintains the list of components to stamp into one overlay.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    JmixMenuManager(C menu, com.vaadin.flow.function.SerializableRunnable contentReset, com.vaadin.flow.function.SerializableBiFunction<C,com.vaadin.flow.function.SerializableRunnable,I> itemGenerator, Class<I> itemType, I parentMenuItem)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    addItemAtIndex(int index, com.vaadin.flow.component.Component component)
    Adds a component as a menu item at the given position.
    addItemAtIndex(int index, com.vaadin.flow.component.Component component, com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.ClickEvent<I>> clickListener)
    Adds a component as a menu item with a click listener at the given position.
    addItemAtIndex(int index, String text)
    Adds a text as a menu item at the given position.
    addItemAtIndex(int index, String text, com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.ClickEvent<I>> clickListener)
    Adds a text as a menu item with a click listener at the given position.

    Methods inherited from class com.vaadin.flow.component.contextmenu.MenuManager

    add, addComponentAtIndex, addItem, addItem, addItem, addItem, getChildren, getItems, remove, removeAll

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JmixMenuManager

      public JmixMenuManager(C menu, com.vaadin.flow.function.SerializableRunnable contentReset, com.vaadin.flow.function.SerializableBiFunction<C,com.vaadin.flow.function.SerializableRunnable,I> itemGenerator, Class<I> itemType, @Nullable I parentMenuItem)
  • Method Details

    • addItemAtIndex

      public I addItemAtIndex(int index, String text)
      Adds a text as a menu item at the given position.
      Parameters:
      index - item position
      text - the text for the menu item
      Returns:
      a new menu item
    • addItemAtIndex

      public I addItemAtIndex(int index, com.vaadin.flow.component.Component component)
      Adds a component as a menu item at the given position.
      Parameters:
      index - item position
      component - the component for the menu item
      Returns:
      a new menu item
    • addItemAtIndex

      public I addItemAtIndex(int index, String text, @Nullable com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.ClickEvent<I>> clickListener)
      Adds a text as a menu item with a click listener at the given position.
      Parameters:
      index - item position
      text - the text for the menu item
      clickListener - a click listener
      Returns:
      a new menu item
    • addItemAtIndex

      public I addItemAtIndex(int index, com.vaadin.flow.component.Component component, @Nullable com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.ClickEvent<I>> clickListener)
      Adds a component as a menu item with a click listener at the given position.
      Parameters:
      index - item position
      component - the component for the menu item
      clickListener - a click listener
      Returns:
      a new menu item