|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.navigator.menu.MenuRepository
public class MenuRepository
Holder of Menus and their items. Can be populated programmatically.
Field Summary | |
---|---|
protected String |
config
|
protected org.apache.commons.collections.map.LinkedMap |
displayers
|
static String |
MENU_REPOSITORY_KEY
|
protected org.apache.commons.collections.map.LinkedMap |
menus
|
protected String |
name
|
protected javax.servlet.ServletContext |
servletContext
|
protected org.apache.commons.collections.map.LinkedMap |
templates
|
Constructor Summary | |
---|---|
MenuRepository()
|
Method Summary | |
---|---|
void |
addMenu(MenuComponent menu)
Adds a new menu. |
void |
addMenuDisplayerMapping(MenuDisplayerMapping displayerMapping)
|
void |
buildBreadCrumbs()
|
void |
buildBreadCrumbs(String delimiter)
|
org.apache.commons.collections.map.LinkedMap |
getDisplayers()
This method is so menu repositories can retrieve displayers from the default repository specified in menu-config.xml |
String |
getLoadParam()
|
MenuComponent |
getMenu(String menuName)
|
MenuComponent |
getMenu(String menuName,
String delimiter)
Method getMenu. |
int |
getMenuDepth()
Method getMenuDepth. |
int |
getMenuDepth(String menuName)
Method getMenuDepth. |
MenuDisplayerMapping |
getMenuDisplayerMapping(String displayerName)
|
Set |
getMenuNames()
|
String |
getName()
|
javax.servlet.ServletContext |
getServletContext()
|
List |
getTopMenus()
Convenience method for dynamic menus - returns the top-level menus only. |
MenuComponent[] |
getTopMenusAsArray()
Method getTopMenusAsArray. |
List |
getTopMenusNames()
Get a List of all the top menus' names |
protected org.apache.commons.digester.Digester |
initDigester()
|
void |
load()
|
void |
reload()
|
void |
removeAllMenus()
Allows easy removal of all menus, suggested use for users wanting to reload menus without having to perform a complete reload of the MenuRepository |
void |
removeMenu(String name)
Allows easy removal of a menu by its name. |
void |
setBreadCrumbDelimiter(String string)
|
void |
setDisplayers(org.apache.commons.collections.map.LinkedMap displayers)
Allow the displayers to be set as a whole. |
void |
setLoadParam(String loadParam)
|
void |
setName(String name)
|
void |
setServletContext(javax.servlet.ServletContext context)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String MENU_REPOSITORY_KEY
protected String config
protected String name
protected javax.servlet.ServletContext servletContext
protected org.apache.commons.collections.map.LinkedMap menus
protected org.apache.commons.collections.map.LinkedMap displayers
protected org.apache.commons.collections.map.LinkedMap templates
Constructor Detail |
---|
public MenuRepository()
Method Detail |
---|
public Set getMenuNames()
public List getTopMenus()
public MenuComponent getMenu(String menuName)
public MenuDisplayerMapping getMenuDisplayerMapping(String displayerName)
protected org.apache.commons.digester.Digester initDigester()
public void addMenu(MenuComponent menu)
menu
- The menu component to add.public void removeMenu(String name)
name
- public void removeAllMenus()
public void addMenuDisplayerMapping(MenuDisplayerMapping displayerMapping)
public org.apache.commons.collections.map.LinkedMap getDisplayers()
public void setDisplayers(org.apache.commons.collections.map.LinkedMap displayers)
displayers
- public void load() throws LoadableResourceException
load
in interface LoadableResource
LoadableResourceException
public void reload() throws LoadableResourceException
reload
in interface LoadableResource
LoadableResourceException
public void setLoadParam(String loadParam)
setLoadParam
in interface LoadableResource
public String getLoadParam()
getLoadParam
in interface LoadableResource
public void setName(String name)
setName
in interface LoadableResource
public String getName()
getName
in interface LoadableResource
public javax.servlet.ServletContext getServletContext()
getServletContext
in interface LoadableResource
public void setServletContext(javax.servlet.ServletContext context)
setServletContext
in interface LoadableResource
public MenuComponent getMenu(String menuName, String delimiter)
menuName
- - e.g grandParent.parent.menudelimiter
- - e.g. '.'
public int getMenuDepth(String menuName)
menuName
- - name of the top menu to check the menu depth
public int getMenuDepth()
public MenuComponent[] getTopMenusAsArray()
public List getTopMenusNames()
public void setBreadCrumbDelimiter(String string)
public void buildBreadCrumbs()
public void buildBreadCrumbs(String delimiter)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |