|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vaadin.client.data.AbstractRemoteDataSource<elemental.json.JsonObject>
com.vaadin.client.connectors.RpcDataSourceConnector.RpcDataSource
public class RpcDataSourceConnector.RpcDataSource
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.vaadin.client.data.AbstractRemoteDataSource |
|---|
AbstractRemoteDataSource.RequestRowsCallback<T>, AbstractRemoteDataSource.RowHandleImpl |
| Nested classes/interfaces inherited from interface com.vaadin.client.data.DataSource |
|---|
DataSource.RowHandle<T> |
| Constructor Summary | |
|---|---|
protected |
RpcDataSourceConnector.RpcDataSource()
|
| Method Summary | |
|---|---|
void |
ensureAvailability(int firstRowIndex,
int numberOfRows)
Informs the data source that data for the given range is needed. |
DataSource.RowHandle<elemental.json.JsonObject> |
getHandleByKey(java.lang.Object key)
|
java.lang.String |
getRowKey(elemental.json.JsonObject row)
Gets a stable key for the row object. |
protected void |
onDropFromCache(int rowIndex,
elemental.json.JsonObject row)
A hook that can be overridden to do something whenever a row has been dropped from the cache. |
protected void |
requestRows(int firstRowIndex,
int numberOfRows,
AbstractRemoteDataSource.RequestRowsCallback<elemental.json.JsonObject> callback)
Triggers fetching rows from the remote data source. |
protected void |
setRowData(int firstRowIndex,
java.util.List<elemental.json.JsonObject> rowData)
Informs this data source that updated data has been sent from the server. |
protected void |
unpinHandle(AbstractRemoteDataSource.RowHandleImpl handle)
Unpins a previously pinned row with given handle. |
protected void |
updateRowData(elemental.json.JsonObject row)
Updates row data based on row key. |
| Methods inherited from class com.vaadin.client.data.AbstractRemoteDataSource |
|---|
getCachedRange, getHandle, getRequestedAvailability, getRow, indexOf, indexOfKey, insertRowData, isPinned, isWaitingForData, onDropFromCache, pinHandle, removeRowData, resetDataAndSize, setCacheStrategy, setDataChangeHandler, size |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected RpcDataSourceConnector.RpcDataSource()
| Method Detail |
|---|
protected void requestRows(int firstRowIndex,
int numberOfRows,
AbstractRemoteDataSource.RequestRowsCallback<elemental.json.JsonObject> callback)
AbstractRemoteDataSource
requestRows in class AbstractRemoteDataSource<elemental.json.JsonObject>firstRowIndex - the index of the first row to fetchnumberOfRows - the number of rows to fetchcallback - callback to inform when the requested rows are available
public void ensureAvailability(int firstRowIndex,
int numberOfRows)
DataSource
This method triggers lazy loading of data if necessary. The change
handler registered using DataSource.setDataChangeHandler(DataChangeHandler)
is informed when new data has been loaded.
After any possible lazy loading and updates are done, the change handler is informed that new data is available.
ensureAvailability in interface DataSource<elemental.json.JsonObject>ensureAvailability in class AbstractRemoteDataSource<elemental.json.JsonObject>firstRowIndex - the index of the first needed rownumberOfRows - the number of needed rowspublic java.lang.String getRowKey(elemental.json.JsonObject row)
AbstractRemoteDataSource
This method is a workaround for the fact that there is no means to force
proper implementations for Object.hashCode() and
Object.equals(Object) methods.
Since the same row object will be created several times for the same logical data, the DataSource needs a mechanism to be able to compare two objects, and figure out whether or not they represent the same data. Even if all the fields of an entity would be changed, it still could represent the very same thing (say, a person changes all of her names.)
A very usual and simple example what this could be, is an unique ID for this object that would also be stored in a database.
getRowKey in class AbstractRemoteDataSource<elemental.json.JsonObject>row - the row object for which to get the key
public DataSource.RowHandle<elemental.json.JsonObject> getHandleByKey(java.lang.Object key)
protected void unpinHandle(AbstractRemoteDataSource.RowHandleImpl handle)
AbstractRemoteDataSource
unpinHandle in class AbstractRemoteDataSource<elemental.json.JsonObject>handle - row handle to unpin
protected void setRowData(int firstRowIndex,
java.util.List<elemental.json.JsonObject> rowData)
AbstractRemoteDataSource
setRowData in class AbstractRemoteDataSource<elemental.json.JsonObject>firstRowIndex - the index of the first received rowrowData - a list of rows, starting from firstRowIndexprotected void updateRowData(elemental.json.JsonObject row)
row - new row object
protected void onDropFromCache(int rowIndex,
elemental.json.JsonObject row)
AbstractRemoteDataSource
onDropFromCache in class AbstractRemoteDataSource<elemental.json.JsonObject>rowIndex - the index of the dropped rowrow - the removed row object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||