Class ListMenu.MenuItem
java.lang.Object
io.jmix.flowui.kit.component.main.ListMenu.MenuItem
- Direct Known Subclasses:
JmixListMenu.ViewMenuItem
,ListMenu.MenuBarItem
- Enclosing class:
- ListMenu
Describes menu item.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addClassNames
(String... classNames) Adds class names that should be added to the menu item.static ListMenu.MenuItem
Creates menu item with provided id.static ListMenu.MenuBarItem
createMenuBar
(String id) Creates menu bar that can contains other menu items.boolean
com.vaadin.flow.component.icon.VaadinIcon
getIcon()
getId()
getTitle()
int
hashCode()
boolean
boolean
isMenu()
protected void
setMenuComponent
(ListMenu menu) toString()
withClassNames
(List<String> classNames) Sets class names that should be added to the menu item.withClickHandler
(Consumer<ListMenu.MenuItem> clickHandler) withDescription
(String description) Sets menu item description that should be shown when the user moves cursor on item.withIcon
(com.vaadin.flow.component.icon.VaadinIcon icon) Sets icon that should be displayed to the left of thegetTitle()
.Sets displayed menu item text.
-
Field Details
-
id
-
title
-
description
-
icon
protected com.vaadin.flow.component.icon.VaadinIcon icon -
classNames
-
clickHandler
-
-
Constructor Details
-
MenuItem
-
-
Method Details
-
create
Creates menu item with provided id.- Parameters:
id
- menu item id- Returns:
- menu item
-
createMenuBar
Creates menu bar that can contains other menu items.- Parameters:
id
- menu item id- Returns:
- menu bar
-
getId
-
getTitle
- Returns:
- title or
null
if not set
-
withTitle
Sets displayed menu item text.- Parameters:
title
- displayed text- Returns:
- current menu instance
-
getDescription
- Returns:
- menu item description or
null
if not set.
-
withDescription
Sets menu item description that should be shown when the user moves cursor on item.- Parameters:
description
- description to set- Returns:
- current menu instance
-
getIcon
@Nullable public com.vaadin.flow.component.icon.VaadinIcon getIcon()- Returns:
- icon or
null
if not set
-
withIcon
Sets icon that should be displayed to the left of thegetTitle()
.- Parameters:
icon
- icon to set- Returns:
- current menu instance
-
getClassNames
- Returns:
- class names or empty list
-
withClassNames
Sets class names that should be added to the menu item.- Parameters:
classNames
- class names to add- Returns:
- current menu instance
-
addClassNames
Adds class names that should be added to the menu item.- Parameters:
classNames
- class names to add
-
getClickHandler
-
withClickHandler
-
isMenu
public boolean isMenu()- Returns:
true
if menu item isListMenu.MenuBarItem
that contains other items,false
otherwise
-
getMenuComponent
- Returns:
- menu component that contains given menu item
-
setMenuComponent
-
isAttachedToMenu
public boolean isAttachedToMenu()- Returns:
true
if menu item is attached to the menu component,false
otherwise
-
equals
-
hashCode
public int hashCode() -
toString
-