Class ListMenu.MenuBarItem
java.lang.Object
io.jmix.flowui.kit.component.main.ListMenu.MenuItem
io.jmix.flowui.kit.component.main.ListMenu.MenuBarItem
- Enclosing class:
- ListMenu
Describes menu item that can contain other menu items.
-
Field Summary
Fields inherited from class io.jmix.flowui.kit.component.main.ListMenu.MenuItem
classNames, clickHandler, description, icon, id, menuComponent, 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.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) Sets icon that should be displayed to the left of theListMenu.MenuItem.getTitle()
.withOpened
(boolean opened) Sets whether menu bar item should open sub menu when it's added to the menu.Sets displayed menu item text.Methods inherited from class io.jmix.flowui.kit.component.main.ListMenu.MenuItem
addClassNames, create, createMenuBar, equals, getClassNames, getClickHandler, getDescription, getIcon, getId, getMenuComponent, getTitle, hashCode, isAttachedToMenu, setMenuComponent, toString, withClickHandler
-
Field Details
-
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
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
-
isOpened
public boolean isOpened()- 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.- 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.- 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.
- Parameters:
menuItem
- menu item to add
-
removeChildItem
Removes menu item from the child items.- 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. -
getChildren
- Returns:
- immutable list of child items
-
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
-