|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.faces.model.DataModel
org.apache.myfaces.trinidad.model.CollectionModel
org.apache.myfaces.trinidad.model.TreeModel
org.apache.myfaces.trinidad.model.MenuModel
org.apache.myfaces.trinidad.model.BaseMenuModel
org.apache.myfaces.trinidad.model.ViewIdPropertyMenuModel
public class ViewIdPropertyMenuModel
Creates a MenuModel from a TreeModel where nodes in the treeModel contain viewId information.
Each node must have either a bean getter method or a Map property that returns a viewId. There are several restrictions on the data:
Assuming that NavigationTree is a tree of beans with a vieId getter, an example of creating a MenuModel with this class might look like:
CollectionModel collectionModel = ModelUtils.toCollectionModel(new NavigationTree());
TreeModel treeModel = new ChildPropertyTreeModel(collectionModel, "children");
MenuModel menuModel = new ViewIdPropertyMenuModel(treeModel, "viewId");
| Constructor Summary | |
|---|---|
ViewIdPropertyMenuModel()
No-arg constructor for use with managed-beans. |
|
ViewIdPropertyMenuModel(java.lang.Object instance,
java.lang.String viewIdProperty)
|
|
| Method Summary | |
|---|---|
void |
addViewId(java.lang.String newViewId,
java.lang.String aliasedViewId)
Maps the focusPath returned when the viewId is newViewId to the focusPath returned when the viewId is aliasedViewId. |
protected java.lang.String |
getCurrentViewId()
Returns the current viewId. |
java.lang.Object |
getFocusRowKey()
Returns the rowKey to the current viewId. |
java.lang.String |
getViewIdProperty()
Gets the property to use to retrieve a viewId from a node in the tree |
void |
setViewIdProperty(java.lang.String viewIdProperty)
Sets the property to use to retrieve a viewId from a node in the tree |
void |
setWrappedData(java.lang.Object data)
|
| Methods inherited from class org.apache.myfaces.trinidad.model.BaseMenuModel |
|---|
enterContainer, exitContainer, getContainerRowKey, getRowCount, getRowData, getRowIndex, getRowKey, getWrappedData, isContainer, isRowAvailable, setRowIndex, setRowKey |
| Methods inherited from class org.apache.myfaces.trinidad.model.TreeModel |
|---|
getAllAncestorContainerRowKeys, getContainerRowKey, getDepth, getDepth, isContainerEmpty |
| Methods inherited from class org.apache.myfaces.trinidad.model.CollectionModel |
|---|
getRowData, getSortCriteria, isRowAvailable, isSortable, setSortCriteria |
| Methods inherited from class javax.faces.model.DataModel |
|---|
addDataModelListener, getDataModelListeners, removeDataModelListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ViewIdPropertyMenuModel()
setViewIdProperty(java.lang.String) and
setWrappedData(java.lang.Object) methods after constructing this instance.
public ViewIdPropertyMenuModel(java.lang.Object instance,
java.lang.String viewIdProperty)
throws java.beans.IntrospectionException
instance - a treeModel. This object will be passed to
ModelUtils.toTreeModel(java.lang.Object)viewIdProperty - the property to use to retrieve a viewId
from a node in the tree
java.beans.IntrospectionException| Method Detail |
|---|
public void setWrappedData(java.lang.Object data)
setWrappedData in class BaseMenuModelpublic java.lang.Object getFocusRowKey()
The getFocusRowKey method
getFocusRowKey in class MenuModel
public void addViewId(java.lang.String newViewId,
java.lang.String aliasedViewId)
newViewId - the view id to add a focus path foraliasedViewId - the view id to use to get the focusPath to use for newViewIdpublic java.lang.String getViewIdProperty()
public void setViewIdProperty(java.lang.String viewIdProperty)
protected java.lang.String getCurrentViewId()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||