Class SideMenuImpl.MenuItemImpl
java.lang.Object
io.jmix.ui.component.mainwindow.impl.SideMenuImpl.MenuItemImpl
- All Implemented Interfaces:
SideMenu.MenuItem
- Enclosing class:
- SideMenuImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Consumer<SideMenu.MenuItem>protected JmixSideMenu.MenuItemprotected Stringprotected Stringprotected SideMenuImpl -
Constructor Summary
ConstructorsConstructorDescriptionMenuItemImpl(SideMenuImpl menu, String id, JmixSideMenu.MenuItem delegateItem) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChildItem(SideMenu.MenuItem menuItem) Add menu item to the end of children list.voidaddChildItem(SideMenu.MenuItem menuItem, int index) Add menu item to specified position in the children list.voidaddStyleName(String styleName) Adds one or more style names to this component.getIcon()getId()protected StringgetMenu()booleanbooleanbooleanbooleanprotected voidvoidRemove all child items from the children list.voidremoveChildItem(int index) Remove menu item from the children list by index.voidremoveChildItem(SideMenu.MenuItem menuItem) Remove menu item from the children list.voidremoveStyleName(String styleName) Removes one or more style names from component.voidsetBadgeText(String badgeText) Set badge text for item.voidsetCaption(String caption) Set item caption.voidsetCaptionAsHtml(boolean captionAsHtml) Enable or disable HTML mode for caption.voidsetCommand(Consumer<SideMenu.MenuItem> command) Set item commandvoidsetDescription(String description) Set description.voidsetExpanded(boolean expanded) Expand or collapse sub menu with children by default.voidSet icon.protected voidsetJTestId(String jTestId) voidsetStyleName(String styleName) Sets one or more user-defined style names of the component, replacing any previous user-defined styles.voidsetVisible(boolean visible) Show or hide item.
-
Field Details
-
id
-
delegateItem
-
command
-
icon
-
Constructor Details
-
MenuItemImpl
-
-
Method Details
-
getId
- Specified by:
getIdin interfaceSideMenu.MenuItem- Returns:
- id
-
getMenu
- Specified by:
getMenuin interfaceSideMenu.MenuItem- Returns:
- owner
-
getDelegateItem
-
getCaption
- Specified by:
getCaptionin interfaceSideMenu.MenuItem- Returns:
- caption
-
setCaption
Description copied from interface:SideMenu.MenuItemSet item caption.- Specified by:
setCaptionin interfaceSideMenu.MenuItem- Parameters:
caption- caption
-
getDescription
- Specified by:
getDescriptionin interfaceSideMenu.MenuItem- Returns:
- description
-
setDescription
Description copied from interface:SideMenu.MenuItemSet description.- Specified by:
setDescriptionin interfaceSideMenu.MenuItem- Parameters:
description- description
-
getIcon
- Specified by:
getIconin interfaceSideMenu.MenuItem- Returns:
- icon name
-
setIcon
Description copied from interface:SideMenu.MenuItemSet icon.- Specified by:
setIconin interfaceSideMenu.MenuItem- Parameters:
icon- icon name
-
isCaptionAsHtml
public boolean isCaptionAsHtml()- Specified by:
isCaptionAsHtmlin interfaceSideMenu.MenuItem- Returns:
- true if caption is inserted to DOM as HTML
-
setCaptionAsHtml
public void setCaptionAsHtml(boolean captionAsHtml) Description copied from interface:SideMenu.MenuItemEnable or disable HTML mode for caption.- Specified by:
setCaptionAsHtmlin interfaceSideMenu.MenuItem- Parameters:
captionAsHtml- pass true to enable HTML mode for caption.
-
isVisible
public boolean isVisible()- Specified by:
isVisiblein interfaceSideMenu.MenuItem- Returns:
- true if item will be sent to the client side
-
setVisible
public void setVisible(boolean visible) Description copied from interface:SideMenu.MenuItemShow or hide item.- Specified by:
setVisiblein interfaceSideMenu.MenuItem- Parameters:
visible- pass false to hide menu item
-
isExpanded
public boolean isExpanded()- Specified by:
isExpandedin interfaceSideMenu.MenuItem- Returns:
- true if sub menu with children will be initially expanded
-
setExpanded
public void setExpanded(boolean expanded) Description copied from interface:SideMenu.MenuItemExpand or collapse sub menu with children by default.- Specified by:
setExpandedin interfaceSideMenu.MenuItem- Parameters:
expanded- pass true to set sub menu expanded by default.
-
getStyleName
- Specified by:
getStyleNamein interfaceSideMenu.MenuItem- Returns:
- all user-defined CSS style names of a component. If the item has multiple style names defined, the return string is a space-separated list of style names.
-
setStyleName
Description copied from interface:SideMenu.MenuItemSets one or more user-defined style names of the component, replacing any previous user-defined styles. Multiple styles can be specified as a space-separated list of style names. The style names must be valid CSS class names.- Specified by:
setStyleNamein interfaceSideMenu.MenuItem- Parameters:
styleName- style name string
-
addStyleName
Description copied from interface:SideMenu.MenuItemAdds one or more style names to this component. Multiple styles can be specified as a space-separated list of style names. The style name will be rendered as a HTML class name, which can be used in a CSS definition.- Specified by:
addStyleNamein interfaceSideMenu.MenuItem- Parameters:
styleName- style name string
-
removeStyleName
Description copied from interface:SideMenu.MenuItemRemoves one or more style names from component. Multiple styles can be specified as a space-separated list of style names.- Specified by:
removeStyleNamein interfaceSideMenu.MenuItem- Parameters:
styleName- style name string
-
getBadgeText
- Specified by:
getBadgeTextin interfaceSideMenu.MenuItem- Returns:
- badge text
-
setBadgeText
Description copied from interface:SideMenu.MenuItemSet badge text for item. Badges are shown as small widget on the right side of menu items.- Specified by:
setBadgeTextin interfaceSideMenu.MenuItem- Parameters:
badgeText- badge text
-
getJTestId
-
setJTestId
-
getCommand
- Specified by:
getCommandin interfaceSideMenu.MenuItem- Returns:
- item command
-
setCommand
Description copied from interface:SideMenu.MenuItemSet item command- Specified by:
setCommandin interfaceSideMenu.MenuItem- Parameters:
command- item command
-
addChildItem
Description copied from interface:SideMenu.MenuItemAdd menu item to the end of children list.- Specified by:
addChildItemin interfaceSideMenu.MenuItem- Parameters:
menuItem- menu item
-
addChildItem
Description copied from interface:SideMenu.MenuItemAdd menu item to specified position in the children list.- Specified by:
addChildItemin interfaceSideMenu.MenuItem- Parameters:
menuItem- menu itemindex- target index
-
removeChildItem
Description copied from interface:SideMenu.MenuItemRemove menu item from the children list.- Specified by:
removeChildItemin interfaceSideMenu.MenuItem- Parameters:
menuItem- menu item
-
removeAllChildItems
public void removeAllChildItems()Description copied from interface:SideMenu.MenuItemRemove all child items from the children list.- Specified by:
removeAllChildItemsin interfaceSideMenu.MenuItem
-
removeChildItem
public void removeChildItem(int index) Description copied from interface:SideMenu.MenuItemRemove menu item from the children list by index.- Specified by:
removeChildItemin interfaceSideMenu.MenuItem- Parameters:
index- index
-
getChildren
- Specified by:
getChildrenin interfaceSideMenu.MenuItem- Returns:
- child items
-
hasChildren
public boolean hasChildren()- Specified by:
hasChildrenin interfaceSideMenu.MenuItem- Returns:
- true if the menu item has child items
-
getParent
- Specified by:
getParentin interfaceSideMenu.MenuItem- Returns:
- parent menu item if it's nested item, null otherwise
-
getParentNN
- Specified by:
getParentNNin interfaceSideMenu.MenuItem- Returns:
- parent menu item if it's nested item, null otherwise
-