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

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

public abstract class AbstractListViewAdapter<T>
extends java.lang.Object
implements ProvidesKey<T>

A base implementation of a data source for list views.

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


Constructor Summary
AbstractListViewAdapter()
           
 
Method Summary
 void addView(ListView<T> view)
          Adds a view to this adapter.
 java.lang.Object getKey(T item)
          Get the key for a list item.
 ProvidesKey<T> getKeyProvider()
          Get the ProvidesKey that provides keys for list items.
 Range[] getRanges()
          Get the current ranges of all views.
 java.util.Set<ListView<T>> getViews()
          Get the set of views currently assigned to this adapter.
 void removeView(ListView<T> view)
           
 void setKeyProvider(ProvidesKey<T> keyProvider)
          Set the ProvidesKey that provides keys for list items.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractListViewAdapter

public AbstractListViewAdapter()
Method Detail

addView

public void addView(ListView<T> view)
Adds a view to this adapter. The current range of interest of the view will be populated with data.

Parameters:
view - a .

getKey

public java.lang.Object getKey(T item)
Get the key for a list item. The default implementation returns the item itself.

Specified by:
getKey in interface ProvidesKey<T>
Parameters:
item - the list item
Returns:
the key that represents the item

getKeyProvider

public ProvidesKey<T> getKeyProvider()
Get the ProvidesKey that provides keys for list items.

Returns:
the ProvidesKey

getRanges

public Range[] getRanges()
Get the current ranges of all views.

Returns:
the ranges

getViews

public java.util.Set<ListView<T>> getViews()
Get the set of views currently assigned to this adapter.

Returns:
the set of ListView

removeView

public void removeView(ListView<T> view)

setKeyProvider

public void setKeyProvider(ProvidesKey<T> keyProvider)
Set the ProvidesKey that provides keys for list items.

Parameters:
keyProvider - the ProvidesKey