com.google.gwt.view.client
Class ListViewAdapter<T>

java.lang.Object
  extended by com.google.gwt.view.client.AbstractListViewAdapter<T>
      extended by com.google.gwt.view.client.ListViewAdapter<T>
Type Parameters:
T - the data type of the list
All Implemented Interfaces:
ProvidesKey<T>

public class ListViewAdapter<T>
extends AbstractListViewAdapter<T>

A concrete subclass of AbstractListViewAdapter that is backed by an in-memory list.

Note: This class is new and its interface subject to change.


Constructor Summary
ListViewAdapter()
          Creates an empty model.
ListViewAdapter(java.util.List<T> wrappee)
          Creates a list model that wraps the given collection.
 
Method Summary
 void flush()
          Flush pending list changes to the views.
 java.util.List<T> getList()
          Get the list that backs this model.
 void refresh()
          Refresh all of the views listening to this adapter.
 void setList(java.util.List<T> wrappee)
          Replaces this model's list.
 
Methods inherited from class com.google.gwt.view.client.AbstractListViewAdapter
addView, getKey, getKeyProvider, getRanges, getViews, removeView, setKeyProvider
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListViewAdapter

public ListViewAdapter()
Creates an empty model.


ListViewAdapter

public ListViewAdapter(java.util.List<T> wrappee)
Creates a list model that wraps the given collection. Changes to the wrapped list must be made via this model in order to be correctly applied to views.

Method Detail

flush

public void flush()
Flush pending list changes to the views. By default, views are informed of modifications to the underlying list at the end of the current event loop, which makes it possible to perform multiple operations synchronously without repeatedly refreshing the views. This method can be called to flush the changes immediately instead of waiting until the end of the current event loop.


getList

public java.util.List<T> getList()
Get the list that backs this model. Changes to the list will be reflected in the model.

Returns:
the list

refresh

public void refresh()
Refresh all of the views listening to this adapter.


setList

public void setList(java.util.List<T> wrappee)
Replaces this model's list.

Parameters:
wrappee - the model's new list