Package io.jmix.ui.component.mainwindow
Interface AppMenu.MenuItem
- All Known Implementing Classes:
AppMenuImpl.MenuItemImpl
- Enclosing interface:
- AppMenu
public static interface AppMenu.MenuItem
Menu item
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addChildItem
(AppMenu.MenuItem menuItem) Add menu item to the end of children list.void
addChildItem
(AppMenu.MenuItem menuItem, int index) Add menu item to specified position in the children list.getIcon()
getId()
getMenu()
boolean
boolean
boolean
void
removeChildItem
(int index) Remove menu item from the children list by index.void
removeChildItem
(AppMenu.MenuItem menuItem) Remove menu item from the children list.void
setCaption
(String caption) Set item caption.void
setCommand
(Consumer<AppMenu.MenuItem> command) Set item commandvoid
setDescription
(String description) Set description.void
Set icon.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.
-
Method Details
-
getId
- Returns:
- id
-
getMenu
AppMenu getMenu()- Returns:
- owner
-
getCaption
String getCaption()- Returns:
- caption
-
setCaption
Set item caption.- Parameters:
caption
- caption
-
getDescription
String getDescription()- Returns:
- description
-
setDescription
Set description.- Parameters:
description
- description
-
getIcon
- Returns:
- icon name
-
setIcon
Set icon.- Parameters:
icon
- icon name
-
isVisible
boolean isVisible()- Returns:
- true if item will be sent to the client side
-
setVisible
void setVisible(boolean visible) Show or hide item.- Parameters:
visible
- pass false to hide menu item
-
getStyleName
String getStyleName()- 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
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.- Parameters:
styleName
- style name string
-
getCommand
- Returns:
- item command
-
setCommand
Set item command- Parameters:
command
- item command
-
addChildItem
Add menu item to the end of children list.- Parameters:
menuItem
- menu item
-
addChildItem
Add menu item to specified position in the children list.- Parameters:
menuItem
- menu itemindex
- target index
-
removeChildItem
Remove menu item from the children list.- Parameters:
menuItem
- menu item
-
removeChildItem
void removeChildItem(int index) Remove menu item from the children list by index.- Parameters:
index
- index
-
getChildren
List<AppMenu.MenuItem> getChildren()- Returns:
- child items
-
hasChildren
boolean hasChildren()- Returns:
- true if the menu item has child items
-
isSeparator
boolean isSeparator()- Returns:
- true if item is separator
-