public class LazyGridDataModel extends EditableGridDataModel implements LazyLoadable
The total amount of rows is always greater or equal to data set length.
EditableGridDataModel.RowComparator| Constructor and Description |
|---|
LazyGridDataModel(DataModelCallbackHandler<Editable> handler)
Initializes the model with the preloaded piece of data set.
|
LazyGridDataModel(Object[][] data)
Initializes the model with the preloaded piece of data set.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRow(int beforeRow,
Object[] row)
This method adds the specified row in the data model.
|
int |
getEndRow()
This method returns an end row number.
|
protected String |
getInternalRowIdentifier(int row)
This method returns an internal row identifier.
|
Object[] |
getRowData(int rowNumber)
This method returns row data by the specified row number.
|
int |
getTotalRowCount()
This method return the total row amount.
|
boolean |
isEmpty()
This method checks whether the data model is empty.
|
void |
removeAll()
This method removes all rows from the model.
|
void |
removeRow(int rowNumber)
This method removes the specified row in the data model.
|
void |
setSortColumn(int sortColumn,
Comparator comparator)
This implemntation doesn't do client sorting.
|
void |
setTotalRowCount(int totalRowCount)
Sets the total row count value.
|
void |
update(int row,
int column,
Object data)
This method updates the specified cell with the value.
|
void |
updateRow(int rowNumber,
Object[] row)
This method updates the specified row in the data model.
|
addColumn, addColumn, addListener, checkColumnNumber, checkRowNumber, clearRemovedRows, createEvent, createEvent, createGridRow, createRowComparator, fireColumnEvent, fireEvent, fireRowEvent, getColumnNames, getColumnNamesList, getColumns, getData, getDataList, getGridColumn, getHandler, getListeners, getRemovedRows, getRow, getRows, getSublist, getTotalColumnCount, normalizeColumnsCount, normalizeRowsCount, prepareData, prepareEvent, removeColumn, removeColumn, removeListener, setColumNames, setHandler, update, updateColumn, updateColumngetCurrentPageNumber, getDisplayedPages, getEndPage, getPageable, getPageSize, getSortColumn, getStartPage, getStartRow, getTotalPagesNumber, isAscending, setAscending, setCurrentPageNumber, setDisplayedPages, setPageable, setPageSize, setSortColumn, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetSortColumn, getStartRow, isAscending, setAscending, setSortColumngetCurrentPageNumber, getDisplayedPages, getEndPage, getPageSize, getStartPage, getTotalPagesNumber, setCurrentPageNumber, setDisplayedPages, setPageSizepublic LazyGridDataModel(Object[][] data)
data - is a data set piece.public LazyGridDataModel(DataModelCallbackHandler<Editable> handler)
handler - is a data model change callback handler.public int getTotalRowCount()
If it hasn't been redefined, it returns data set length (and in this case the model works as usual).
getTotalRowCount in interface GridDataModelgetTotalRowCount in class EditableGridDataModelpublic void addRow(int beforeRow,
Object[] row)
throws IllegalArgumentException
It normalizes the model if the row is too long.
addRow in interface EditableaddRow in class EditableGridDataModelbeforeRow - is a number of the new row in the grid.row - is new row data.IllegalArgumentException - if the row number is in invalid range.public void updateRow(int rowNumber,
Object[] row)
throws IllegalArgumentException
It normalizes the model if the row is too long.
updateRow in interface EditableupdateRow in class EditableGridDataModelrowNumber - is a number of the row in the grid.row - is new data.IllegalArgumentException - if the row number is in invalid range.public void removeRow(int rowNumber)
throws IllegalArgumentException
removeRow in interface EditableremoveRow in class EditableGridDataModelrowNumber - is a number of the row in the grid.IllegalArgumentException - if the row number is in invalid range.public int getEndRow()
getEndRow in interface GridDataModelgetEndRow in class SimpleGridDataModelpublic Object[] getRowData(int rowNumber)
getRowData in interface GridDataModelgetRowData in class EditableGridDataModelrowNumber - is a number of row to be returned.public boolean isEmpty()
isEmpty in interface GridDataModelisEmpty in class SimpleGridDataModeltrue if the model is empty.public void removeAll()
removeAll in interface EditableremoveAll in class EditableGridDataModelpublic void setSortColumn(int sortColumn,
Comparator comparator)
setSortColumn in interface EditablesetSortColumn in class EditableGridDataModelsortColumn - is a sort column.comparator - is a comparator that is never used.public void setTotalRowCount(int totalRowCount)
setTotalRowCount in interface LazyLoadabletotalRowCount - is a total row count value.public void update(int row,
int column,
Object data)
update in interface Editableupdate in class EditableGridDataModelrow - is a row number.column - is a column number.data - is a data to be applied.protected String getInternalRowIdentifier(int row)
getInternalRowIdentifier in class EditableGridDataModelrow - is a row number.Copyright © 2008–2013. All rights reserved.