T
- the data type of records in the listpublic abstract class AbstractDataProvider<T> extends Object implements ProvidesKey<T>
HasData
implementations.Modifier | Constructor and Description |
---|---|
protected |
AbstractDataProvider()
Construct an AbstractDataProvider without a key provider.
|
protected |
AbstractDataProvider(ProvidesKey<T> keyProvider)
Construct an AbstractDataProvider with a given key provider.
|
Modifier and Type | Method and Description |
---|---|
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.
|
protected abstract void |
onRangeChanged(HasData<T> display)
Called when a display changes its range of interest.
|
void |
removeDataDisplay(HasData<T> display)
Remove the given data display.
|
protected void |
updateRowCount(int count,
boolean exact)
Inform the displays of the total number of items that are available.
|
protected void |
updateRowData(HasData<T> display,
int start,
List<T> values)
Informs a single display of new data.
|
protected void |
updateRowData(int start,
List<T> values)
Inform the displays of the new data.
|
protected AbstractDataProvider()
protected AbstractDataProvider(ProvidesKey<T> keyProvider)
keyProvider
- a ProvidesKey
objectpublic void addDataDisplay(HasData<T> display)
display
- a HasData
.public Set<HasData<T>> getDataDisplays()
HasData
public Object getKey(T item)
getKey
in interface ProvidesKey<T>
item
- the list itempublic ProvidesKey<T> getKeyProvider()
ProvidesKey
that provides keys for list items.ProvidesKey
public Range[] getRanges()
public void removeDataDisplay(HasData<T> display)
display
- a HasData
instanceIllegalStateException
- if the display is not presentprotected abstract void onRangeChanged(HasData<T> display)
display
- the display whose range has changedprotected void updateRowCount(int count, boolean exact)
count
- the new total row countexact
- true if the count is exact, false if it is an estimateprotected void updateRowData(int start, List<T> values)
start
- the start indexvalues
- the data valuesCopyright © 2018. All rights reserved.