Class SubMenuItem
- java.lang.Object
-
- com.novomind.ecom.api.imail.routing.frontend.menu.SubMenuItem
-
- All Implemented Interfaces:
com.novomind.ecom.common.api.attribute.DisplayNamed
,com.novomind.ecom.common.api.attribute.Named
public final class SubMenuItem extends java.lang.Object implements com.novomind.ecom.common.api.attribute.DisplayNamed
This class represents a sub menu item for the entry points in the Supervisor menu.
The menu can store several sub menu items with
addSubMenuItem(SubMenuItem)
. If so theisOpened()
option defines whether this sub menu is opened per default or not.The menu is generated at view scope, meaning every time the user go to another site. For this reason it is very important to cache the custom menu object as much as possible.
The xhtml files have to be in the directory
META-INF/includes
.- Since:
- 10.0.34
-
-
Constructor Summary
Constructors Constructor Description SubMenuItem(java.lang.String name)
Creates a new sub menu item with a given default display text.SubMenuItem(java.lang.String name, Privilege privilege)
Creates a new sub menu item with a given default display text and privilege.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SubMenuItem
addSubMenuItem(SubMenuItem subMenuItem)
Adds a new sub menu item to the menu item.java.lang.String
getName()
java.util.Optional<Privilege>
getPrivilege()
Returns thePrivilege
of this SubMenuItem, if presentjava.util.List<SubMenuItem>
getSubMenuItems()
java.lang.String
getUrl()
boolean
isOpened()
SubMenuItem
setOpened(boolean isOpened)
SubMenuItem
setUrl(java.lang.String url)
-
-
-
Constructor Detail
-
SubMenuItem
public SubMenuItem(java.lang.String name)
Creates a new sub menu item with a given default display text.- Parameters:
name
- the name- Since:
- 10.0.34
-
SubMenuItem
public SubMenuItem(java.lang.String name, Privilege privilege)
Creates a new sub menu item with a given default display text and privilege.- Parameters:
name
- the nameprivilege
- thePrivilege
for thisSubMenuItem
- Since:
- 11.5
-
-
Method Detail
-
getUrl
public java.lang.String getUrl()
- Returns:
- the outcome
- Since:
- 10.0.34
-
getSubMenuItems
public java.util.List<SubMenuItem> getSubMenuItems()
- Returns:
- the subMenuItems
- Since:
- 10.0.34
-
isOpened
public boolean isOpened()
- Returns:
- the isOpened
- Since:
- 10.0.34
-
setOpened
public SubMenuItem setOpened(boolean isOpened)
- Parameters:
isOpened
- the isOpened to set- Returns:
this
- Since:
- 10.0.34
-
addSubMenuItem
public SubMenuItem addSubMenuItem(SubMenuItem subMenuItem)
Adds a new sub menu item to the menu item.- Parameters:
subMenuItem
- the sub menu item to add- Returns:
this
- Since:
- 10.0.34
-
setUrl
public SubMenuItem setUrl(java.lang.String url)
- Parameters:
url
- the outcome to set- Returns:
this
- Since:
- 10.0.34
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfacecom.novomind.ecom.common.api.attribute.Named
- Since:
- 10.0.34
-
-