public class BaseAppNavBean extends Object
IAppNavPage
and a root IAppNavPage
,
this bean helps calculate the breadcrumbs from the root to the current IAppNavPage
,
as well as other useful properties.Modifier and Type | Class and Description |
---|---|
protected class |
BaseAppNavBean.PagesContentProvider
Map of all pages in the navigation hierarchy, keyed by id.
|
protected class |
BaseAppNavBean.SubNavsContentProvider
Map of a sub-
BaseAppNavBean for each page
in the navigation hierarchy, keyed by id. |
Modifier and Type | Field and Description |
---|---|
protected IAppNavPage |
m_current
Current page.
|
protected IAppNavPage |
m_root
Root page of the navigation hierarchy.
|
Constructor and Description |
---|
BaseAppNavBean()
Creates a new, uninitialized, web application navigation bean.
|
BaseAppNavBean(IAppNavPage root)
Creates a new web application navigation bean,
initialized with the specified root page.
|
BaseAppNavBean(IAppNavPage root,
IAppNavPage current)
Creates a new web application navigation bean,
initialized with the specified root page and current page.
|
Modifier and Type | Method and Description |
---|---|
protected BaseAppNavBean |
createSubNav()
Creates a new, uninitialized sub-navigation bean.
|
BaseAppNavBean |
createSubNav(IAppNavPage root)
Creates a new sub-navigation bean,
initialized with the specified root page.
|
BaseAppNavBean |
createSubNav(IAppNavPage root,
IAppNavPage current)
Creates a new sub-navigation bean initialized with the specified root page and current page.
|
IAppNavPage |
findPage(String id)
Finds the page with the specified id.
|
List<IAppNavPage> |
getBreadcrumbs()
List of pages on the path from the root page
to the current page, inclusive,
ordered from the root page to the current page.
|
IAppNavPage |
getCurrent()
Current page.
|
int |
getDepth()
Distance of the current page from the root page.
|
IAppNavPage |
getNextSibling()
Next sibling of the current page.
|
IContentProvider |
getPages()
Map of all pages in the navigation hierarchy, keyed by id.
|
List<IAppNavPage> |
getPagesList()
List of all pages in the navigation hierarchy.
|
IAppNavPage |
getParentNextSibling()
Next sibling of the current page's parent.
|
IAppNavPage |
getParentPrevSibling()
Previous sibling of the current page's parent.
|
IAppNavPage |
getPrevSibling()
Previous sibling of the current page.
|
IAppNavPage |
getRoot()
Root page of the navigation hierarchy.
|
IContentProvider |
getSubNavs()
Map of a sub-
BaseAppNavBean for each page
in the navigation hierarchy, keyed by id. |
void |
setCurrent(FacesContext context)
Sets the current page for the given context.
|
void |
setCurrent(IAppNavPage current)
Current page.
|
void |
setCurrentById(String id)
Sets the current page to the page with the specified id.
|
void |
setRoot(IAppNavPage root)
Root page of the navigation hierarchy.
|
protected IAppNavPage m_root
protected IAppNavPage m_current
public BaseAppNavBean()
public BaseAppNavBean(IAppNavPage root)
root
- Root page of the navigation hierarchy.public BaseAppNavBean(IAppNavPage root, IAppNavPage current)
root
- Root page of the navigation hierarchy.current
- Current page. Must be a descendant of the root (or the root itself).public IAppNavPage getRoot()
public void setRoot(IAppNavPage root)
public IAppNavPage getCurrent()
public void setCurrent(IAppNavPage current)
public void setCurrent(FacesContext context)
public void setCurrentById(String id)
public int getDepth()
public IAppNavPage getNextSibling()
public IAppNavPage getPrevSibling()
public IAppNavPage getParentNextSibling()
public IAppNavPage getParentPrevSibling()
public List<IAppNavPage> getBreadcrumbs()
public IContentProvider getPages()
getPages().getValue("/foo/bar.view")
will return the IAppNavPage
with an id of "/foo/bar.view"
(if there is no such page, it will return null).public List<IAppNavPage> getPagesList()
public IContentProvider getSubNavs()
BaseAppNavBean
for each page
in the navigation hierarchy, keyed by id.
For example, if there is a page with an id of "/foo/bar.view"
in the navigation hierarchy, getSubNavs().getValue("/foo/bar.view")
will return a BaseAppNavBean
for the sub-hierarchy
rooted by the page with an id of "/foo/bar.view"
(if there is no such page, it will return null).public IAppNavPage findPage(String id)
protected BaseAppNavBean createSubNav()
public BaseAppNavBean createSubNav(IAppNavPage root)
root
- Root page of the sub-navigation hierarchy.public BaseAppNavBean createSubNav(IAppNavPage root, IAppNavPage current)
root
- Root page of the sub-navigation hierarchy.current
- Current page. Must be a descendant of the root (or the root itself).