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
Nested ClassesModifier and TypeClassDescriptionstatic classDescribes menu item that can contain other menu items.static classDescribes menu item. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddChildren(ListMenu.MenuItem parent, ListMenu.MenuItem childItem) protected voidaddChildren(ListMenu.MenuItem parent, ListMenu.MenuItem childItem, int index) voidaddMenuItem(ListMenu.MenuItem menuItem) Adds menu item and its children to the menu.voidaddMenuItem(ListMenu.MenuItem menuItem, int index) Adds menu item and its children to the menu in specified index.protected voidaddMenuItemClickListener(com.vaadin.flow.router.RouterLink routerLink, ListMenu.MenuItem menuItem) protected voidattachMenuItemRecursively(ListMenu.MenuItem menuItem) protected voidprotected com.vaadin.flow.component.details.DetailscreateMenuBarComponent(ListMenu.MenuBarItem menuBarItem) protected com.vaadin.flow.router.RouterLinkcreateMenuItemComponent(ListMenu.MenuItem menuItem) protected com.vaadin.flow.component.html.ListItemcreateMenuRecursively(ListMenu.MenuItem menuItem) protected voiddetachMenuItemRecursively(ListMenu.MenuItem menuItem) protected com.vaadin.flow.component.html.UnorderedListgetMenuBarContent(com.vaadin.flow.component.details.Details menuBar) protected com.vaadin.flow.component.html.UnorderedListgetMenuBarContent(ListMenu.MenuItem menuItem) getMenuItem(String id) Gets menu item from the menu by its ID.protected StringgetTitle(ListMenu.MenuItem menuItem) protected com.vaadin.flow.component.html.UnorderedListprotected voidregisterMenuItem(ListMenu.MenuItem menuItem, com.vaadin.flow.component.html.ListItem menuItemComponent) voidRemoves all menu items from the menu.voidremoveMenuItem(int index) Removes root menu item by index.voidremoveMenuItem(ListMenu.MenuItem menuItem) Removes menu item and its children from the menu.protected voidMethods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElementMethods 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, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods 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, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Field Details
-
TEXT_SMALL_CLASS_NAME
- See Also:
-
LIST_NONE_CLASS_NAME
- See Also:
-
MARGIN_NONE_CLASS_NAME
- See Also:
-
PADDING_NONE_CLASS_NAME
- See Also:
-
FLEX_CLASS_NAME
- See Also:
-
FONT_MEDIUM_CLASS_NAME
- See Also:
-
JMIX_LIST_MENU_CLASS_NAME
- See Also:
-
JMIX_MENUBAR_ITEM_CLASS_NAME
- See Also:
-
JMIX_MENUBAR_SUMMARY_ICON_CONTAINER_CLASS_NAME
- See Also:
-
MENUBAR_SUMMARY_CLASS_NAME
- See Also:
-
MENUBAR_ICON_CLASS_NAME
- See Also:
-
MENUBAR_LIST_CLASS_NAME
- See Also:
-
JMIX_MENU_ITEM_LINK_CLASS_NAME
- See Also:
-
LINK_ICON_CLASS_NAME
- See Also:
-
LINK_TEXT_CLASS_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:
initContentin 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
nullif 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
-