public class ViewIdPropertyMenuModel extends BaseMenuModel
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");
LocalRowKeyIndex.Confidence, LocalRowKeyIndex.LocalCachingStrategy
Constructor and Description |
---|
ViewIdPropertyMenuModel()
No-arg constructor for use with managed-beans.
|
ViewIdPropertyMenuModel(Object instance,
String viewIdProperty) |
Modifier and Type | Method and Description |
---|---|
void |
addViewId(String newViewId,
String aliasedViewId)
Maps the focusPath returned when the viewId is newViewId
to the focusPath returned when the viewId is aliasedViewId.
|
protected String |
getCurrentViewId()
Returns the current viewId.
|
Object |
getFocusRowKey()
Returns the rowKey to the current viewId.
|
String |
getViewIdProperty()
Gets the property to use to retrieve a viewId
from a node in the tree
|
void |
setViewIdProperty(String viewIdProperty)
Sets the property to use to retrieve a viewId
from a node in the tree
|
void |
setWrappedData(Object data) |
enterContainer, exitContainer, getContainerRowKey, getRowCount, getRowData, getRowIndex, getRowKey, getWrappedData, isContainer, isRowAvailable, setRowIndex, setRowKey
areRowsLocallyAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, getAllAncestorContainerRowKeys, getContainerRowKey, getDepth, getDepth, isChildCollectionLocallyAvailable, isChildCollectionLocallyAvailable, isChildCollectionLocallyAvailable, isContainerEmpty
addRowKeyChangeListener, areRowsAvailable, areRowsAvailable, areRowsAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, clearCachedRow, clearCachedRow, clearCachedRows, clearCachedRows, clearLocalCache, fireRowKeyChange, getCachingStrategy, getEstimatedRowCount, getEstimatedRowCountConfidence, getRowData, getRowData, getSortCriteria, isRowAvailable, isRowAvailable, isRowLocallyAvailable, isRowLocallyAvailable, isSortable, removeRowKeyChangeListener, setSortCriteria
public ViewIdPropertyMenuModel()
setViewIdProperty(java.lang.String)
and
setWrappedData(java.lang.Object)
methods after constructing this instance.public ViewIdPropertyMenuModel(Object instance, String viewIdProperty) throws 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 treeIntrospectionException
public void setWrappedData(Object data)
setWrappedData
in class BaseMenuModel
public Object getFocusRowKey()
The getFocusRowKey method
getFocusRowKey
in class MenuModel
public void addViewId(String newViewId, 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 String getViewIdProperty()
public void setViewIdProperty(String viewIdProperty)
protected String getCurrentViewId()
Copyright © 2001-2016 The Apache Software Foundation. All Rights Reserved.