Class ListMenu.MenuItem
java.lang.Object
io.jmix.flowui.kit.component.main.ListMenu.MenuItem
- All Implemented Interfaces:
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 static final String
protected static final String
protected ListMenu
protected Consumer<ListMenu.ListMenuBarOpenedChangeEvent>
protected com.vaadin.flow.component.Component
protected PropertyChangeSupport
protected KeyCombination
protected com.vaadin.flow.component.Component
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()
Deprecated, for removal: This API element is subject to removal in a future version.getId()
com.vaadin.flow.component.Component
com.vaadin.flow.component.Component
getTitle()
int
hashCode()
boolean
boolean
isMenu()
boolean
protected void
protected void
setMenuComponent
(ListMenu menu) void
setPrefixComponent
(com.vaadin.flow.component.Component prefixComponent) Sets prefix component of the item.void
setSuffixComponent
(com.vaadin.flow.component.Component suffixComponent) Sets suffix component of the item.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) Deprecated, for removal: This API element is subject to removal in a future version.withOpenedChangeHandler
(Consumer<ListMenu.ListMenuBarOpenedChangeEvent> openedChangeHandler) withPrefixComponent
(com.vaadin.flow.component.Component prefixComponent) Sets prefix component of the item.withShortcutCombination
(KeyCombination shortcutCombination) withSuffixComponent
(com.vaadin.flow.component.Component suffixComponent) Sets suffix component of the item.Sets displayed menu item text.
-
Field Details
-
MENU_ITEM_CLASS_NAME
- See Also:
-
MENU_ITEM_PREFIX_COMPONENT
- See Also:
-
MENU_ITEM_SUFFIX_COMPONENT
- See Also:
-
id
-
title
-
description
-
icon
protected com.vaadin.flow.component.icon.VaadinIcon icon -
classNames
-
clickHandler
-
openedChangeHandler
-
shortcutCombination
-
prefixComponent
protected com.vaadin.flow.component.Component prefixComponent -
suffixComponent
protected com.vaadin.flow.component.Component suffixComponent -
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
-
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 @Deprecated(since="2.2", forRemoval=true) public com.vaadin.flow.component.icon.VaadinIcon getIcon()Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- icon or
null
if not set
-
withIcon
@Deprecated(since="2.2", forRemoval=true) public ListMenu.MenuItem withIcon(@Nullable com.vaadin.flow.component.icon.VaadinIcon icon) Deprecated, for removal: This API element is subject to removal in a future version.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
-
getOpenedChangeHandler
-
withOpenedChangeHandler
public ListMenu.MenuItem withOpenedChangeHandler(@Nullable Consumer<ListMenu.ListMenuBarOpenedChangeEvent> openedChangeHandler) -
getShortcutCombination
-
withShortcutCombination
-
getSuffixComponent
@Nullable public com.vaadin.flow.component.Component getSuffixComponent()- Returns:
- suffix component of the item
-
withSuffixComponent
public ListMenu.MenuItem withSuffixComponent(@Nullable com.vaadin.flow.component.Component suffixComponent) Sets suffix component of the item.- Parameters:
suffixComponent
- component to set- Returns:
- current menu item instance
-
setSuffixComponent
public void setSuffixComponent(@Nullable com.vaadin.flow.component.Component suffixComponent) Sets suffix component of the item.- Parameters:
suffixComponent
- component to set
-
getPrefixComponent
public com.vaadin.flow.component.Component getPrefixComponent()- Returns:
- prefix component of the item
-
withPrefixComponent
Sets prefix component of the item.- Parameters:
prefixComponent
- component to set- Returns:
- current menu item instance
-
setPrefixComponent
public void setPrefixComponent(com.vaadin.flow.component.Component prefixComponent) Sets prefix component of the item.- Parameters:
prefixComponent
- component to set
-
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
-
getPrefixComponent()