Interface ParentMenuItem<T extends MenuItem>

Type Parameters:
T - child menu item type
All Superinterfaces:
MenuItem
All Known Implementing Classes:
HorizontalMenu.ParentMenuItem, ListMenu.MenuBarItem

public interface ParentMenuItem<T extends MenuItem> extends MenuItem
Represents an item of a menu (for example, ListMenu) which can contain nested child items
  • Method Details

    • getChildItems

      List<T> getChildItems()
      Returns:
      child items of this parent item
    • removeAllChildItems

      void removeAllChildItems()
      Removes all child items of this parent item
    • addChildItem

      void addChildItem(T item)
      Adds child menu item.
      Parameters:
      item - menu item to add
    • addChildItem

      void addChildItem(T item, int index)
      Adds child menu item at index.
      Parameters:
      item - menu item to add
      index - index in children collection to add at
    • removeChildItem

      void removeChildItem(T item)
      Removes child menu item.
      Parameters:
      item - menu item to remove
    • setOpened

      void setOpened(boolean opened)
      Sets the opened status of the item.
      Parameters:
      opened - true/false to open/close the item
    • isOpened

      boolean isOpened()
      Returns:
      true/false if the item is opened/closed