Class ListMenu.MenuBarItem

java.lang.Object
io.jmix.flowui.kit.component.main.ListMenu.MenuItem
io.jmix.flowui.kit.component.main.ListMenu.MenuBarItem
Enclosing class:
ListMenu

public static class ListMenu.MenuBarItem extends ListMenu.MenuItem
Describes menu item that can contain other menu items.
  • Field Details

  • Constructor Details

    • MenuBarItem

      public MenuBarItem(String id)
  • Method Details

    • withTitle

      public ListMenu.MenuBarItem withTitle(@Nullable String title)
      Description copied from class: ListMenu.MenuItem
      Sets displayed menu item text.
      Overrides:
      withTitle in class ListMenu.MenuItem
      Parameters:
      title - displayed text
      Returns:
      current menu instance
    • withDescription

      public ListMenu.MenuBarItem withDescription(@Nullable String description)
      Description copied from class: ListMenu.MenuItem
      Sets menu item description that should be shown when the user moves cursor on item.
      Overrides:
      withDescription in class ListMenu.MenuItem
      Parameters:
      description - description to set
      Returns:
      current menu instance
    • withIcon

      public ListMenu.MenuBarItem withIcon(@Nullable com.vaadin.flow.component.icon.VaadinIcon icon)
      Description copied from class: ListMenu.MenuItem
      Sets icon that should be displayed to the left of the ListMenu.MenuItem.getTitle().
      Overrides:
      withIcon in class ListMenu.MenuItem
      Parameters:
      icon - icon to set
      Returns:
      current menu instance
    • withClassNames

      public ListMenu.MenuBarItem withClassNames(List<String> classNames)
      Description copied from class: ListMenu.MenuItem
      Sets class names that should be added to the menu item.
      Overrides:
      withClassNames in class ListMenu.MenuItem
      Parameters:
      classNames - class names to add
      Returns:
      current menu instance
    • isOpened

      public boolean isOpened()
      Returns:
      true if menu bar item initially should open list of sub menu items, false otherwise
    • setOpened

      public void setOpened(boolean opened)
      Sets whether menu bar item should open sub menu when it's added to the menu.
      Parameters:
      opened - open option
    • withOpened

      public ListMenu.MenuBarItem withOpened(boolean opened)
      Sets whether menu bar item should open sub menu when it's added to the menu.
      Parameters:
      opened - open option
      Returns:
      current menu bar item instance
    • addChildItem

      public void addChildItem(ListMenu.MenuItem menuItem)
      Adds menu item to the sub menu list.
      Parameters:
      menuItem - menu item to add
    • addChildItem

      public void addChildItem(ListMenu.MenuItem menuItem, int index)
      Adds menu item to the sub menu list by index.

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

      Parameters:
      menuItem - menu item to add
    • removeChildItem

      public void removeChildItem(ListMenu.MenuItem menuItem)
      Removes menu item from the child items.
      Parameters:
      menuItem - menu item to remove
    • removeChildItem

      public void removeChildItem(int index)
      Removes menu item from the child items by index.
      Parameters:
      index - index to remove
    • removeAllChildItems

      public void removeAllChildItems()
      Removes all child items.
    • getChildren

      public List<ListMenu.MenuItem> getChildren()
      Returns:
      immutable list of child items
    • hasChildren

      public boolean hasChildren()
      Returns:
      true if menu bar item contains menu items, false otherwise
    • isMenu

      public boolean isMenu()
      Overrides:
      isMenu in class ListMenu.MenuItem
      Returns:
      true if menu item is ListMenu.MenuBarItem that contains other items, false otherwise