Package ch.tocco.nice2.model.menu.api
Interface MenuItem
- All Known Subinterfaces:
ActionMenuItem,EntityExplorerMenuItem,FlowMenuItem,RootMenuItem
- All Known Implementing Classes:
AbstractMenuItem,ActionMenuItemImpl,DefaultMenuItem,DefaultRootMenuItem,EntityExplorerMenuItemImpl,FlowMenuItemImpl
public interface MenuItem
A menu item. Must be extended and contributed by other modules. I don't know
what kind of items exist.
Please use
AbstractMenuItemReader when adding
a new menu item.-
Method Summary
Modifier and TypeMethodDescriptionvoidappendChildren(Collection<MenuItem> children) Appends the item's children to the passed list@Nullable MenuItemfindChildByName(String name) Get the item's children@Nullable StringAn item *can* have an icon.@Nullable DisplayValuegetLabel()Get labelGet the menu typegetName()Every item must have a nameGet the item's parentgetPath()intReturns the position of the item within one hirarchygetProperties(boolean useExtIcon) Get the item's properties (for json serialization)@Nullable StringAn item *can* have an icon.getType()Returns the interface-type of the itembooleanbooleanbooleanvoidsetAlwaysShowOldClient(boolean alwaysShowOldClient) Set if menu item should always be visible in legacy clientvoidsetChildren(List<MenuItem> children) Set childrenvoidsetExtIcon(@Nullable String extIcon) Set the icon stringvoidsetLabel(DisplayValue label) Set labelvoidsetMenuType(String menuType) Menu type is in fact the tag-name of the menuvoidSet the namevoidsetNewClientDisabled(boolean disabled) Set if menu item is disabled in the new clientvoidsetOldClientDisabled(boolean disabled) Set if menu item is disabled in the old clientvoidSet parent itemvoidsetPosition(int position) Set's the position of the item within one hirarchyvoidsetReactIcon(@Nullable String reactIcon) Set the icon stringvoidwriteProperties(Map<Object, Object> map) Add the item's properties to the given map.
-
Method Details
-
getChildren
Get the item's children- Returns:
- the item's children
-
appendChildren
Appends the item's children to the passed list- Parameters:
children- the list where you want to add the item's children
-
getType
Returns the interface-type of the item- Returns:
- the type
-
setPosition
void setPosition(int position) Set's the position of the item within one hirarchy- Parameters:
position- the position
-
getPosition
int getPosition()Returns the position of the item within one hirarchy- Returns:
- the position
-
getParent
MenuItem getParent()Get the item's parent- Returns:
- parent item or null when no parent
-
getName
String getName()Every item must have a name- Returns:
- the name
-
setName
Set the name- Parameters:
name- the name of the item
-
getLabel
Get label- Returns:
- the label
-
setMenuType
Menu type is in fact the tag-name of the menu- Parameters:
menuType- menu type
-
setLabel
Set label- Parameters:
label- the label
-
setChildren
Set children- Parameters:
children- the children
-
getMenuType
String getMenuType()Get the menu type- Returns:
- the menu type
-
getProperties
Get the item's properties (for json serialization)- Parameters:
useExtIcon- if true the ext icon is used (else the react icon)- Returns:
- the properties
-
writeProperties
Add the item's properties to the given map.- Parameters:
map- the map where you want to add the item's properties
-
getExtIcon
An item *can* have an icon. Otherwise null is returned- Returns:
- the icon string
-
setExtIcon
Set the icon string- Parameters:
extIcon- the icon string
-
getReactIcon
An item *can* have an icon. Otherwise null is returned- Returns:
- the icon string
-
setReactIcon
Set the icon string- Parameters:
reactIcon- the icon string
-
findChildByName
-
getPath
String getPath() -
setOldClientDisabled
void setOldClientDisabled(boolean disabled) Set if menu item is disabled in the old client- Parameters:
disabled- boolean
-
isOldClientDisabled
boolean isOldClientDisabled() -
setNewClientDisabled
void setNewClientDisabled(boolean disabled) Set if menu item is disabled in the new client- Parameters:
disabled- boolean
-
isNewClientDisabled
boolean isNewClientDisabled() -
setAlwaysShowOldClient
void setAlwaysShowOldClient(boolean alwaysShowOldClient) Set if menu item should always be visible in legacy client -
isAlwaysShowOldClient
boolean isAlwaysShowOldClient()
-