public abstract class

AbstractDataProvider

extends Object
implements ProvidesKey<T>
java.lang.Object
   ↳ com.google.gwt.view.client.AbstractDataProvider<T>
Known Direct Subclasses

Class Overview

A base implementation of a data source for HasData implementations.

Summary

Protected Constructors
AbstractDataProvider()
Construct an AbstractDataProvider without a key provider.
AbstractDataProvider(ProvidesKey<T> keyProvider)
Construct an AbstractDataProvider with a given key provider.
Public Methods
void addDataDisplay(HasData<T> display)
Adds a data display to this adapter.
Set<HasData<T>> getDataDisplays()
Get the set of displays currently assigned to this adapter.
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 displays.
void removeDataDisplay(HasData<T> display)
Remove the given data display.
Protected Methods
abstract void onRangeChanged(HasData<T> display)
Called when a display changes its range of interest.
void updateRowCount(int count, boolean exact)
Inform the displays of the total number of items that are available.
void updateRowData(HasData<T> display, int start, List<T> values)
Informs a single display of new data.
void updateRowData(int start, List<T> values)
Inform the displays of the new data.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.google.gwt.view.client.ProvidesKey

Protected Constructors

protected AbstractDataProvider ()

Construct an AbstractDataProvider without a key provider.

protected AbstractDataProvider (ProvidesKey<T> keyProvider)

Construct an AbstractDataProvider with a given key provider.

Parameters
keyProvider a ProvidesKey object

Public Methods

public void addDataDisplay (HasData<T> display)

Adds a data display to this adapter. The current range of interest of the display will be populated with data.

Parameters
display a HasData.

public Set<HasData<T>> getDataDisplays ()

Get the set of displays currently assigned to this adapter.

Returns

public Object getKey (T item)

Get the key for a list item. The default implementation returns the item itself.

Parameters
item the list item
Returns
  • the key that represents the item

public ProvidesKey<T> getKeyProvider ()

Get the ProvidesKey that provides keys for list items.

Returns

public Range[] getRanges ()

Get the current ranges of all displays.

Returns
  • the ranges

public void removeDataDisplay (HasData<T> display)

Remove the given data display.

Parameters
display a HasData instance
Throws
IllegalStateException if the display is not present

Protected Methods

protected abstract void onRangeChanged (HasData<T> display)

Called when a display changes its range of interest.

Parameters
display the display whose range has changed

protected void updateRowCount (int count, boolean exact)

Inform the displays of the total number of items that are available.

Parameters
count the new total row count
exact true if the count is exact, false if it is an estimate

protected void updateRowData (HasData<T> display, int start, List<T> values)

Informs a single display of new data.

Parameters
display the display to be updated
start the start index
values the data values

protected void updateRowData (int start, List<T> values)

Inform the displays of the new data.

Parameters
start the start index
values the data values