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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendChildren(Collection<MenuItem> children) Appends the item's children to the passed listprotected voidextendProperties(Map<Object, Object> propertyMap) Empty implementation for conviniencefindChildByName(String name) Get the item's childrenAn item *can* have an icon.@Nullable DisplayValuegetLabel()Get labelGet the menu typegetName()Every item must have a name@Nullable MenuItemGet the item's parentgetPath()intGet 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.booleanbooleanbooleanvoidsetAlwaysShowOldClient(boolean alwaysShowOldClient) Set if menu item should always be visible in legacy clientvoidsetChildren(List<MenuItem> children) Set childrenvoidsetExtIcon(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 the item's position which represents the item's position within one hirachy.voidsetReactIcon(String reactIcon) Set the icon stringvoidwriteProperties(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:
getPositionin 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:
setPositionin 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:
writePropertiesin interfaceMenuItem- Parameters:
map- the map
-
getProperties
Description copied from interface:MenuItemGet the item's properties (for json serialization)- Specified by:
getPropertiesin interfaceMenuItem- Parameters:
useExtIcon- if true the ext icon is used (else the react icon)- Returns:
- the properties
-
getMenuType
Description copied from interface:MenuItemGet the menu type- Specified by:
getMenuTypein interfaceMenuItem- Returns:
- the menu type
-
setMenuType
Description copied from interface:MenuItemMenu type is in fact the tag-name of the menu- Specified by:
setMenuTypein interfaceMenuItem- Parameters:
menuType- menu type
-
getChildren
Description copied from interface:MenuItemGet the item's children- Specified by:
getChildrenin interfaceMenuItem- Returns:
- the item's children
-
appendChildren
Description copied from interface:MenuItemAppends the item's children to the passed list- Specified by:
appendChildrenin interfaceMenuItem- Parameters:
children- the list where you want to add the item's children
-
setChildren
Description copied from interface:MenuItemSet children- Specified by:
setChildrenin interfaceMenuItem- Parameters:
children- the children
-
getParent
Description copied from interface:MenuItemGet the item's parent -
getName
Description copied from interface:MenuItemEvery item must have a name -
setName
Description copied from interface:MenuItemSet the name -
getLabel
Description copied from interface:MenuItemGet label -
setLabel
Description copied from interface:MenuItemSet label -
getExtIcon
Description copied from interface:MenuItemAn item *can* have an icon. Otherwise null is returned- Specified by:
getExtIconin interfaceMenuItem- Returns:
- the icon string
-
setExtIcon
Description copied from interface:MenuItemSet the icon string- Specified by:
setExtIconin interfaceMenuItem- Parameters:
extIcon- the icon string
-
getReactIcon
Description copied from interface:MenuItemAn item *can* have an icon. Otherwise null is returned- Specified by:
getReactIconin interfaceMenuItem- Returns:
- the icon string
-
setReactIcon
Description copied from interface:MenuItemSet the icon string- Specified by:
setReactIconin interfaceMenuItem- Parameters:
reactIcon- the icon string
-
setOldClientDisabled
public void setOldClientDisabled(boolean disabled) Description copied from interface:MenuItemSet if menu item is disabled in the old client- Specified by:
setOldClientDisabledin interfaceMenuItem- Parameters:
disabled- boolean
-
isOldClientDisabled
public boolean isOldClientDisabled()- Specified by:
isOldClientDisabledin interfaceMenuItem
-
setNewClientDisabled
public void setNewClientDisabled(boolean disabled) Description copied from interface:MenuItemSet if menu item is disabled in the new client- Specified by:
setNewClientDisabledin interfaceMenuItem- Parameters:
disabled- boolean
-
isNewClientDisabled
public boolean isNewClientDisabled()- Specified by:
isNewClientDisabledin interfaceMenuItem
-
isAlwaysShowOldClient
public boolean isAlwaysShowOldClient()- Specified by:
isAlwaysShowOldClientin interfaceMenuItem
-
setAlwaysShowOldClient
public void setAlwaysShowOldClient(boolean alwaysShowOldClient) Description copied from interface:MenuItemSet if menu item should always be visible in legacy client- Specified by:
setAlwaysShowOldClientin interfaceMenuItem
-
findChildByName
- Specified by:
findChildByNamein interfaceMenuItem
-
getPath
-