com.vaadin.flow.component.applayout.
Class AppLayoutMenuItem
- java.lang.Object
-
- com.vaadin.flow.component.Component
-
- com.vaadin.flow.component.tabs.GeneratedVaadinTab<Tab>
-
- com.vaadin.flow.component.tabs.Tab
-
- com.vaadin.flow.component.applayout.AppLayoutMenuItem
-
All Implemented Interfaces:
AttachNotifier, DetachNotifier, HasComponents, HasElement, HasEnabled, HasStyle, HasTheme, Serializable
public class AppLayoutMenuItem extends Tab
Base class representing menu items.
See Also:
-
-
Constructor Summary
Constructors 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.
-
Method Summary
All Methods 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
-
Methods inherited from class com.vaadin.flow.component.tabs.Tab
getFlexGrow, getLabel, isEnabled, isSelected, setEnabled, setFlexGrow, setLabel, setSelected, toString
-
Methods inherited from class com.vaadin.flow.component.tabs.GeneratedVaadinTab
addThemeVariants, getValueString, isDisabledBoolean, isSelectedBoolean, removeThemeVariants, setDisabled, setValue
-
Methods inherited from class com.vaadin.flow.component.Component
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getUI, hasListener, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisible
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.vaadin.flow.component.HasComponents
add, add, addComponentAsFirst, addComponentAtIndex, remove, removeAll
-
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
-
Methods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Methods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName
-
Methods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListener
-
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
-
-
-
-
Constructor Detail
-
AppLayoutMenuItem
public AppLayoutMenuItem(String title)
Constructs a new object with the given title.
Parameters:
title
- the title to display
-
AppLayoutMenuItem
public AppLayoutMenuItem(Component icon)
Constructs a new object with the given icon.
Parameters:
icon
- the icon to display
-
AppLayoutMenuItem
public AppLayoutMenuItem(Component icon, String title)
Constructs a new object with the given icon and title.
Parameters:
icon
- the icon to displaytitle
- the title to display
-
AppLayoutMenuItem
public AppLayoutMenuItem(String title, String route)
Constructs a new object with the given title and route.
Parameters:
title
- the title to displayroute
- The route to navigate on click
-
AppLayoutMenuItem
public AppLayoutMenuItem(Component icon, String title, String route)
Constructs a new object with the given icon, title and route.
Parameters:
icon
- the icon to displaytitle
- the title to displayroute
- the route to navigate on click
-
AppLayoutMenuItem
public AppLayoutMenuItem(Component icon, ComponentEventListener<MenuItemClickEvent> listener)
Constructs a new object with the given icon and click listener.
Parameters:
icon
- the icon to displaylistener
- the menu item click listener
-
AppLayoutMenuItem
public AppLayoutMenuItem(String title, ComponentEventListener<MenuItemClickEvent> listener)
Constructs a new object with the given title and click listener.
Parameters:
title
- the title to displaylistener
- the menu item click listener
-
AppLayoutMenuItem
public AppLayoutMenuItem(Component icon, String title, ComponentEventListener<MenuItemClickEvent> listener)
Constructs a new object with the given icon, title and click listener.
Parameters:
icon
- the icon to displaytitle
- the title to displaylistener
- the menu item click listener
-
-
Method Detail
-
getIcon
public Component getIcon()
Returns icon
-
setIcon
public void setIcon(Component icon)
Sets icon
Parameters:
icon
- Icon to display in AppLayoutMenuItem
-
getTitle
public String getTitle()
Returns displayed AppLayoutMenuItem title
-
setTitle
public void setTitle(String title)
Sets AppLayoutMenuItem title
Parameters:
title
- the displayed title of AppLayoutMenuItem
-
setRoute
public void setRoute(String route)
Sets the route to be navigated to when this menu item is selected.
Parameters:
route
- Route to be navigated to
-
getRoute
public String getRoute()
Returns:
Route associated with this menu item.
-
addMenuItemClickListener
public Registration addMenuItemClickListener(ComponentEventListener<MenuItemClickEvent> listener)
Parameters:
listener
- listener to called when the menu item is clicked.Returns:
-
-