Interface HasSideNavItems

All Superinterfaces:
HasElement, Serializable
All Known Implementing Classes:
SideNav, SideNavItem

public interface HasSideNavItems extends HasElement
HasSideNavItems is an interface for components used in the side navigation item hierarchy. The implementing components can contain and manage multiple SideNavItem instances. The interface defines methods for adding, removing, and accessing the items within a container.
Author:
Vaadin Ltd
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    addItem(SideNavItem... items)
    Adds navigation menu item(s) to the menu.
    default void
    Adds the given navigation item as the first child of this navigation item.
    default void
    addItemAtIndex(int index, SideNavItem item)
    Adds the given item as child of this navigation item at the specific index.
    default List<SideNavItem>
    Gets the items added to this navigation item (the children of this component that are instances of SideNavItem).
    default void
    remove(SideNavItem... items)
    Removes the menu item(s) from the menu.
    default void
    Removes all navigation menu items from this item.

    Methods inherited from interface com.vaadin.flow.component.HasElement

    getElement
  • Method Details

    • addItem

      default void addItem(SideNavItem... items)
      Adds navigation menu item(s) to the menu.
      Parameters:
      items - the navigation menu item(s) to add
    • addItemAsFirst

      default void addItemAsFirst(SideNavItem item)
      Adds the given navigation item as the first child of this navigation item.
      Parameters:
      item - the item to add, value must not be null
    • addItemAtIndex

      default void addItemAtIndex(int index, SideNavItem item)
      Adds the given item as child of this navigation item at the specific index.
      Parameters:
      index - the index, where the item will be added. The index must be non-negative and may not exceed the children count
      item - the item to add, value must not be null
    • getItems

      default List<SideNavItem> getItems()
      Gets the items added to this navigation item (the children of this component that are instances of SideNavItem). This doesn't include the items added to the children of this navigation item.
      Returns:
      the child SideNavItem instances in this navigation menu
      See Also:
    • remove

      default void remove(SideNavItem... items)
      Removes the menu item(s) from the menu.

      If the given menu item is not a child of this menu, does nothing.

      Parameters:
      items - the menu item(s) to remove
    • removeAll

      default void removeAll()
      Removes all navigation menu items from this item.