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
Modifier and TypeFieldDescriptionprotected List<ListMenu.MenuItem>
protected boolean
protected static final String
Fields 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addChildItem
(ListMenu.MenuItem menuItem) Adds menu item to the sub menu list.void
addChildItem
(ListMenu.MenuItem menuItem, int index) Adds menu item to the sub menu list by index.Deprecated.boolean
boolean
isMenu()
boolean
isOpened()
void
Removes all child items.void
removeChildItem
(int index) Removes menu item from the child items by index.void
removeChildItem
(ListMenu.MenuItem menuItem) Removes menu item from the child items.void
setOpened
(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.MenuItem
Sets displayed menu item text.- Overrides:
withTitle
in classListMenu.MenuItem
- Parameters:
title
- displayed text- Returns:
- current menu instance
-
withDescription
Description copied from class:ListMenu.MenuItem
Sets menu item description that should be shown when the user moves cursor on item.- Overrides:
withDescription
in 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.MenuItem
Sets icon that should be displayed to the left of theListMenu.MenuItem.getTitle()
.- Overrides:
withIcon
in classListMenu.MenuItem
- Parameters:
icon
- icon to set- Returns:
- current menu instance
-
withClassNames
Description copied from class:ListMenu.MenuItem
Sets class names that should be added to the menu item.- Overrides:
withClassNames
in 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.MenuItem
Sets suffix component of the item.- Overrides:
withSuffixComponent
in 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.MenuItem
Sets prefix component of the item.- Overrides:
withPrefixComponent
in classListMenu.MenuItem
- Parameters:
prefixComponent
- component to set- Returns:
- current menu item instance
-
isOpened
public boolean isOpened()- Specified by:
isOpened
in interfaceParentMenuItem<ListMenu.MenuItem>
- Returns:
true
if menu bar item initially should open list of sub menu items,false
otherwise
-
setOpened
public void setOpened(boolean opened) Sets whether menu bar item should open sub menu when it's added to the menu.- Specified by:
setOpened
in 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:
addChildItem
in 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:
addChildItem
in 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:
removeChildItem
in 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:
removeAllChildItems
in interfaceParentMenuItem<ListMenu.MenuItem>
-
getChildren
Deprecated.usegetChildItems()
- Returns:
- immutable list of child items
-
getChildItems
- Specified by:
getChildItems
in interfaceParentMenuItem<ListMenu.MenuItem>
- Returns:
- child items of this parent item
-
hasChildren
public boolean hasChildren()- Returns:
true
if menu bar item contains menu items,false
otherwise
-
isMenu
public boolean isMenu()- Overrides:
isMenu
in classListMenu.MenuItem
- Returns:
true
if menu item isListMenu.MenuBarItem
that contains other items,false
otherwise
-
getChildItems()