Class ListMenu
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<com.vaadin.flow.component.html.UnorderedList>
io.jmix.flowui.kit.component.main.ListMenu
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier
,com.vaadin.flow.component.DetachNotifier
,com.vaadin.flow.component.HasElement
,com.vaadin.flow.component.HasSize
,com.vaadin.flow.component.HasStyle
,Serializable
- Direct Known Subclasses:
JmixListMenu
public class ListMenu
extends com.vaadin.flow.component.Composite<com.vaadin.flow.component.html.UnorderedList>
implements com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Describes menu item that can contain other menu items.static class
Describes menu item. -
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected Map<String,
org.apache.commons.lang3.tuple.Pair<ListMenu.MenuItem, com.vaadin.flow.component.html.ListItem>> protected List<ListMenu.MenuItem>
protected static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addChildren
(ListMenu.MenuItem parent, ListMenu.MenuItem childItem) protected void
addChildren
(ListMenu.MenuItem parent, ListMenu.MenuItem childItem, int index) void
addMenuItem
(ListMenu.MenuItem menuItem) Adds menu item and its children to the menu.void
addMenuItem
(ListMenu.MenuItem menuItem, int index) Adds menu item and its children to the menu in specified index.protected void
addMenuItemClickListener
(com.vaadin.flow.router.RouterLink routerLink, ListMenu.MenuItem menuItem) protected void
attachMenuItemRecursively
(ListMenu.MenuItem menuItem) protected void
protected com.vaadin.flow.component.details.Details
createMenuBarComponent
(ListMenu.MenuBarItem menuBarItem) protected com.vaadin.flow.router.RouterLink
createMenuItemComponent
(ListMenu.MenuItem menuItem) protected com.vaadin.flow.component.html.ListItem
createMenuRecursively
(ListMenu.MenuItem menuItem) protected void
detachMenuItemRecursively
(ListMenu.MenuItem menuItem) protected com.vaadin.flow.component.html.UnorderedList
getMenuBarContent
(com.vaadin.flow.component.details.Details menuBar) protected com.vaadin.flow.component.html.UnorderedList
getMenuBarContent
(ListMenu.MenuItem menuItem) getMenuItem
(String id) Gets menu item from the menu by its ID.protected String
getTitle
(ListMenu.MenuItem menuItem) protected com.vaadin.flow.component.html.UnorderedList
protected void
registerMenuItem
(ListMenu.MenuItem menuItem, com.vaadin.flow.component.html.ListItem menuItemComponent) void
Removes all menu items from the menu.void
removeMenuItem
(int index) Removes root menu item by index.void
removeMenuItem
(ListMenu.MenuItem menuItem) Removes menu item and its children from the menu.protected void
Methods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElement
Methods inherited from class com.vaadin.flow.component.Component
addListener, fireEvent, from, get, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, scrollIntoView, set, setElement, setId, setVisible
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListener
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
Methods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull
Methods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Field Details
-
TEXT_SMALL_STYLE_NAME
- See Also:
-
LIST_NONE_STYLE_NAME
- See Also:
-
MARGIN_NONE_STYLE_NAME
- See Also:
-
PADDING_NONE_STYLE_NAME
- See Also:
-
FLEX_STYLE_NAME
- See Also:
-
FONT_MEDIUM_STYLE_NAME
- See Also:
-
JMIX_LIST_MENU_STYLE_NAME
- See Also:
-
JMIX_MENUBAR_ITEM_STYLE_NAME
- See Also:
-
JMIX_MENUBAR_SUMMARY_ICON_CONTAINER_STYLE_NAME
- See Also:
-
MENUBAR_SUMMARY_STYLE_NAME
- See Also:
-
MENUBAR_ICON_STYLE_NAME
- See Also:
-
MENUBAR_LIST_STYLE_NAME
- See Also:
-
JMIX_MENU_ITEM_LINK_STYLE_NAME
- See Also:
-
LINK_ICON_STYLE_NAME
- See Also:
-
LINK_TEXT_STYLE_NAME
- See Also:
-
rootMenuItems
-
registrations
protected Map<String,org.apache.commons.lang3.tuple.Pair<ListMenu.MenuItem, registrationscom.vaadin.flow.component.html.ListItem>>
-
-
Constructor Details
-
ListMenu
public ListMenu()
-
-
Method Details
-
initContent
protected com.vaadin.flow.component.html.UnorderedList initContent()- Overrides:
initContent
in classcom.vaadin.flow.component.Composite<com.vaadin.flow.component.html.UnorderedList>
-
getMenuItem
Gets menu item from the menu by its ID.- Parameters:
id
- menu item id- Returns:
- menu item or
null
if not found
-
getMenuItems
- Returns:
- immutable list of root menu items
-
addMenuItem
Adds menu item and its children to the menu.- Parameters:
menuItem
- menu item to add
-
addMenuItem
Adds menu item and its children to the menu in specified index.If root menu items already contain provided menu item, it will be moved to the provided index.
- Parameters:
menuItem
- menu item to addindex
- index to add menu item in the root items
-
removeMenuItem
Removes menu item and its children from the menu.- Parameters:
menuItem
- menu item to remove
-
removeMenuItem
public void removeMenuItem(int index) Removes root menu item by index.- Parameters:
index
- index to remove from root menu items
-
removeAllMenuItems
public void removeAllMenuItems()Removes all menu items from the menu. -
addChildren
-
addChildren
-
createMenuRecursively
-
attachMenuItemRecursively
-
detachMenuItemRecursively
-
unregisterMenuItemRecursively
-
registerMenuItem
protected void registerMenuItem(ListMenu.MenuItem menuItem, com.vaadin.flow.component.html.ListItem menuItemComponent) -
createMenuItemComponent
-
addMenuItemClickListener
protected void addMenuItemClickListener(com.vaadin.flow.router.RouterLink routerLink, ListMenu.MenuItem menuItem) -
createMenuBarComponent
protected com.vaadin.flow.component.details.Details createMenuBarComponent(ListMenu.MenuBarItem menuBarItem) -
getMenuBarContent
protected com.vaadin.flow.component.html.UnorderedList getMenuBarContent(ListMenu.MenuItem menuItem) -
getMenuBarContent
protected com.vaadin.flow.component.html.UnorderedList getMenuBarContent(com.vaadin.flow.component.details.Details menuBar) -
getTitle
-
checkItemIdDuplicate
-