Class ListMenu.MenuItem
java.lang.Object
io.jmix.flowui.kit.component.main.ListMenu.MenuItem
- Direct Known Subclasses:
JmixListMenu.BeanMenuItem
,JmixListMenu.ViewMenuItem
,ListMenu.MenuBarItem
,ListMenu.MenuSeparatorItem
- Enclosing class:
- ListMenu
Describes menu item.
-
Field Summary
Modifier and TypeFieldDescriptionprotected Consumer<ListMenu.MenuItem>
protected String
protected com.vaadin.flow.component.icon.VaadinIcon
protected String
protected static final String
protected ListMenu
protected PropertyChangeSupport
protected KeyCombination
protected String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addClassNames
(String... classNames) Adds class names that should be added to the menu item.protected void
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()
boolean
protected void
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()
.withShortcutCombination
(KeyCombination shortcutCombination) Sets displayed menu item text.
-
Field Details
-
MENU_ITEM_CLASS_NAME
- See Also:
-
id
-
title
-
description
-
icon
protected com.vaadin.flow.component.icon.VaadinIcon icon -
classNames
-
clickHandler
-
shortcutCombination
-
propertyChangeSupport
-
-
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
-
getShortcutCombination
-
withShortcutCombination
-
isMenu
public boolean isMenu()- Returns:
true
if menu item isListMenu.MenuBarItem
that contains other items,false
otherwise
-
isSeparator
public boolean isSeparator() -
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
-
addPropertyChangeListener
-
removePropertyChangeListener
-
hashCode
public int hashCode() -
toString
-