Package ch.tocco.nice2.model.menu.api
Class AbstractMenuItem
java.lang.Object
ch.tocco.nice2.model.menu.api.AbstractMenuItem
- All Implemented Interfaces:
MenuItem
- Direct Known Subclasses:
ActionMenuItemImpl
,DefaultMenuItem
,DefaultRootMenuItem
,EntityExplorerMenuItemImpl
,FlowMenuItemImpl
Abstract menu item for convenience. If you just want to extend the
menu with an ordinary item, just extend this abstract implementation. It
just provides a few getter and setters and you yourself could add individual
properties via the
extendProperties(Map)
method.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
appendChildren
(Collection<MenuItem> children) Appends the item's children to the passed listprotected void
extendProperties
(Map<Object, Object> propertyMap) Empty implementation for conviniencefindChildByName
(String name) Get the item's childrenAn item *can* have an icon.@Nullable DisplayValue
getLabel()
Get labelGet the menu typegetName()
Every item must have a nameGet the item's parentgetPath()
int
Get the items position which represents the item's position within one hirachy.getProperties
(boolean useExtIcon) Get the item's properties (for json serialization)An item *can* have an icon.boolean
boolean
void
setChildren
(List<MenuItem> children) Set childrenvoid
setExtIcon
(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 the item's position which represents the item's position within one hirachy.void
setReactIcon
(String reactIcon) Set the icon stringvoid
writeProperties
(Map<Object, Object> map) Writes the the local properties to the passed map
-
Constructor Details
-
AbstractMenuItem
public AbstractMenuItem()
-
-
Method Details
-
getPosition
public int getPosition()Get the items position which represents the item's position within one hirachy.- Specified by:
getPosition
in interfaceMenuItem
- Returns:
- the position
-
setPosition
public void setPosition(int position) Set the item's position which represents the item's position within one hirachy.- Specified by:
setPosition
in interfaceMenuItem
- Parameters:
position
- the position
-
extendProperties
Empty implementation for convinience- Parameters:
propertyMap
- the propertymap where you can add you're own properties
-
writeProperties
Writes the the local properties to the passed map- Specified by:
writeProperties
in interfaceMenuItem
- Parameters:
map
- the map
-
getProperties
Description copied from interface:MenuItem
Get the item's properties (for json serialization)- Specified by:
getProperties
in interfaceMenuItem
- Parameters:
useExtIcon
- if true the ext icon is used (else the react icon)- Returns:
- the properties
-
getMenuType
Description copied from interface:MenuItem
Get the menu type- Specified by:
getMenuType
in interfaceMenuItem
- Returns:
- the menu type
-
setMenuType
Description copied from interface:MenuItem
Menu type is in fact the tag-name of the menu- Specified by:
setMenuType
in interfaceMenuItem
- Parameters:
menuType
- menu type
-
getChildren
Description copied from interface:MenuItem
Get the item's children- Specified by:
getChildren
in interfaceMenuItem
- Returns:
- the item's children
-
appendChildren
Description copied from interface:MenuItem
Appends the item's children to the passed list- Specified by:
appendChildren
in interfaceMenuItem
- Parameters:
children
- the list where you want to add the item's children
-
setChildren
Description copied from interface:MenuItem
Set children- Specified by:
setChildren
in interfaceMenuItem
- Parameters:
children
- the children
-
getParent
Description copied from interface:MenuItem
Get the item's parent -
getName
Description copied from interface:MenuItem
Every item must have a name -
setName
Description copied from interface:MenuItem
Set the name -
getLabel
Description copied from interface:MenuItem
Get label -
setLabel
Description copied from interface:MenuItem
Set label -
getExtIcon
Description copied from interface:MenuItem
An item *can* have an icon. Otherwise null is returned- Specified by:
getExtIcon
in interfaceMenuItem
- Returns:
- the icon string
-
setExtIcon
Description copied from interface:MenuItem
Set the icon string- Specified by:
setExtIcon
in interfaceMenuItem
- Parameters:
extIcon
- the icon string
-
getReactIcon
Description copied from interface:MenuItem
An item *can* have an icon. Otherwise null is returned- Specified by:
getReactIcon
in interfaceMenuItem
- Returns:
- the icon string
-
setReactIcon
Description copied from interface:MenuItem
Set the icon string- Specified by:
setReactIcon
in interfaceMenuItem
- Parameters:
reactIcon
- the icon string
-
setOldClientDisabled
public void setOldClientDisabled(boolean disabled) Description copied from interface:MenuItem
Set if menu item is disabled in the old client- Specified by:
setOldClientDisabled
in interfaceMenuItem
- Parameters:
disabled
- boolean
-
isOldClientDisabled
public boolean isOldClientDisabled()- Specified by:
isOldClientDisabled
in interfaceMenuItem
-
setNewClientDisabled
public void setNewClientDisabled(boolean disabled) Description copied from interface:MenuItem
Set if menu item is disabled in the new client- Specified by:
setNewClientDisabled
in interfaceMenuItem
- Parameters:
disabled
- boolean
-
isNewClientDisabled
public boolean isNewClientDisabled()- Specified by:
isNewClientDisabled
in interfaceMenuItem
-
findChildByName
- Specified by:
findChildByName
in interfaceMenuItem
-
getPath
-