public abstract class AbstractDataProvider<T> extends Object implements DataProvider<T>
DataProvider.DataHandler<T>, DataProvider.DataReader<T>| Modifier and Type | Field and Description |
|---|---|
protected int |
currentRecord |
protected Array<DataProviderRecord<T>> |
data |
protected Array<DataChangedHandler> |
dataChangedHandlers |
protected DataProvider.DataHandler<T> |
dataHandler |
protected Array<DataLoadedHandler> |
dataLoadedHandlers |
protected Array<DataSortedHandler> |
dataSortedHandlers |
protected Array<DataLoadStoppedHandler> |
dataStopLoadHandlers |
protected boolean |
loaded |
protected Array<ResetHandler> |
resetHandlers |
protected Array<TransactionEndHandler> |
transactionEndHandlers |
protected Array<TransactionStartHandler> |
transactionStartHandlers |
| Constructor and Description |
|---|
AbstractDataProvider(DataProvider.DataHandler<T> handler) |
| Modifier and Type | Method and Description |
|---|---|
com.google.gwt.event.shared.HandlerRegistration |
addDataChangedHandler(DataChangedHandler handler)
Add a callback to be notified about any changes on data provider
|
com.google.gwt.event.shared.HandlerRegistration |
addDataLoadedHandler(DataLoadedHandler handler)
Add a callback to be notified about DataProvider load events
|
com.google.gwt.event.shared.HandlerRegistration |
addDataSortedHandler(DataSortedHandler handler)
Add a callback to be notified about DataProvider sort events
|
com.google.gwt.event.shared.HandlerRegistration |
addLoadStoppedHandler(DataLoadStoppedHandler handler)
Add a callback to be notified about DataProvider loading stop events
|
com.google.gwt.event.shared.HandlerRegistration |
addResetHandler(ResetHandler handler)
Add a callback to be notified about resets on data provider
|
com.google.gwt.event.shared.HandlerRegistration |
addTransactionEndHandler(TransactionEndHandler handler)
Add a callback to be notified about any transaction executions on data provider
|
com.google.gwt.event.shared.HandlerRegistration |
addTransactionStartHandler(TransactionStartHandler handler)
Add a callback to be notified about any transaction start on data provider
|
protected void |
concludeEdition(boolean commited) |
protected void |
fireDataChangedEvent(DataProviderRecord<?> currentRecord,
int recordPosition) |
protected void |
fireLoadedEvent() |
protected void |
fireResetEvent() |
protected void |
fireSortedEvent(boolean pageChanged) |
protected void |
fireStopLoadEvent() |
protected void |
fireTransactionEndEvent(boolean commited) |
protected void |
fireTransactionStartEvent(int firstRecordToLock) |
T |
get()
Retrieve a cloned version of the current record object.
|
T |
get(int index)
Retrieve a cloned version of the object referred by the given index
|
boolean |
isLoaded()
Check if the DataProvider is loaded
|
void |
next()
Points DataProvider to next record
|
void |
previous()
Points DataProvider to previous record
|
void |
read(DataProvider.DataReader<T> reader)
Read the current record object.
|
void |
read(int index,
DataProvider.DataReader<T> reader)
Read the object referred by the given index
|
void |
reset()
Reset DataProvider, as if it was never loaded before.
|
protected void |
setLoaded() |
void |
stopLoading()
Cancel the loading process, that is asynchronous.
|
protected abstract void |
updateState(DataProviderRecord<T> record,
org.cruxframework.crux.core.client.dataprovider.DataProviderRecord.DataProviderRecordState previousState) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadd, add, commit, filter, first, getNewRecords, getRecord, getRemovedRecords, getSelectedRecords, getUpdatedRecords, hasNext, hasPrevious, indexOf, isDirty, load, remove, rollback, select, select, set, setData, setData, setData, setReadOnly, setReadOnly, sortprotected int currentRecord
protected Array<DataProviderRecord<T>> data
protected Array<DataChangedHandler> dataChangedHandlers
protected Array<ResetHandler> resetHandlers
protected DataProvider.DataHandler<T> dataHandler
protected Array<DataLoadedHandler> dataLoadedHandlers
protected Array<DataSortedHandler> dataSortedHandlers
protected Array<DataLoadStoppedHandler> dataStopLoadHandlers
protected boolean loaded
protected Array<TransactionEndHandler> transactionEndHandlers
protected Array<TransactionStartHandler> transactionStartHandlers
public AbstractDataProvider(DataProvider.DataHandler<T> handler)
public com.google.gwt.event.shared.HandlerRegistration addDataChangedHandler(DataChangedHandler handler)
DataProvideraddDataChangedHandler in interface DataProvider<T>handler - to be called when data provider is changedpublic com.google.gwt.event.shared.HandlerRegistration addResetHandler(ResetHandler handler)
DataProvideraddResetHandler in interface DataProvider<T>handler - to be called when data provider is resetpublic com.google.gwt.event.shared.HandlerRegistration addDataLoadedHandler(DataLoadedHandler handler)
DataProvideraddDataLoadedHandler in interface DataProvider<T>handler - to be called when DataProvider is loadedpublic com.google.gwt.event.shared.HandlerRegistration addDataSortedHandler(DataSortedHandler handler)
DataProvideraddDataSortedHandler in interface DataProvider<T>handler - to be called when DataProvider is sortedpublic com.google.gwt.event.shared.HandlerRegistration addLoadStoppedHandler(DataLoadStoppedHandler handler)
DataProvideraddLoadStoppedHandler in interface DataProvider<T>handler - to be called when DataProvider loading is abortedpublic com.google.gwt.event.shared.HandlerRegistration addTransactionEndHandler(TransactionEndHandler handler)
DataProvideraddTransactionEndHandler in interface DataProvider<T>public com.google.gwt.event.shared.HandlerRegistration addTransactionStartHandler(TransactionStartHandler handler)
DataProvideraddTransactionStartHandler in interface DataProvider<T>public T get()
DataProviderget in interface DataProvider<T>public T get(int index)
DataProviderget in interface DataProvider<T>index - the object positionpublic boolean isLoaded()
DataProviderisLoaded in interface DataProvider<T>public void next()
DataProvidernext in interface DataProvider<T>public void previous()
DataProviderprevious in interface DataProvider<T>public void read(DataProvider.DataReader<T> reader)
DataProviderread in interface DataProvider<T>reader - the reader used to consume the object retrieved.public void read(int index,
DataProvider.DataReader<T> reader)
DataProviderread in interface DataProvider<T>index - the object positionreader - the reader used to consume the object retrieved.public void reset()
DataProviderreset in interface DataProvider<T>public void stopLoading()
DataProviderstopLoading in interface DataProvider<T>protected void concludeEdition(boolean commited)
protected void fireDataChangedEvent(DataProviderRecord<?> currentRecord, int recordPosition)
protected void fireResetEvent()
protected void fireLoadedEvent()
protected void fireSortedEvent(boolean pageChanged)
protected void fireStopLoadEvent()
protected void fireTransactionEndEvent(boolean commited)
protected void fireTransactionStartEvent(int firstRecordToLock)
protected void setLoaded()
protected abstract void updateState(DataProviderRecord<T> record, org.cruxframework.crux.core.client.dataprovider.DataProviderRecord.DataProviderRecordState previousState)
Copyright © 2015. All rights reserved.