Package io.jmix.flowui.menu
Class MenuItem
java.lang.Object
io.jmix.flowui.menu.MenuItem
Main menu item descriptor.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a parameter associated with a menu item, consisting of a name and a value.static classRepresents a property of aMenuItemwithin a menu configuration. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<MenuItem.MenuItemProperty>protected List<MenuItem.MenuItemParameter>protected List<MenuItem.MenuItemParameter> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetBean()Returns the bean name associated with this menu item.Returns the bean method name associated with this menu item.Children itemsReturns the CSS class names associated with this menu item.org.dom4j.ElementReturns the descriptor of this menu item.getIcon()Returns the icon associated with this menu item.getId()Menu item ID as defined inmenu-config.xmlParent item.Returns the list of properties associated with this menu item.Returns the list of route parameters associated with this menu item.Returns the keyboard shortcut combination associated with this menu item.getTitle()Returns the list of URL query parameters associated with this menu item.getView()Returns the view id associated with this menu item.booleanisMenu()Returns whether the menu item represents a menu that contains other menu items.booleanisOpened()Returns whether this menu item is currently in an expanded (opened) state.booleanReturns whether the menu item is a separator.voidSets the bean name associated with this menu item.voidsetBeanMethod(String beanMethod) Sets the bean method name associated with this menu item.voidsetClassNames(String classNames) Sets the CSS class names associated with this menu item.voidsetDescription(String description) Sets the givendescriptionto menu item.voidsetDescriptor(org.dom4j.Element descriptor) Sets the descriptor of this menu item.voidSets the icon associated with this menu item.voidsetMenu(boolean isMenu) Sets whether this menu item represents a menu that contains other menu items.voidsetOpened(boolean expanded) Sets whether this menu item is currently in an expanded (opened) state.voidsetProperties(List<MenuItem.MenuItemProperty> properties) Sets the list of properties associated with this menu item.voidsetRouteParameters(List<MenuItem.MenuItemParameter> routeParameters) Sets the list of route parameters associated with this menu item.voidsetSeparator(boolean separator) Sets whether this menu item is a separator.voidsetShortcutCombination(KeyCombination shortcutCombination) Sets the keyboard shortcut combination associated with this menu item.voidSets the givencaptionto menu item.voidsetUrlQueryParameters(List<MenuItem.MenuItemParameter> urlQueryParameters) Sets the list of URL query parameters associated with this menu item.voidSets the view ID associated with this menu item.
-
Field Details
-
properties
-
urlQueryParameters
-
routeParameters
-
-
Constructor Details
-
MenuItem
-
Method Details
-
isMenu
public boolean isMenu()Returns whether the menu item represents a menu that contains other menu items.- Returns:
trueif the menu item is a menu;falseotherwise.
-
setMenu
public void setMenu(boolean isMenu) Sets whether this menu item represents a menu that contains other menu items.- Parameters:
isMenu-trueif the menu item is a menu;falseotherwise
-
getParent
Parent item. Null if this is root item. -
getChildren
Children items -
getId
Menu item ID as defined inmenu-config.xml -
getDescriptor
public org.dom4j.Element getDescriptor()Returns the descriptor of this menu item.- Returns:
- the
Elementrepresenting the descriptor
-
setDescriptor
public void setDescriptor(org.dom4j.Element descriptor) Sets the descriptor of this menu item.- Parameters:
descriptor- theElementrepresenting the descriptor
-
getTitle
- Returns:
- a raw string from menu XML config, can be a reference to localization message, e.g.
mainMsg://menuitem.title - See Also:
-
setTitle
Sets the givencaptionto menu item.- Parameters:
caption- menu item caption- See Also:
-
getDescription
- Returns:
- a raw string from menu XML config, can be a reference to localization message, e.g.
mainMsg://menuitem.description
-
setDescription
Sets the givendescriptionto menu item.- Parameters:
description- menu item description
-
getClassNames
Returns the CSS class names associated with this menu item.- Returns:
- a string containing the CSS class names
-
setClassNames
Sets the CSS class names associated with this menu item.- Parameters:
classNames- a string containing the CSS class names to be set for this menu item
-
getShortcutCombination
Returns the keyboard shortcut combination associated with this menu item.- Returns:
- the
KeyCombinationrepresenting the shortcut combination, ornullif no shortcut is defined
-
setShortcutCombination
Sets the keyboard shortcut combination associated with this menu item.- Parameters:
shortcutCombination- theKeyCombinationrepresenting the shortcut combination, ornullif no shortcut is to be defined
-
isSeparator
public boolean isSeparator()Returns whether the menu item is a separator.- Returns:
trueif the menu item is a separator;falseotherwise.
-
setSeparator
public void setSeparator(boolean separator) Sets whether this menu item is a separator.- Parameters:
separator-trueif the menu item is a separator;falseotherwise
-
getIcon
Returns the icon associated with this menu item.- Returns:
- the icon as a string, or
nullif no icon is associated
-
setIcon
Sets the icon associated with this menu item.- Parameters:
icon- the icon to associate with the menu item, ornullif no icon is to be set
-
isOpened
public boolean isOpened()Returns whether this menu item is currently in an expanded (opened) state.- Returns:
trueif the menu item is opened;falseotherwise.
-
setOpened
public void setOpened(boolean expanded) Sets whether this menu item is currently in an expanded (opened) state.- Parameters:
expanded-trueif the menu item is to be opened;falseotherwise
-
getView
Returns the view id associated with this menu item.- Returns:
- the view id, or
nullif no view is associated
-
setView
Sets the view ID associated with this menu item.- Parameters:
view- the view ID to associate with this menu item, ornullif no view is to be associated
-
getBean
Returns the bean name associated with this menu item.- Returns:
- the bean name, or
nullif no bean is associated
-
setBean
Sets the bean name associated with this menu item.- Parameters:
bean- the bean name to associate with this menu item, ornullif no bean is to be associated
-
getBeanMethod
Returns the bean method name associated with this menu item.- Returns:
- the bean method name, or
nullif no bean method is associated
-
setBeanMethod
Sets the bean method name associated with this menu item.- Parameters:
beanMethod- the bean method name to associate with this menu item, ornullif no bean method is to be associated
-
getProperties
Returns the list of properties associated with this menu item.- Returns:
- the list of
MenuItem.MenuItemPropertyobjects
-
setProperties
Sets the list of properties associated with this menu item.- Parameters:
properties- the list ofMenuItem.MenuItemPropertyobjects to associate with this menu item, ornullif no properties are to be set
-
getUrlQueryParameters
Returns the list of URL query parameters associated with this menu item. If no parameters are associated, an empty list is returned.- Returns:
- a list of
MenuItem.MenuItemParameterobjects representing the URL query parameters
-
setUrlQueryParameters
Sets the list of URL query parameters associated with this menu item.- Parameters:
urlQueryParameters- a list ofMenuItem.MenuItemParameterobjects representing the URL query parameters to associate with this menu item
-
getRouteParameters
Returns the list of route parameters associated with this menu item. If no parameters are associated, an empty list is returned.- Returns:
- a list of
MenuItem.MenuItemParameterobjects representing the route parameters
-
setRouteParameters
Sets the list of route parameters associated with this menu item.- Parameters:
routeParameters- a list ofMenuItem.MenuItemParameterobjects representing the route parameters to associate with this menu item
-