public class DataGridModelAdapter extends java.lang.Object implements IDataGridModel, java.io.Serializable
Constructor and Description |
---|
DataGridModelAdapter(IGridModel model) |
Modifier and Type | Method and Description |
---|---|
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.
The ui is simply saying that it wants to get access to the given rows. |
IColumn |
getColumn(int columnIndex) |
int |
getColumnCount() |
IColumnGroup |
getColumnGroup(java.lang.String groupId) |
int |
getColumnIndex(java.lang.String columnName) |
java.lang.String |
getColumnName(int columnIndex) |
int |
getCurrentRow() |
int |
getCurrentRowCount() |
java.util.Map<java.lang.String,AFilterDefinition<?>> |
getFilters() |
int |
getRowCount() |
java.lang.Boolean |
getSortedAscendingIndicator() |
java.lang.String |
getSortedColumn() |
java.lang.Object |
getValueAt(int rowIndex,
int columnIndex) |
boolean |
isCurrentRowFreezed() |
boolean |
isFilterable() |
boolean |
isSortable() |
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 .Here is where the model can, as an example, ensure that depending sub models are synchronized or to restore data after a serialization. Keep in mind that after synchronizing the model internal state can be changed. |
public DataGridModelAdapter(IGridModel model)
public void applyFilters(java.lang.String filteredColumnName, java.util.Map<java.lang.String,AFilterDefinition<?>> filters)
IDataGridModel
IDataGridModel.isFilterable()
then this method can be used to change
data filter definitions, otherwise you can assume that it is never used.applyFilters
in interface IDataGridModel
filteredColumnName
- - 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 IDataGridModel
public java.lang.Boolean getSortedAscendingIndicator()
getSortedAscendingIndicator
in interface IDataGridModel
IDataGridModel.isSortable()
== false, because the model can be
sorted but not sortable (ie the sort order is not changeable with the ui).public java.lang.String getSortedColumn()
getSortedColumn
in interface IDataGridModel
IDataGridModel.isSortable()
== false, because the model can be
sorted but not sortable (ie the sort order is not changeable with the gui).public boolean isFilterable()
isFilterable
in interface IDataGridModel
public boolean isSortable()
isSortable
in interface IDataGridModel
public void setSortedColumn(java.lang.String columnName, boolean ascending)
IDataGridModel
IDataGridModel.isSortable()
then this method is used to change the sort order
otherwise you can assume that it is never used.setSortedColumn
in interface IDataGridModel
public int searchOnSortedColumn(java.lang.Object value)
IDataGridModel
searchOnSortedColumn
in interface IDataGridModel
Collections.binarySearch(java.util.List, Object)
.public boolean canSearchOnSortedColumn()
canSearchOnSortedColumn
in interface IDataGridModel
IDataGridModel.searchOnSortedColumn(Object)
can used.public int containsSearch(java.lang.String columnName, java.lang.String value, boolean forward, int startFrom)
containsSearch
in interface IDataGridModel
public boolean canDoContainsSearch()
canDoContainsSearch
in interface IDataGridModel
#containsSearch(int, String, boolean, int)
can be used.public int fetchRows(int rowIndex, int count)
IGridModel
fetchRows
in interface IGridModel
rowIndex
- - starting from this index ...count
- - ... we want this number of rowsIGridModel.getRowCount()
must return the
real rows counter and a call to IGridModel.getCurrentRow()
a valid
row index.public IColumnGroup getColumnGroup(java.lang.String groupId)
getColumnGroup
in interface IGridModel
public IColumn getColumn(int columnIndex)
getColumn
in interface IGridModel
public int getColumnCount()
getColumnCount
in interface IGridModel
public int getColumnIndex(java.lang.String columnName)
getColumnIndex
in interface IGridModel
public java.lang.String getColumnName(int columnIndex)
getColumnName
in interface IGridModel
public int getCurrentRow()
getCurrentRow
in interface IGridModel
public int getCurrentRowCount()
getCurrentRowCount
in interface IGridModel
IGridModel.getRowCount()
but can be less if the model supports paging.public int getRowCount()
getRowCount
in interface IGridModel
Integer.MAX_VALUE
.public java.lang.Object getValueAt(int rowIndex, int columnIndex)
getValueAt
in interface IGridModel
public boolean isCurrentRowFreezed()
isCurrentRowFreezed
in interface IGridModel
public void setCurrentRow(int rowIndex)
setCurrentRow
in interface IGridModel
public void sync()
IGridModel
AGridFlow
.sync
in interface IGridModel