Class AppNav
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
} and hierarchy can be
created by adding invalid @link
{@link #(AppNavItem)
AppNavItem instances to other AppNavItem
instances.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddItem(AppNavItem... appNavItems) Adds menu item(s) to the menu.getLabel()Gets the textual label for the navigation.booleanCheck 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, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods 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, setWidthFullMethods 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
Creates a new menu with the given label.- Parameters:
label- the label to use
-
-
Method Details
-
removeAllItems
Removes all menu items from this item.- Returns:
- this item for chaining
-
getLabel
Gets the textual label for the navigation.- Returns:
- the label or null if no label has been set
-
setLabel
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
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