Class AppMenuImpl.MenuItemImpl
java.lang.Object
io.jmix.ui.component.mainwindow.impl.AppMenuImpl.MenuItemImpl
- All Implemented Interfaces:
AppMenu.MenuItem
- Enclosing class:
- AppMenuImpl
-
Field Summary
Modifier and TypeFieldDescriptionprotected Consumer<AppMenu.MenuItem>
protected com.vaadin.ui.MenuBar.MenuItem
protected String
protected String
protected AppMenuImpl
protected boolean
-
Constructor Summary
-
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.com.vaadin.ui.MenuBar.MenuItem
getIcon()
getId()
getMenu()
boolean
boolean
boolean
protected void
menuSelected
(com.vaadin.ui.MenuBar.MenuItem event) 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
setDelegateItem
(com.vaadin.ui.MenuBar.MenuItem delegateItem) void
setDescription
(String description) Set description.void
Set icon.protected void
setSeparator
(boolean separator) 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
protected com.vaadin.ui.MenuBar.MenuItem delegateItem -
command
-
icon
-
separator
protected boolean separator
-
Constructor Details
-
MenuItemImpl
-
-
Method Details
-
getId
- Specified by:
getId
in interfaceAppMenu.MenuItem
- Returns:
- id
-
getMenu
- Specified by:
getMenu
in interfaceAppMenu.MenuItem
- Returns:
- owner
-
getDelegateItem
public com.vaadin.ui.MenuBar.MenuItem getDelegateItem() -
setDelegateItem
public void setDelegateItem(com.vaadin.ui.MenuBar.MenuItem delegateItem) -
getCaption
- Specified by:
getCaption
in interfaceAppMenu.MenuItem
- Returns:
- caption
-
setCaption
Description copied from interface:AppMenu.MenuItem
Set item caption.- Specified by:
setCaption
in interfaceAppMenu.MenuItem
- Parameters:
caption
- caption
-
getDescription
- Specified by:
getDescription
in interfaceAppMenu.MenuItem
- Returns:
- description
-
setDescription
Description copied from interface:AppMenu.MenuItem
Set description.- Specified by:
setDescription
in interfaceAppMenu.MenuItem
- Parameters:
description
- description
-
getIcon
- Specified by:
getIcon
in interfaceAppMenu.MenuItem
- Returns:
- icon name
-
setIcon
Description copied from interface:AppMenu.MenuItem
Set icon.- Specified by:
setIcon
in interfaceAppMenu.MenuItem
- Parameters:
icon
- icon name
-
isVisible
public boolean isVisible()- Specified by:
isVisible
in interfaceAppMenu.MenuItem
- Returns:
- true if item will be sent to the client side
-
setVisible
public void setVisible(boolean visible) Description copied from interface:AppMenu.MenuItem
Show or hide item.- Specified by:
setVisible
in interfaceAppMenu.MenuItem
- Parameters:
visible
- pass false to hide menu item
-
getStyleName
- Specified by:
getStyleName
in interfaceAppMenu.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:AppMenu.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 interfaceAppMenu.MenuItem
- Parameters:
styleName
- style name string
-
getCommand
- Specified by:
getCommand
in interfaceAppMenu.MenuItem
- Returns:
- item command
-
setCommand
Description copied from interface:AppMenu.MenuItem
Set item command- Specified by:
setCommand
in interfaceAppMenu.MenuItem
- Parameters:
command
- item command
-
addChildItem
Description copied from interface:AppMenu.MenuItem
Add menu item to the end of children list.- Specified by:
addChildItem
in interfaceAppMenu.MenuItem
- Parameters:
menuItem
- menu item
-
addChildItem
Description copied from interface:AppMenu.MenuItem
Add menu item to specified position in the children list.- Specified by:
addChildItem
in interfaceAppMenu.MenuItem
- Parameters:
menuItem
- menu itemindex
- target index
-
removeChildItem
Description copied from interface:AppMenu.MenuItem
Remove menu item from the children list.- Specified by:
removeChildItem
in interfaceAppMenu.MenuItem
- Parameters:
menuItem
- menu item
-
removeChildItem
public void removeChildItem(int index) Description copied from interface:AppMenu.MenuItem
Remove menu item from the children list by index.- Specified by:
removeChildItem
in interfaceAppMenu.MenuItem
- Parameters:
index
- index
-
getChildren
- Specified by:
getChildren
in interfaceAppMenu.MenuItem
- Returns:
- child items
-
hasChildren
public boolean hasChildren()- Specified by:
hasChildren
in interfaceAppMenu.MenuItem
- Returns:
- true if the menu item has child items
-
isSeparator
public boolean isSeparator()- Specified by:
isSeparator
in interfaceAppMenu.MenuItem
- Returns:
- true if item is separator
-
setSeparator
protected void setSeparator(boolean separator)
-