| Constructor and Description |
|---|
SimpleDataModel(List<T> items)
Construct a new
SimpleDataModel instance with the given items. |
| Modifier and Type | Method and Description |
|---|---|
void |
addItem(int index,
T item)
Adds an item to this model.
|
void |
doFetchRows(int start,
int count,
AsyncCallback<List<T>> callback)
Perform a paged data request for the given number of items at the given offset into the
result set.
|
SimpleDataModel<T> |
filter(Predicate<T> pred)
Returns a data model that contains only items that match the supplied predicate.
|
T |
findItem(Predicate<T> p)
Returns the first item that matches the supplied predicate or null if no items in this model
matches the predicate.
|
int |
getItemCount()
Returns the total number of items in this model.
|
static <T> SimpleDataModel<T> |
newModel(List<T> items)
Creates a new simple data model with the supplied list of items.
|
void |
removeItem(T item)
Called when we wish to remove an item from our locally cached data.
|
void |
updateItem(T item)
Updates the specified item if found in the model, prepends it otherwise.
|
public SimpleDataModel(List<T> items)
SimpleDataModel instance with the given items.public static <T> SimpleDataModel<T> newModel(List<T> items)
public SimpleDataModel<T> filter(Predicate<T> pred)
public void addItem(int index,
T item)
public void updateItem(T item)
public T findItem(Predicate<T> p)
public int getItemCount()
DataModelDataModel.doFetchRows(int, int, com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<T>>) is called back. You may also return -1 to indicate
that this model does not supply a row count, and the pager should continue offering pages
for as long as the underlying service is able to satisfy the requests.getItemCount in interface DataModel<T>public void doFetchRows(int start,
int count,
AsyncCallback<List<T>> callback)
DataModeldoFetchRows in interface DataModel<T>public void removeItem(T item)
DataModelremoveItem in interface DataModel<T>Copyright © 2013. All Rights Reserved.