|
||||||||||
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.SortableModel
public class SortableModel
Creates a CollectionModel that is sortable. All properties that implement java.lang.Comparable are deemed sortable.
Constructor Summary | |
---|---|
SortableModel()
No arg constructor for use as a managed-bean. |
|
SortableModel(java.lang.Object model)
Create a new SortableModel from the given instance. |
Method Summary | |
---|---|
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 row key of the current row |
java.util.List<SortCriterion> |
getSortCriteria()
Gets the criteria that this collection is sorted by. |
java.lang.Object |
getWrappedData()
|
boolean |
isRowAvailable()
Checks to make sure a value exists for the current index or rowKey. |
boolean |
isSortable(java.lang.String property)
Checks to see if the underlying collection is sortable by the given property. |
void |
setRowIndex(int rowIndex)
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 |
setSortCriteria(java.util.List<SortCriterion> criteria)
Sorts this collection by the given criteria. |
void |
setWrappedData(java.lang.Object data)
Sets the underlying data being managed by this instance. |
java.lang.String |
toString()
|
Methods inherited from class org.apache.myfaces.trinidad.model.CollectionModel |
---|
getRowData, isRowAvailable |
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, wait, wait, wait |
Constructor Detail |
---|
public SortableModel(java.lang.Object model)
model
- This will be converted into a DataModel
setWrappedData(java.lang.Object)
public SortableModel()
Method Detail |
---|
public java.lang.Object getRowData()
RowKeyIndex
getRowData
in interface RowKeyIndex
getRowData
in class javax.faces.model.DataModel
RowKeyIndex.getRowKey()
,
RowKeyIndex.getRowIndex()
public java.lang.Object getWrappedData()
getWrappedData
in class javax.faces.model.DataModel
public boolean isRowAvailable()
RowKeyIndex
RowKeyIndex.getRowCount()
).
isRowAvailable
in interface RowKeyIndex
isRowAvailable
in class javax.faces.model.DataModel
RowKeyIndex.getRowKey()
,
RowKeyIndex.getRowIndex()
public void setWrappedData(java.lang.Object data)
setWrappedData
in class javax.faces.model.DataModel
data
- This Object will be converted into a
DataModel
.ModelUtils.toDataModel(java.lang.Object)
public int getRowCount()
RowKeyIndex
getRowCount
in interface RowKeyIndex
getRowCount
in class javax.faces.model.DataModel
public void setRowIndex(int rowIndex)
RowKeyIndex
setRowIndex
in interface RowKeyIndex
setRowIndex
in class javax.faces.model.DataModel
rowIndex
- the zero-based index of the value to make current.
Use -1 to clear the current valuepublic int getRowIndex()
RowKeyIndex
getRowIndex
in interface RowKeyIndex
getRowIndex
in class javax.faces.model.DataModel
public java.lang.Object getRowKey()
getRowKey
in interface RowKeyIndex
getRowKey
in class CollectionModel
CollectionModel.setRowKey(java.lang.Object)
public void setRowKey(java.lang.Object key)
setRowKey
in interface RowKeyIndex
setRowKey
in class CollectionModel
key
- the rowKey, previously obtained from CollectionModel.getRowKey()
.public boolean isSortable(java.lang.String property)
isSortable
in class CollectionModel
property
- The name of the property to sort the underlying collection by.
public java.util.List<SortCriterion> getSortCriteria()
CollectionModel
getSortCriteria
in class CollectionModel
SortCriterion
public void setSortCriteria(java.util.List<SortCriterion> criteria)
CollectionModel
setSortCriteria
in class CollectionModel
criteria
- Each element in this List must be of type SortCriterion.
The empty list may be used to cancel any sort order. null should be treated
the same as an empty list.SortCriterion
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |