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 TypeMethodDescriptionvoid
appendChildren
(Collection<MenuItem> children) Appends the item's children to the passed list@Nullable MenuItem
findChildByName
(String name) Get the item's children@Nullable String
An item *can* have an icon.@Nullable DisplayValue
getLabel()
Get labelGet the menu typegetName()
Every item must have a nameGet the item's parentgetPath()
int
Returns the position of the item within one hirarchygetProperties
(boolean useExtIcon) Get the item's properties (for json serialization)@Nullable String
An item *can* have an icon.getType()
Returns the interface-type of the itemboolean
boolean
void
setChildren
(List<MenuItem> children) Set childrenvoid
setExtIcon
(@Nullable String extIcon) Set the icon stringvoid
setLabel
(DisplayValue label) Set labelvoid
setMenuType
(String menuType) Menu type is in fact the tag-name of the menuvoid
Set the namevoid
setNewClientDisabled
(boolean disabled) Set if menu item is disabled in the new clientvoid
setOldClientDisabled
(boolean disabled) Set if menu item is disabled in the old clientvoid
Set parent itemvoid
setPosition
(int position) Set's the position of the item within one hirarchyvoid
setReactIcon
(@Nullable String reactIcon) Set the icon stringvoid
writeProperties
(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()
-