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, updateColumn
getCurrentPageNumber, getDisplayedPages, getEndPage, getPageable, getPageSize, getSortColumn, getStartPage, getStartRow, getTotalPagesNumber, isAscending, setAscending, setCurrentPageNumber, setDisplayedPages, setPageable, setPageSize, setSortColumn, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getSortColumn, getStartRow, isAscending, setAscending, setSortColumn
getCurrentPageNumber, getDisplayedPages, getEndPage, getPageSize, getStartPage, getTotalPagesNumber, setCurrentPageNumber, setDisplayedPages, setPageSize
public 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 GridDataModel
getTotalRowCount
in class EditableGridDataModel
public void addRow(int beforeRow, Object[] row) throws IllegalArgumentException
It normalizes the model if the row is too long.
addRow
in interface Editable
addRow
in class EditableGridDataModel
beforeRow
- 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 Editable
updateRow
in class EditableGridDataModel
rowNumber
- 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 Editable
removeRow
in class EditableGridDataModel
rowNumber
- is a number of the row in the grid.IllegalArgumentException
- if the row number is in invalid range.public int getEndRow()
getEndRow
in interface GridDataModel
getEndRow
in class SimpleGridDataModel
public Object[] getRowData(int rowNumber)
getRowData
in interface GridDataModel
getRowData
in class EditableGridDataModel
rowNumber
- is a number of row to be returned.public boolean isEmpty()
isEmpty
in interface GridDataModel
isEmpty
in class SimpleGridDataModel
true
if the model is empty.public void removeAll()
removeAll
in interface Editable
removeAll
in class EditableGridDataModel
public void setSortColumn(int sortColumn, Comparator comparator)
setSortColumn
in interface Editable
setSortColumn
in class EditableGridDataModel
sortColumn
- is a sort column.comparator
- is a comparator that is never used.public void setTotalRowCount(int totalRowCount)
setTotalRowCount
in interface LazyLoadable
totalRowCount
- is a total row count value.public void update(int row, int column, Object data)
update
in interface Editable
update
in class EditableGridDataModel
row
- is a row number.column
- is a column number.data
- is a data to be applied.protected String getInternalRowIdentifier(int row)
getInternalRowIdentifier
in class EditableGridDataModel
row
- is a row number.Copyright © 2008–2013. All rights reserved.