Class ListMenu

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<com.vaadin.flow.component.html.UnorderedList>
io.jmix.flowui.kit.component.main.ListMenu
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, Serializable
Direct Known Subclasses:
JmixListMenu

public class ListMenu extends com.vaadin.flow.component.Composite<com.vaadin.flow.component.html.UnorderedList> implements com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle
See Also:
  • Field Details

  • Constructor Details

    • ListMenu

      public ListMenu()
  • Method Details

    • initContent

      protected com.vaadin.flow.component.html.UnorderedList initContent()
      Overrides:
      initContent in class com.vaadin.flow.component.Composite<com.vaadin.flow.component.html.UnorderedList>
    • getMenuItem

      @Nullable public ListMenu.MenuItem getMenuItem(String id)
      Gets menu item from the menu by its ID.
      Parameters:
      id - menu item id
      Returns:
      menu item or null if not found
    • getMenuItems

      public List<ListMenu.MenuItem> getMenuItems()
      Returns:
      immutable list of root menu items
    • addMenuItem

      public void addMenuItem(ListMenu.MenuItem menuItem)
      Adds menu item and its children to the menu.
      Parameters:
      menuItem - menu item to add
    • addMenuItem

      public void addMenuItem(ListMenu.MenuItem menuItem, int index)
      Adds menu item and its children to the menu in specified index.

      If root menu items already contain provided menu item, it will be moved to the provided index.

      Parameters:
      menuItem - menu item to add
      index - index to add menu item in the root items
    • removeMenuItem

      public void removeMenuItem(ListMenu.MenuItem menuItem)
      Removes menu item and its children from the menu.
      Parameters:
      menuItem - menu item to remove
    • removeMenuItem

      public void removeMenuItem(int index)
      Removes root menu item by index.
      Parameters:
      index - index to remove from root menu items
    • removeAllMenuItems

      public void removeAllMenuItems()
      Removes all menu items from the menu.
    • addChildren

      protected void addChildren(ListMenu.MenuItem parent, ListMenu.MenuItem childItem)
    • addChildren

      protected void addChildren(ListMenu.MenuItem parent, ListMenu.MenuItem childItem, int index)
    • createMenuRecursively

      protected com.vaadin.flow.component.html.ListItem createMenuRecursively(ListMenu.MenuItem menuItem)
    • attachMenuItemRecursively

      protected void attachMenuItemRecursively(ListMenu.MenuItem menuItem)
    • detachMenuItemRecursively

      protected void detachMenuItemRecursively(ListMenu.MenuItem menuItem)
    • unregisterMenuItemRecursively

      protected void unregisterMenuItemRecursively(ListMenu.MenuItem menuItem)
    • registerMenuItem

      protected void registerMenuItem(ListMenu.MenuItem menuItem, com.vaadin.flow.component.html.ListItem menuItemComponent)
    • createMenuItemComponent

      protected com.vaadin.flow.router.RouterLink createMenuItemComponent(ListMenu.MenuItem menuItem)
    • addMenuItemClickListener

      protected void addMenuItemClickListener(com.vaadin.flow.router.RouterLink routerLink, ListMenu.MenuItem menuItem)
    • createMenuBarComponent

      protected com.vaadin.flow.component.details.Details createMenuBarComponent(ListMenu.MenuBarItem menuBarItem)
    • getMenuBarContent

      protected com.vaadin.flow.component.html.UnorderedList getMenuBarContent(ListMenu.MenuItem menuItem)
    • getMenuBarContent

      protected com.vaadin.flow.component.html.UnorderedList getMenuBarContent(com.vaadin.flow.component.details.Details menuBar)
    • getTitle

      protected String getTitle(ListMenu.MenuItem menuItem)
    • checkItemIdDuplicate

      protected void checkItemIdDuplicate(String id)