Class ListMenu.MenuBarItem
java.lang.Object
io.jmix.flowui.kit.component.main.ListMenu.MenuItem
io.jmix.flowui.kit.component.main.ListMenu.MenuBarItem
- All Implemented Interfaces:
MenuItem,ParentMenuItem<ListMenu.MenuItem>
- Enclosing class:
- ListMenu
public static class ListMenu.MenuBarItem
extends ListMenu.MenuItem
implements ParentMenuItem<ListMenu.MenuItem>
Describes menu item that can contain other menu items.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<ListMenu.MenuItem>protected booleanprotected static final StringFields inherited from class io.jmix.flowui.kit.component.main.ListMenu.MenuItem
classNames, clickHandler, description, icon, id, MENU_ITEM_CLASS_NAME, MENU_ITEM_PREFIX_COMPONENT, MENU_ITEM_SUFFIX_COMPONENT, menuComponent, openedChangeHandler, prefixComponent, propertyChangeSupport, shortcutCombination, suffixComponent, title -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChildItem(ListMenu.MenuItem menuItem) Adds menu item to the sub menu list.voidaddChildItem(ListMenu.MenuItem menuItem, int index) Adds menu item to the sub menu list by index.Deprecated.booleanbooleanisMenu()booleanisOpened()voidRemoves all child items.voidremoveChildItem(int index) Removes menu item from the child items by index.voidremoveChildItem(ListMenu.MenuItem menuItem) Removes menu item from the child items.voidsetOpened(boolean opened) Sets whether menu bar item should open sub menu when it's added to the menu.withClassNames(List<String> classNames) Sets class names that should be added to the menu item.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.withOpened(boolean opened) Sets whether menu bar item should open sub menu when it's added to the menu.withPrefixComponent(com.vaadin.flow.component.Component prefixComponent) Sets prefix component of the item.withSuffixComponent(com.vaadin.flow.component.Component suffixComponent) Sets suffix component of the item.Sets displayed menu item text.Methods inherited from class io.jmix.flowui.kit.component.main.ListMenu.MenuItem
addClassNames, addPropertyChangeListener, create, createMenuBar, equals, getClassNames, getClickHandler, getDescription, getIcon, getId, getMenuComponent, getOpenedChangeHandler, getPrefixComponent, getShortcutCombination, getSuffixComponent, getTitle, hashCode, isAttachedToMenu, isSeparator, removePropertyChangeListener, setMenuComponent, setPrefixComponent, setSuffixComponent, toString, withClickHandler, withOpenedChangeHandler, withShortcutCombination
-
Field Details
-
MENU_ITEM_OPENED
- See Also:
-
children
-
isOpened
protected boolean isOpened
-
-
Constructor Details
-
MenuBarItem
-
-
Method Details
-
withTitle
Description copied from class:ListMenu.MenuItemSets displayed menu item text.- Overrides:
withTitlein classListMenu.MenuItem- Parameters:
title- displayed text- Returns:
- current menu instance
-
withDescription
Description copied from class:ListMenu.MenuItemSets menu item description that should be shown when the user moves cursor on item.- Overrides:
withDescriptionin classListMenu.MenuItem- Parameters:
description- description to set- Returns:
- current menu instance
-
withIcon
@Deprecated(since="2.2", forRemoval=true) public ListMenu.MenuBarItem withIcon(@Nullable com.vaadin.flow.component.icon.VaadinIcon icon) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:ListMenu.MenuItemSets icon that should be displayed to the left of theListMenu.MenuItem.getTitle().- Overrides:
withIconin classListMenu.MenuItem- Parameters:
icon- icon to set- Returns:
- current menu instance
-
withClassNames
Description copied from class:ListMenu.MenuItemSets class names that should be added to the menu item.- Overrides:
withClassNamesin classListMenu.MenuItem- Parameters:
classNames- class names to add- Returns:
- current menu instance
-
withSuffixComponent
public ListMenu.MenuBarItem withSuffixComponent(com.vaadin.flow.component.Component suffixComponent) Description copied from class:ListMenu.MenuItemSets suffix component of the item.- Overrides:
withSuffixComponentin classListMenu.MenuItem- Parameters:
suffixComponent- component to set- Returns:
- current menu item instance
-
withPrefixComponent
public ListMenu.MenuBarItem withPrefixComponent(com.vaadin.flow.component.Component prefixComponent) Description copied from class:ListMenu.MenuItemSets prefix component of the item.- Overrides:
withPrefixComponentin classListMenu.MenuItem- Parameters:
prefixComponent- component to set- Returns:
- current menu item instance
-
isOpened
public boolean isOpened()- Specified by:
isOpenedin interfaceParentMenuItem<ListMenu.MenuItem>- Returns:
trueif menu bar item initially should open list of sub menu items,falseotherwise
-
setOpened
public void setOpened(boolean opened) Sets whether menu bar item should open sub menu when it's added to the menu.- Specified by:
setOpenedin interfaceParentMenuItem<ListMenu.MenuItem>- Parameters:
opened- open option
-
withOpened
Sets whether menu bar item should open sub menu when it's added to the menu.- Parameters:
opened- open option- Returns:
- current menu bar item instance
-
addChildItem
Adds menu item to the sub menu list.- Specified by:
addChildItemin interfaceParentMenuItem<ListMenu.MenuItem>- Parameters:
menuItem- menu item to add
-
addChildItem
Adds menu item to the sub menu list by index.If child items already contain provided menu item, it will be moved to the provided index.
- Specified by:
addChildItemin interfaceParentMenuItem<ListMenu.MenuItem>- Parameters:
menuItem- menu item to addindex- index in children collection to add at
-
removeChildItem
Removes menu item from the child items.- Specified by:
removeChildItemin interfaceParentMenuItem<ListMenu.MenuItem>- Parameters:
menuItem- menu item to remove
-
removeChildItem
public void removeChildItem(int index) Removes menu item from the child items by index.- Parameters:
index- index to remove
-
removeAllChildItems
public void removeAllChildItems()Removes all child items.- Specified by:
removeAllChildItemsin interfaceParentMenuItem<ListMenu.MenuItem>
-
getChildren
Deprecated.usegetChildItems()- Returns:
- immutable list of child items
-
getChildItems
- Specified by:
getChildItemsin interfaceParentMenuItem<ListMenu.MenuItem>- Returns:
- child items of this parent item
-
hasChildren
public boolean hasChildren()- Returns:
trueif menu bar item contains menu items,falseotherwise
-
isMenu
public boolean isMenu()- Overrides:
isMenuin classListMenu.MenuItem- Returns:
trueif menu item isListMenu.MenuBarItemthat contains other items,falseotherwise
-
getChildItems()