public abstract class HierarchyTypeAutoNav<T extends IHierarchialReference> extends Object implements IMenuAutoNav
IHierarchialReference
hierarchy into MenuItem
& AuthorizableMenuItem
s and
insert/appends them to the menu & pageMenuMap (see navigation.xml) (Which page Item refers to which menu Item to determine current focused page/item).
Modifier and Type | Field and Description |
---|---|
protected List<String> |
filterNodesWithNames
We may want to exclude certain nodes/types of nodes from the Loading process while creating the Nav
Supply the unique names identifying the nodes. |
protected org.apache.commons.collections.Predicate |
filterPredicate
The Predicate used to filter our Nodes in filterNodesWithNames
|
Constructor and Description |
---|
HierarchyTypeAutoNav() |
Modifier and Type | Method and Description |
---|---|
protected void |
add(MenuItem parent,
List hierarchy)
Add hierarchy elements under the parent in recursive manner.
|
protected MenuItem |
addNode(MenuItem parent,
T node,
List<MenuItem> children)
Add Leaf nodes
|
protected void |
assignRootLevel(MenuItem root)
Assign a root level ;so that other generated
MenuItem know whoch MenuItem.getLevel() they are. |
List<String> |
getFilterNodesWithNames()
We may want to exclude certain nodes/types of nodes from the Loading process while creating the Nav
Supply the unique names identifying the nodes. |
MenuItem |
getGeneratedMenuItem(Object... params)
Generate a Menu based on context, logic and some optional/additional params
|
Map<String,MenuItem> |
getGeneratedPageMenuMap(Object... params)
TODO: This method is common with
ModuleUIAutoNav |
String |
getId()
A way to identify the navigator in the logs etc.
|
protected abstract String |
getRefId(T node)
An implementation of the reference to a node
|
protected abstract boolean |
isNodeNavigable(T node) |
void |
setFilterNodesWithNames(List<String> filterNodesWithNames)
We may want to exclude certain nodes/types of nodes from the Loading process while creating the Nav
Supply the unique names identifying the nodes. |
void |
setId(String id)
A way to identify the navigator in the logs etc.
|
String |
toString() |
protected void |
transform(List hierarchy)
Transform the loaded Hierarchy; filter etc.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getReferenceToPathMapping
protected List<String> filterNodesWithNames
protected org.apache.commons.collections.Predicate filterPredicate
protected final void add(MenuItem parent, List hierarchy)
parent
- as MenuItem
as the node to add children underhierarchy
- as the sub-hierarchy as List
of IHierarchialReference
nodesprotected abstract boolean isNodeNavigable(T node)
MenuItem.isNavigable()
protected MenuItem addNode(MenuItem parent, T node, List<MenuItem> children)
parent
- as MenuItem
as the node to add children undernode
- as type IHierarchialReference
children
- as List of MenuItem
protected abstract String getRefId(T node)
node
- String
protected void transform(List hierarchy)
filterNodesWithNames
to remove exceptions nodes (Common Use case)public MenuItem getGeneratedMenuItem(Object... params)
IMenuGenerator
getGeneratedMenuItem
in interface IMenuGenerator
params
- optionalMenuItem
protected void assignRootLevel(MenuItem root)
MenuItem
know whoch MenuItem.getLevel()
they are.
If kept null; level is not maintained in the tree.root
- public Map<String,MenuItem> getGeneratedPageMenuMap(Object... params)
ModuleUIAutoNav
getGeneratedPageMenuMap
in interface IMenuPathMapper
params
- as any paramsMap
of String to MenuItem
public List<String> getFilterNodesWithNames()
public void setFilterNodesWithNames(List<String> filterNodesWithNames)
public String getId()
public void setId(String id)
Copyright © 2018. All rights reserved.