public class AppLayoutMenu extends Object implements com.vaadin.flow.component.HasElement, com.vaadin.flow.component.AttachNotifier
| Constructor and Description |
|---|
AppLayoutMenu()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
AppLayoutMenuItem |
addMenuItem(AppLayoutMenuItem item)
Adds item to the menu.
|
AppLayoutMenuItem |
addMenuItem(com.vaadin.flow.component.Component icon)
Constructs a new object with the given icon.
|
AppLayoutMenuItem |
addMenuItem(com.vaadin.flow.component.Component icon,
com.vaadin.flow.component.ComponentEventListener<MenuItemClickEvent> listener)
Constructs a new object with the given icon and click listener.
|
AppLayoutMenuItem |
addMenuItem(com.vaadin.flow.component.Component icon,
String title)
Constructs a new object with the given icon and title.
|
AppLayoutMenuItem |
addMenuItem(com.vaadin.flow.component.Component icon,
String title,
com.vaadin.flow.component.ComponentEventListener<MenuItemClickEvent> listener)
Constructs a new object with the given icon, title and click listener.
|
AppLayoutMenuItem |
addMenuItem(com.vaadin.flow.component.Component icon,
String title,
String route)
Constructs a new object with the given icon, title and route.
|
AppLayoutMenuItem |
addMenuItem(String title)
Constructs a new object with the given title.
|
AppLayoutMenuItem |
addMenuItem(String title,
com.vaadin.flow.component.ComponentEventListener<MenuItemClickEvent> listener)
Constructs a new object with the given title and click listener.
|
void |
addMenuItems(AppLayoutMenuItem... menuItems)
Adds menu items to the menu.
|
void |
clearMenuItems()
Removes all menu items.
|
com.vaadin.flow.dom.Element |
getElement() |
Optional<AppLayoutMenuItem> |
getMenuItemTargetingRoute(String route)
Gets the first
AppLayoutMenuItem targeting a route. |
AppLayoutMenuItem |
getSelectedMenuItem()
Gets the currently selected menu item.
|
void |
removeMenuItem(AppLayoutMenuItem menuItem)
Removes
AppLayoutMenuItem from the menu |
void |
selectMenuItem(AppLayoutMenuItem menuItem)
Selects a menu item.
|
void |
setMenuItems(AppLayoutMenuItem... menuItems)
Clears existing menu items and sets the new the arguments.
|
public void setMenuItems(AppLayoutMenuItem... menuItems)
menuItems - items of the type AppLayoutMenuItem to setpublic void addMenuItems(AppLayoutMenuItem... menuItems)
menuItems - items of the type AppLayoutMenuItem to addpublic AppLayoutMenuItem addMenuItem(String title)
title - the title to displaypublic AppLayoutMenuItem addMenuItem(AppLayoutMenuItem item)
item - AppLayoutMenuItem to addpublic AppLayoutMenuItem addMenuItem(com.vaadin.flow.component.Component icon)
icon - the icon to displaypublic AppLayoutMenuItem addMenuItem(com.vaadin.flow.component.Component icon, String title)
icon - the icon to displaytitle - the title to displaypublic AppLayoutMenuItem addMenuItem(com.vaadin.flow.component.Component icon, String title, String route)
icon - the icon to displaytitle - the title to displayroute - the route to navigate on clickpublic AppLayoutMenuItem addMenuItem(com.vaadin.flow.component.Component icon, com.vaadin.flow.component.ComponentEventListener<MenuItemClickEvent> listener)
icon - the icon to displaylistener - the menu item click listenerpublic AppLayoutMenuItem addMenuItem(String title, com.vaadin.flow.component.ComponentEventListener<MenuItemClickEvent> listener)
title - the title to displaylistener - the menu item click listenerpublic AppLayoutMenuItem addMenuItem(com.vaadin.flow.component.Component icon, String title, com.vaadin.flow.component.ComponentEventListener<MenuItemClickEvent> listener)
icon - the icon to displaytitle - the title to displaylistener - the menu item click listenerpublic void removeMenuItem(AppLayoutMenuItem menuItem)
AppLayoutMenuItem from the menupublic void clearMenuItems()
public void selectMenuItem(AppLayoutMenuItem menuItem)
menuItem - AppLayoutMenuItem to selectpublic Optional<AppLayoutMenuItem> getMenuItemTargetingRoute(String route)
AppLayoutMenuItem targeting a route.route - route to match to AppLayoutMenuItem.getRoute()AppLayoutMenuItem wrapped in an Optional, if found.public AppLayoutMenuItem getSelectedMenuItem()
AppLayoutMenuItem selected menu item.public com.vaadin.flow.dom.Element getElement()
getElement in interface com.vaadin.flow.component.HasElementCopyright © 2018–2019 Vaadin Ltd. All rights reserved.