public class MenuEntry extends Object implements Serializable
| Constructor and Description |
|---|
MenuEntry() |
MenuEntry(String name,
String displayName,
String target) |
MenuEntry(String name,
String displayName,
String target,
Set<String> securityRoles) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAdditionalCSS(String additionalCSS,
boolean relative)
path to CSS.
|
void |
addAdditionalJS(String additionalJS,
boolean relative)
path to additional JavaScript files.
|
void |
addSecurityRole(String securityRole) |
void |
addSubmenuEntry(MenuEntry submenu)
add a sub menu entry
|
void |
addVariable(String key,
Object variable)
add a additional variable for the template context
e.g.: if you want to access a self created object within the template which is not accessible via Thymeleaf bean resolution. |
Stream<MenuEntry> |
flattened() |
Map<String,Boolean> |
getAdditionalCSS() |
Map<String,Boolean> |
getAdditionalCSSReverse()
returns all additional js from this to upper menu item hierarchy beginning with the root.
|
Map<String,Boolean> |
getAdditionalJS() |
Map<String,Boolean> |
getAdditionalJSReverse()
returns all additional js from this to upper menu item hierarchy beginning with the root.
|
Set<String> |
getAffectedSecurityRoles()
the effective roles reverse recursive to component if not set at this object or anywhere within the tree
first menu entry or component with roles will return it. |
String |
getDisplayName()
display name shown in the menu
|
String |
getName()
the link mapping
|
MenuEntry |
getParent()
the parent entry or null if root
|
String |
getResouceMessageKey()
not implemented
|
Set<String> |
getSecurityRoles() |
List<MenuEntry> |
getSubmenu()
list of sub menu entries.
|
String |
getTarget()
relative path to target template
|
Object |
getVariable(String key)
returns the menu variable by key
|
Map<String,Object> |
getVariables()
returns the variables map
|
boolean |
isHide()
if set to true this menu entry will be hidden, but still requestable
|
boolean |
isUseCCSHierarchy() |
boolean |
isUseJSHierarchy() |
Stream<MenuEntry> |
reverseFlattened() |
void |
setAdditionalCSS(Map<String,Boolean> additionalCSS)
map with paths to CSS.
|
void |
setAdditionalJS(Map<String,Boolean> additionalJS)
map with path to additional JavaScript files.
|
void |
setDisplayName(String displayName)
display name shown in the menu
|
void |
setHide(boolean hide)
if set to true this menu entry will be hidden, but still requestable
|
void |
setName(String name)
the link mapping
|
void |
setParent(MenuEntry parent)
the parent entry or null if root
|
void |
setResouceMessageKey(String resouceMessageKey)
not implemented
|
void |
setSecurityRoles(Set<String> securityRoles) |
void |
setSubmenu(List<MenuEntry> submenu)
list of sub menu entries.
|
void |
setTarget(String targetTemplatePath)
relative path to target template using Thymeleaf default resolve mechanism.
|
void |
setUseCCSHierarchy(boolean useCCSHierarchy)
if this is set to true all css links up to root are collected and used.
|
void |
setUseJSHierarchy(boolean useJSHierarchy)
if this is set to true all css links up to root are collected and used.
|
void |
setVariables(Map<String,Object> variables)
additional variables for the template context
e.g.: if you want to access a self created object within the template which is not accessible via Thymeleaf bean resolution.
|
String |
toString() |
public MenuEntry()
public MenuEntry(String name, String displayName, String target)
name - - the link mappingdisplayName - - the display nametarget - - the template path. see setTarget(String)public MenuEntry(String name, String displayName, String target, Set<String> securityRoles)
name - - the link mappingdisplayName - - the display nametarget - - the template path. see setTarget(String)securityRoles - - Set of roles to check against the current user for displaying/hiding menu entries in the frontendpublic String getName()
public void setName(String name)
name - the name to setpublic String getDisplayName()
public void setDisplayName(String displayName)
displayName - the displayName to setpublic String getResouceMessageKey()
public void setResouceMessageKey(String resouceMessageKey)
resouceMessageKey - the resouceMessageKey to setpublic String getTarget()
setTarget(String)public void setTarget(String targetTemplatePath)
target - the target template pathpublic boolean isHide()
public void setHide(boolean hide)
hide - the hide to setpublic MenuEntry getParent()
public void setParent(MenuEntry parent)
parent - the parent to setpublic void setSubmenu(List<MenuEntry> submenu)
submenu - the submenu to setpublic void addSubmenuEntry(MenuEntry submenu)
mainmenu - the mainmenu to setpublic Stream<MenuEntry> flattened()
public Map<String,Boolean> getAdditionalCSS()
public void setAdditionalCSS(Map<String,Boolean> additionalCSS)
additionalCSS - the additionalCSS to setaddAdditionalCSS(String, boolean)public void addAdditionalCSS(String additionalCSS, boolean relative)
addAdditionalCSS("/static/myComponent/css/myStyles.css", true);
addAdditionalCSS("http://example.com/styles.css", false);
additionalCSS - the additionalCSS to setpublic Map<String,Boolean> getAdditionalCSSReverse()
public boolean isUseCCSHierarchy()
public void setUseCCSHierarchy(boolean useCCSHierarchy)
useCCSHierarchy - public void setAdditionalJS(Map<String,Boolean> additionalJS)
additionalJS - the additionalJS to setaddAdditionalJS(String, boolean)public void addAdditionalJS(String additionalJS, boolean relative)
addAdditionalJS("/static/myComponent/js/myScripts.js", true);
addAdditionalJS("http://example.com/script.js", false);
additionalJS - the additionalJS to setpublic Map<String,Boolean> getAdditionalJSReverse()
public boolean isUseJSHierarchy()
public void setUseJSHierarchy(boolean useJSHierarchy)
useCCSHierarchy - public Set<String> getAffectedSecurityRoles()
public void setSecurityRoles(Set<String> securityRoles)
securityRoles - the securityRoles to setpublic void addSecurityRole(String securityRole)
securityRole - the securityRoles to setpublic Map<String,Object> getVariables()
public Object getVariable(String key)
key - public void setVariables(Map<String,Object> variables)
variables - the variables to setpublic void addVariable(String key, Object variable)
variables - the variables to setCopyright © 2016–2017. All rights reserved.