java.lang.Object
com.vaadin.flow.component.Component
com.gruppox.pissir23.components.appnav.AppNav
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

@JsModule("@vaadin-component-factory/vcf-nav") @Tag("vcf-nav") @NpmPackage(value="@vaadin-component-factory/vcf-nav", version="1.0.6") public class AppNav extends com.vaadin.flow.component.Component implements com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle
A navigation menu with support for hierarchical and flat menus.

Items can be added using

invalid @link
{@link #(AppNavItem)
} and hierarchy can be created by adding AppNavItem instances to other AppNavItem instances.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new menu without any label.
    AppNav(String label)
    Creates a new menu with the given label.
  • Method Summary

    Modifier and Type
    Method
    Description
    addItem(AppNavItem... appNavItems)
    Adds menu item(s) to the menu.
    Gets the textual label for the navigation.
    boolean
    Check if the end user is allowed to collapse/hide and expand/show the navigation items.
    Removes all menu items from this item.
    removeItem(AppNavItem appNavItem)
    Removes the menu item from the menu.
    setCollapsible(boolean collapsible)
    Allow the end user to collapse/hide and expand/show the navigation items.
    Set a textual label for the navigation.

    Methods inherited from class com.vaadin.flow.component.Component

    addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisible

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

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

    addAttachListener

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

    addDetachListener

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

    getElement

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

    getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull

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

    addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
  • Constructor Details

    • AppNav

      public AppNav()
      Creates a new menu without any label.
    • AppNav

      public AppNav(String label)
      Creates a new menu with the given label.
      Parameters:
      label - the label to use
  • Method Details

    • addItem

      public AppNav addItem(AppNavItem... appNavItems)
      Adds menu item(s) to the menu.
      Parameters:
      appNavItems - the menu item(s) to add
      Returns:
      the menu for chaining
    • removeItem

      public AppNav removeItem(AppNavItem appNavItem)
      Removes the menu item from the menu.

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

      Parameters:
      appNavItem - the menu item to remove
      Returns:
      the menu for chaining
    • removeAllItems

      public AppNav removeAllItems()
      Removes all menu items from this item.
      Returns:
      this item for chaining
    • getLabel

      public String getLabel()
      Gets the textual label for the navigation.
      Returns:
      the label or null if no label has been set
    • setLabel

      public AppNav setLabel(String label)
      Set a textual label for the navigation.

      This can help the end user to distinguish groups of navigation items. The label is also available for screen reader users.

      Parameters:
      label - the label to set
      Returns:
      this instance for chaining
    • isCollapsible

      public boolean isCollapsible()
      Check if the end user is allowed to collapse/hide and expand/show the navigation items.

      NOTE: The navigation has to have a label for it to be collapsible.

      Returns:
      true if the menu is collapsible, false otherwise
    • setCollapsible

      public AppNav setCollapsible(boolean collapsible)
      Allow the end user to collapse/hide and expand/show the navigation items.

      NOTE: The navigation has to have a label for it to be collapsible.

      Parameters:
      collapsible - true to make the whole navigation component collapsible, false otherwise
      Returns:
      this instance for chaining