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
,com.vaadin.flow.component.HasTheme
,com.vaadin.flow.component.shared.HasThemeVariant<ListMenuVariant>
,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, com.vaadin.flow.component.shared.HasThemeVariant<ListMenuVariant>
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Describes menu item that can contain other menu items.static class
Describes menu item.static class
-
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 PropertyChangeListener
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
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
addMenuItemClickShortcutCombination
(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.details.Details
getMenuBarComponent
(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 com.vaadin.flow.router.RouterLink
getMenuItemComponent
(ListMenu.MenuItem menuItem) protected String
getTitle
(ListMenu.MenuItem menuItem) protected com.vaadin.flow.component.html.UnorderedList
protected void
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
setPrefixComponent
(com.vaadin.flow.component.HasComponents componentContainer, com.vaadin.flow.component.Component prefixComponent, com.vaadin.flow.component.Component oldPrefixComponent) protected void
setSuffixComponent
(com.vaadin.flow.component.HasComponents componentContainer, com.vaadin.flow.component.Component suffixComponent, com.vaadin.flow.component.Component oldSuffixComponent) protected void
Methods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElement
Methods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, 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
Methods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName
Methods inherited from interface com.vaadin.flow.component.shared.HasThemeVariant
addThemeVariants, removeThemeVariants
-
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:
-
PREFIX_COMPONENT_CLASS_NAME
- See Also:
-
SUFFIX_COMPONENT_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:
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) -
addMenuItemClickShortcutCombination
protected void addMenuItemClickShortcutCombination(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) -
getMenuBarComponent
-
getMenuItemComponent
-
getTitle
-
checkItemIdDuplicate
-
setPrefixComponent
protected void setPrefixComponent(com.vaadin.flow.component.HasComponents componentContainer, @Nullable com.vaadin.flow.component.Component prefixComponent, @Nullable com.vaadin.flow.component.Component oldPrefixComponent) -
setSuffixComponent
protected void setSuffixComponent(com.vaadin.flow.component.HasComponents componentContainer, @Nullable com.vaadin.flow.component.Component suffixComponent, @Nullable com.vaadin.flow.component.Component oldSuffixComponent) -
onMenuItemPropertyChange
-