public abstract class BaseMenuModel extends MenuModel
LocalRowKeyIndex.Confidence, LocalRowKeyIndex.LocalCachingStrategy
Modifier | Constructor and Description |
---|---|
protected |
BaseMenuModel()
no-arg constructor needed for managed-bean support.
|
|
BaseMenuModel(Object modelObject) |
Modifier and Type | Method and Description |
---|---|
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.
|
Object |
getContainerRowKey(Object childKey)
Gets the rowKey of a given child row's container row.
|
int |
getRowCount()
Gets the number of values in this collection
|
Object |
getRowData()
Gets the current value identified by the current index or rowKey.
|
int |
getRowIndex()
Gets the index of the current value.
|
Object |
getRowKey()
Gets the rowKey of the current row.
|
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(Object key)
Finds the row with the matching key and makes it current
|
void |
setWrappedData(Object data) |
getFocusRowKey
areRowsLocallyAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, getAllAncestorContainerRowKeys, getContainerRowKey, getDepth, getDepth, isChildCollectionLocallyAvailable, isChildCollectionLocallyAvailable, isChildCollectionLocallyAvailable, isContainerEmpty
addRowKeyChangeListener, areRowsAvailable, areRowsAvailable, areRowsAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, clearCachedRow, clearCachedRow, clearCachedRows, clearCachedRows, clearLocalCache, ensureRowsAvailable, fireRowKeyChange, getCachingStrategy, getEstimatedRowCount, getEstimatedRowCountConfidence, getRowData, getRowData, getSortCriteria, isRowAvailable, isRowAvailable, isRowLocallyAvailable, isRowLocallyAvailable, isSortable, removeRowKeyChangeListener, setSortCriteria
public BaseMenuModel(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.public Object getContainerRowKey(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 TreeModel
childKey
- the rowKey of the child row.public void enterContainer()
TreeModel
TreeModel.isContainer()
returns true.
DataModel.getRowCount()
can be used to get the number of children.enterContainer
in class TreeModel
public void exitContainer()
TreeModel
exitContainer
in class TreeModel
public int getRowCount()
RowKeyIndex
getRowCount
in interface RowKeyIndex
getRowCount
in class javax.faces.model.DataModel
public Object getRowData()
RowKeyIndex
getRowData
in interface RowKeyIndex
getRowData
in class javax.faces.model.DataModel
RowKeyIndex.getRowKey()
,
RowKeyIndex.getRowIndex()
public int getRowIndex()
RowKeyIndex
getRowIndex
in interface RowKeyIndex
getRowIndex
in class javax.faces.model.DataModel
public Object getRowKey()
CollectionModel
Object.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 RowKeyIndex
getRowKey
in class CollectionModel
CollectionModel.setRowKey(java.lang.Object)
public Object getWrappedData()
getWrappedData
in class javax.faces.model.DataModel
public boolean isContainer()
TreeModel
TreeModel.isContainerEmpty()
to see if the current container element actually
has children, or is an empty container.isContainer
in class TreeModel
public boolean isRowAvailable()
RowKeyIndex
RowKeyIndex.getRowCount()
).isRowAvailable
in interface RowKeyIndex
isRowAvailable
in class javax.faces.model.DataModel
RowKeyIndex.getRowKey()
,
RowKeyIndex.getRowIndex()
public void setRowIndex(int index)
RowKeyIndex
setRowIndex
in interface RowKeyIndex
setRowIndex
in class javax.faces.model.DataModel
index
- the zero-based index of the value to make current.
Use -1 to clear the current valuepublic void setRowKey(Object key)
CollectionModel
setRowKey
in interface RowKeyIndex
setRowKey
in class CollectionModel
key
- the rowKey, previously obtained from CollectionModel.getRowKey()
.public void setWrappedData(Object data)
setWrappedData
in class javax.faces.model.DataModel
Copyright © 2001-2016 The Apache Software Foundation. All Rights Reserved.