Class SideMenuImpl.MenuItemImpl
java.lang.Object
io.jmix.ui.component.mainwindow.impl.SideMenuImpl.MenuItemImpl
- All Implemented Interfaces:
SideMenu.MenuItem
- Enclosing class:
- SideMenuImpl
-
Field Summary
Modifier and TypeFieldDescriptionprotected Consumer<SideMenu.MenuItem>
protected JmixSideMenu.MenuItem
protected String
protected String
protected SideMenuImpl
-
Constructor Summary
ConstructorDescriptionMenuItemImpl
(SideMenuImpl menu, String id, JmixSideMenu.MenuItem delegateItem) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addChildItem
(SideMenu.MenuItem menuItem) Add menu item to the end of children list.void
addChildItem
(SideMenu.MenuItem menuItem, int index) Add menu item to specified position in the children list.void
addStyleName
(String styleName) Adds one or more style names to this component.getIcon()
getId()
protected String
getMenu()
boolean
boolean
boolean
boolean
protected void
void
Remove all child items from the children list.void
removeChildItem
(int index) Remove menu item from the children list by index.void
removeChildItem
(SideMenu.MenuItem menuItem) Remove menu item from the children list.void
removeStyleName
(String styleName) Removes one or more style names from component.void
setBadgeText
(String badgeText) Set badge text for item.void
setCaption
(String caption) Set item caption.void
setCaptionAsHtml
(boolean captionAsHtml) Enable or disable HTML mode for caption.void
setCommand
(Consumer<SideMenu.MenuItem> command) Set item commandvoid
setDescription
(String description) Set description.void
setExpanded
(boolean expanded) Expand or collapse sub menu with children by default.void
Set icon.protected void
setJTestId
(String jTestId) void
setStyleName
(String styleName) Sets one or more user-defined style names of the component, replacing any previous user-defined styles.void
setVisible
(boolean visible) Show or hide item.
-
Field Details
-
id
-
delegateItem
-
command
-
icon
-
Constructor Details
-
MenuItemImpl
-
-
Method Details
-
getId
- Specified by:
getId
in interfaceSideMenu.MenuItem
- Returns:
- id
-
getMenu
- Specified by:
getMenu
in interfaceSideMenu.MenuItem
- Returns:
- owner
-
getDelegateItem
-
getCaption
- Specified by:
getCaption
in interfaceSideMenu.MenuItem
- Returns:
- caption
-
setCaption
Description copied from interface:SideMenu.MenuItem
Set item caption.- Specified by:
setCaption
in interfaceSideMenu.MenuItem
- Parameters:
caption
- caption
-
getDescription
- Specified by:
getDescription
in interfaceSideMenu.MenuItem
- Returns:
- description
-
setDescription
Description copied from interface:SideMenu.MenuItem
Set description.- Specified by:
setDescription
in interfaceSideMenu.MenuItem
- Parameters:
description
- description
-
getIcon
- Specified by:
getIcon
in interfaceSideMenu.MenuItem
- Returns:
- icon name
-
setIcon
Description copied from interface:SideMenu.MenuItem
Set icon.- Specified by:
setIcon
in interfaceSideMenu.MenuItem
- Parameters:
icon
- icon name
-
isCaptionAsHtml
public boolean isCaptionAsHtml()- Specified by:
isCaptionAsHtml
in interfaceSideMenu.MenuItem
- Returns:
- true if caption is inserted to DOM as HTML
-
setCaptionAsHtml
public void setCaptionAsHtml(boolean captionAsHtml) Description copied from interface:SideMenu.MenuItem
Enable or disable HTML mode for caption.- Specified by:
setCaptionAsHtml
in interfaceSideMenu.MenuItem
- Parameters:
captionAsHtml
- pass true to enable HTML mode for caption.
-
isVisible
public boolean isVisible()- Specified by:
isVisible
in interfaceSideMenu.MenuItem
- Returns:
- true if item will be sent to the client side
-
setVisible
public void setVisible(boolean visible) Description copied from interface:SideMenu.MenuItem
Show or hide item.- Specified by:
setVisible
in interfaceSideMenu.MenuItem
- Parameters:
visible
- pass false to hide menu item
-
isExpanded
public boolean isExpanded()- Specified by:
isExpanded
in interfaceSideMenu.MenuItem
- Returns:
- true if sub menu with children will be initially expanded
-
setExpanded
public void setExpanded(boolean expanded) Description copied from interface:SideMenu.MenuItem
Expand or collapse sub menu with children by default.- Specified by:
setExpanded
in interfaceSideMenu.MenuItem
- Parameters:
expanded
- pass true to set sub menu expanded by default.
-
getStyleName
- Specified by:
getStyleName
in 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.MenuItem
Sets 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:
setStyleName
in interfaceSideMenu.MenuItem
- Parameters:
styleName
- style name string
-
addStyleName
Description copied from interface:SideMenu.MenuItem
Adds 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:
addStyleName
in interfaceSideMenu.MenuItem
- Parameters:
styleName
- style name string
-
removeStyleName
Description copied from interface:SideMenu.MenuItem
Removes one or more style names from component. Multiple styles can be specified as a space-separated list of style names.- Specified by:
removeStyleName
in interfaceSideMenu.MenuItem
- Parameters:
styleName
- style name string
-
getBadgeText
- Specified by:
getBadgeText
in interfaceSideMenu.MenuItem
- Returns:
- badge text
-
setBadgeText
Description copied from interface:SideMenu.MenuItem
Set badge text for item. Badges are shown as small widget on the right side of menu items.- Specified by:
setBadgeText
in interfaceSideMenu.MenuItem
- Parameters:
badgeText
- badge text
-
getJTestId
-
setJTestId
-
getCommand
- Specified by:
getCommand
in interfaceSideMenu.MenuItem
- Returns:
- item command
-
setCommand
Description copied from interface:SideMenu.MenuItem
Set item command- Specified by:
setCommand
in interfaceSideMenu.MenuItem
- Parameters:
command
- item command
-
addChildItem
Description copied from interface:SideMenu.MenuItem
Add menu item to the end of children list.- Specified by:
addChildItem
in interfaceSideMenu.MenuItem
- Parameters:
menuItem
- menu item
-
addChildItem
Description copied from interface:SideMenu.MenuItem
Add menu item to specified position in the children list.- Specified by:
addChildItem
in interfaceSideMenu.MenuItem
- Parameters:
menuItem
- menu itemindex
- target index
-
removeChildItem
Description copied from interface:SideMenu.MenuItem
Remove menu item from the children list.- Specified by:
removeChildItem
in interfaceSideMenu.MenuItem
- Parameters:
menuItem
- menu item
-
removeAllChildItems
public void removeAllChildItems()Description copied from interface:SideMenu.MenuItem
Remove all child items from the children list.- Specified by:
removeAllChildItems
in interfaceSideMenu.MenuItem
-
removeChildItem
public void removeChildItem(int index) Description copied from interface:SideMenu.MenuItem
Remove menu item from the children list by index.- Specified by:
removeChildItem
in interfaceSideMenu.MenuItem
- Parameters:
index
- index
-
getChildren
- Specified by:
getChildren
in interfaceSideMenu.MenuItem
- Returns:
- child items
-
hasChildren
public boolean hasChildren()- Specified by:
hasChildren
in interfaceSideMenu.MenuItem
- Returns:
- true if the menu item has child items
-
getParent
- Specified by:
getParent
in interfaceSideMenu.MenuItem
- Returns:
- parent menu item if it's nested item, null otherwise
-
getParentNN
- Specified by:
getParentNN
in interfaceSideMenu.MenuItem
- Returns:
- parent menu item if it's nested item, null otherwise
-