public class AppLayoutMenuItem extends Tab
Constructor and Description |
---|
AppLayoutMenuItem(Component icon)
Constructs a new object with the given icon.
|
AppLayoutMenuItem(Component icon,
ComponentEventListener<MenuItemClickEvent> listener)
Constructs a new object with the given icon and click listener.
|
AppLayoutMenuItem(Component icon,
String title)
Constructs a new object with the given icon and title.
|
AppLayoutMenuItem(Component icon,
String title,
ComponentEventListener<MenuItemClickEvent> listener)
Constructs a new object with the given icon, title and click listener.
|
AppLayoutMenuItem(Component icon,
String title,
String route)
Constructs a new object with the given icon, title and route.
|
AppLayoutMenuItem(String title)
Constructs a new object with the given title.
|
AppLayoutMenuItem(String title,
ComponentEventListener<MenuItemClickEvent> listener)
Constructs a new object with the given title and click listener.
|
AppLayoutMenuItem(String title,
String route)
Constructs a new object with the given title and route.
|
Modifier and Type | Method and Description |
---|---|
Registration |
addMenuItemClickListener(ComponentEventListener<MenuItemClickEvent> listener) |
Component |
getIcon()
Returns icon
|
String |
getRoute() |
String |
getTitle()
Returns displayed AppLayoutMenuItem title
|
void |
setIcon(Component icon)
Sets icon
|
void |
setRoute(String route)
Sets the route to be navigated to when this menu item is selected.
|
void |
setTitle(String title)
Sets AppLayoutMenuItem title
|
getFlexGrow, getLabel, isEnabled, isSelected, setEnabled, setFlexGrow, setLabel, setSelected, toString
addThemeVariants, getValueString, isDisabledBoolean, isSelectedBoolean, removeThemeVariants, setDisabled, setValue
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getUI, hasListener, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisible
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
add, add, addComponentAsFirst, addComponentAtIndex, remove, removeAll
getElement
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName
addAttachListener
addDetachListener
public AppLayoutMenuItem(String title)
title
- the title to displaypublic AppLayoutMenuItem(Component icon)
icon
- the icon to displaypublic AppLayoutMenuItem(Component icon, String title)
icon
- the icon to displaytitle
- the title to displaypublic AppLayoutMenuItem(String title, String route)
title
- the title to displayroute
- The route to navigate on clickpublic AppLayoutMenuItem(Component icon, String title, String route)
icon
- the icon to displaytitle
- the title to displayroute
- the route to navigate on clickpublic AppLayoutMenuItem(Component icon, ComponentEventListener<MenuItemClickEvent> listener)
icon
- the icon to displaylistener
- the menu item click listenerpublic AppLayoutMenuItem(String title, ComponentEventListener<MenuItemClickEvent> listener)
title
- the title to displaylistener
- the menu item click listenerpublic AppLayoutMenuItem(Component icon, String title, ComponentEventListener<MenuItemClickEvent> listener)
icon
- the icon to displaytitle
- the title to displaylistener
- the menu item click listenerpublic Component getIcon()
public void setIcon(Component icon)
icon
- Icon to display in AppLayoutMenuItempublic String getTitle()
public void setTitle(String title)
title
- the displayed title of AppLayoutMenuItempublic void setRoute(String route)
route
- Route to be navigated topublic String getRoute()
public Registration addMenuItemClickListener(ComponentEventListener<MenuItemClickEvent> listener)
listener
- listener to called when the menu item is clicked.Registration
Copyright © 2019. All rights reserved.