|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.infordata.ifw2.web.grds.APojoGridModel<C>
net.infordata.ifw2.web.grds.PojoDataGridModel<C>
C - public class PojoDataGridModel<C>
An IPojoGridModel and IDataGridModel backed by a Collection
supporting data filtering and sorting only for columns bounded to any Comparable
pojo property.
| Constructor Summary | |
|---|---|
PojoDataGridModel(java.lang.Class<C> c)
|
|
PojoDataGridModel(java.lang.Class<C> c,
java.util.Collection<? extends C> data)
|
|
| Method Summary | |
|---|---|
void |
applyFilters(java.lang.String filteredColumnName,
java.util.Map<java.lang.String,AFilterDefinition<?>> filters)
If IDataGridModel.isFilterable() then this method can be used to change
data filter definitions, otherwise you can assume that it is never used. |
boolean |
canDoContainsSearch()
|
boolean |
canSearchOnSortedColumn()
|
int |
containsSearch(java.lang.String columnName,
java.lang.String value,
boolean forward,
int startFrom)
|
int |
fetchRows(int rowIndex,
int count)
Used by the ui to ensure that the request rows really exist without the need to retrieve any column value. |
int |
getCurrentRow()
|
int |
getCurrentRowCount()
|
java.util.List<C> |
getData()
Any modification maded to the returned collection is reflected into the model as soon as the _sync() method is directly called or
indirectly called. |
int |
getDataVersion()
|
java.util.List<C> |
getDataView()
|
java.util.Map<java.lang.String,AFilterDefinition<?>> |
getFilters()
|
C |
getPojo(int rowIndex)
|
int |
getRowCount()
|
java.lang.Boolean |
getSortedAscendingIndicator()
|
java.lang.String |
getSortedColumn()
|
boolean |
isFilterable()
|
boolean |
isSortable()
|
IColumn |
removeColumn(java.lang.String columnName)
|
int |
searchOnSortedColumn(java.lang.Object value)
Searches the given value between values of the currently sorted column. |
void |
setCurrentRow(int rowIndex)
|
void |
setSortedColumn(java.lang.String columnName,
boolean ascending)
If IDataGridModel.isSortable() then this method is used to change the sort order
otherwise you can assume that it is never used. |
void |
sync()
Called by the framework just before displaying the AGridFlow. |
| Methods inherited from class net.infordata.ifw2.web.grds.APojoGridModel |
|---|
getClassInfo, getColumn, getColumnCount, getColumnGroup, getColumnGroupsMap, getColumnIndex, getColumnName, getCurrentPojo, getPojoType, getProperty, getPropertyName, getValue, getValueAt, isCurrentRowFreezed, registerColumn, registerColumn, registerColumn, rowIndexOf |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.infordata.ifw2.web.grds.IGridModel |
|---|
getColumn, getColumnCount, getColumnGroup, getColumnIndex, getColumnName, getValueAt, isCurrentRowFreezed |
| Constructor Detail |
|---|
public PojoDataGridModel(java.lang.Class<C> c)
public PojoDataGridModel(java.lang.Class<C> c,
java.util.Collection<? extends C> data)
| Method Detail |
|---|
public IColumn removeColumn(java.lang.String columnName)
removeColumn in class APojoGridModel<C>columnName -
IColumn or null if none.public java.util.List<C> getData()
_sync() method is directly called or
indirectly called.
public final java.util.List<C> getDataView()
getDataView in interface IPojoGridModel<C>public void sync()
IGridModelAGridFlow.
sync in interface IGridModelsync in class APojoGridModel<C>public int getDataVersion()
getDataVersion in interface IPojoGridModel<C>getDataVersion in class APojoGridModel<C>IGridModel.sync().public void setCurrentRow(int rowIndex)
setCurrentRow in interface IGridModelpublic int getCurrentRow()
getCurrentRow in interface IGridModel
public int fetchRows(int rowIndex,
int count)
IGridModel
fetchRows in interface IGridModelfetchRows in class APojoGridModel<C>rowIndex - - starting from this index ...count - - ... we want this number of rows
IGridModel.getRowCount() must return the
real rows counter and a call to IGridModel.getCurrentRow() a valid
row index.public C getPojo(int rowIndex)
getPojo in interface IPojoGridModel<C>getPojo in class APojoGridModel<C>public int getCurrentRowCount()
getCurrentRowCount in interface IGridModelgetCurrentRowCount in class APojoGridModel<C>IGridModel.getRowCount() but can be less if the model supports paging.public int getRowCount()
getRowCount in interface IGridModelgetRowCount in class APojoGridModel<C>Integer.MAX_VALUE.public boolean isFilterable()
isFilterable in interface IDataGridModel
public void applyFilters(java.lang.String filteredColumnName,
java.util.Map<java.lang.String,AFilterDefinition<?>> filters)
IDataGridModelIDataGridModel.isFilterable() then this method can be used to change
data filter definitions, otherwise you can assume that it is never used.
applyFilters in interface IDataGridModelfilteredColumnName - - used in case a the filter has been applied on a
specific column, otherwise null.filters - - filters to be applied per columnpublic java.util.Map<java.lang.String,AFilterDefinition<?>> getFilters()
getFilters in interface IDataGridModelpublic boolean isSortable()
isSortable in interface IDataGridModelpublic final java.lang.String getSortedColumn()
getSortedColumn in interface IDataGridModelIDataGridModel.isSortable() == false, because the model can be
sorted but not sortable (ie the sort order is not changeable with the gui).public java.lang.Boolean getSortedAscendingIndicator()
getSortedAscendingIndicator in interface IDataGridModelIDataGridModel.isSortable() == false, because the model can be
sorted but not sortable (ie the sort order is not changeable with the ui).
public void setSortedColumn(java.lang.String columnName,
boolean ascending)
IDataGridModelIDataGridModel.isSortable() then this method is used to change the sort order
otherwise you can assume that it is never used.
setSortedColumn in interface IDataGridModelpublic int searchOnSortedColumn(java.lang.Object value)
IDataGridModel
searchOnSortedColumn in interface IDataGridModelCollections.binarySearch(java.util.List, Object).public boolean canSearchOnSortedColumn()
canSearchOnSortedColumn in interface IDataGridModelIDataGridModel.searchOnSortedColumn(Object) can used.
public int containsSearch(java.lang.String columnName,
java.lang.String value,
boolean forward,
int startFrom)
containsSearch in interface IDataGridModelpublic boolean canDoContainsSearch()
canDoContainsSearch in interface IDataGridModel#containsSearch(int, String, boolean, int) can be used.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||