|
||||||||||
| 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
public abstract class BaseMenuModel
A base class which takes a TreeModel. Developers can extend this class and just override the getFocusRowKey() method.
| Constructor Summary | |
|---|---|
protected |
BaseMenuModel()
no-arg constructor needed for managed-bean support. |
|
BaseMenuModel(java.lang.Object modelObject)
|
| Method Summary | |
|---|---|
void |
enterContainer()
This Collection changes to reflect the children of the current rowData, and the current rowData changes to be null. |
void |
exitContainer()
Pops back up to the parent collection. |
java.lang.Object |
getContainerRowKey(java.lang.Object childKey)
Gets the rowKey of a given child row's container row. |
int |
getRowCount()
Gets the number of values in this collection |
java.lang.Object |
getRowData()
Gets the current value identified by the current index or rowKey. |
int |
getRowIndex()
Gets the index of the current value. |
java.lang.Object |
getRowKey()
Gets the rowKey of the current row. |
java.lang.Object |
getWrappedData()
|
boolean |
isContainer()
Tests to see if the row identified by getRowData() is a container element. |
boolean |
isRowAvailable()
Checks to make sure a value exists for the current index or rowKey. |
void |
setRowIndex(int index)
Sets up a value at a particular index to be the current value. |
void |
setRowKey(java.lang.Object key)
Finds the row with the matching key and makes it current |
void |
setWrappedData(java.lang.Object data)
|
| Methods inherited from class org.apache.myfaces.trinidad.model.MenuModel |
|---|
getFocusRowKey |
| 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 BaseMenuModel(java.lang.Object modelObject)
modelObject - the treeModel to use, this object will be passed to
ModelUtils.toTreeModel(java.lang.Object).protected BaseMenuModel()
setWrappedData(java.lang.Object) must be called soon after constructing this
instance.
| Method Detail |
|---|
public java.lang.Object getContainerRowKey(java.lang.Object childKey)
TreeModel|-Root1 (rowKey="r1", containerRowKey=null) | |-Folder1 (rowKey="r1f1", containerRowKey="r1") | | |-Node1 (rowKey="r1f1n1", containerRowKey="r1f1") | | |-Node2 (rowKey="r1f1n2", containerRowKey="r1f1")
getContainerRowKey in class TreeModelchildKey - the rowKey of the child row.
public void enterContainer()
TreeModelTreeModel.isContainer() returns true.
DataModel.getRowCount() can be used to get the number of children.
enterContainer in class TreeModelpublic void exitContainer()
TreeModel
exitContainer in class TreeModelpublic int getRowCount()
RowKeyIndex
getRowCount in interface RowKeyIndexgetRowCount in class javax.faces.model.DataModelpublic java.lang.Object getRowData()
RowKeyIndex
getRowData in interface RowKeyIndexgetRowData in class javax.faces.model.DataModelRowKeyIndex.getRowKey(),
RowKeyIndex.getRowIndex()public int getRowIndex()
RowKeyIndex
getRowIndex in interface RowKeyIndexgetRowIndex in class javax.faces.model.DataModelpublic java.lang.Object getRowKey()
CollectionModelObject.equals(java.lang.Object) and Object.hashCode() as they will be used
as keys in hashtables. rowKeys should also be Serializable, so that the
application can run under all JSF state-saving schemes.
getRowKey in interface RowKeyIndexgetRowKey in class CollectionModelCollectionModel.setRowKey(java.lang.Object)public java.lang.Object getWrappedData()
getWrappedData in class javax.faces.model.DataModelpublic boolean isContainer()
TreeModelTreeModel.isContainerEmpty() to see if the current container element actually
has children, or is an empty container.
isContainer in class TreeModelpublic boolean isRowAvailable()
RowKeyIndexRowKeyIndex.getRowCount()).
isRowAvailable in interface RowKeyIndexisRowAvailable in class javax.faces.model.DataModelRowKeyIndex.getRowKey(),
RowKeyIndex.getRowIndex()public void setRowIndex(int index)
RowKeyIndex
setRowIndex in interface RowKeyIndexsetRowIndex in class javax.faces.model.DataModelindex - the zero-based index of the value to make current.
Use -1 to clear the current valuepublic void setRowKey(java.lang.Object key)
CollectionModel
setRowKey in interface RowKeyIndexsetRowKey in class CollectionModelkey - the rowKey, previously obtained from CollectionModel.getRowKey().public void setWrappedData(java.lang.Object data)
setWrappedData in class javax.faces.model.DataModel
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||