public abstract class AbstractDataProvider<T> extends Object implements DataProvider<T>
| Modifier and Type | Field and Description |
|---|---|
protected int |
currentRecord |
protected Array<DataProviderRecord<T>> |
data |
protected Array<DataChangedHandler> |
dataChangedHandlers |
protected Array<DataLoadedHandler> |
dataLoadedHandlers |
protected Array<DataLoadStoppedHandler> |
dataStopLoadHandlers |
protected boolean |
loaded |
protected Array<TransactionEndHandler> |
transactionEndHandlers |
protected Array<TransactionStartHandler> |
transactionStartHandlers |
| Constructor and Description |
|---|
AbstractDataProvider() |
| 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 |
addLoadStoppedHandler(DataLoadStoppedHandler handler)
Add a callback to be notified about DataProvider loading stop events
|
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(DataChangedEvent event) |
protected void |
fireLoadedEvent() |
protected void |
fireStopLoadEvent() |
protected void |
fireTransactionEndEvent(boolean commited) |
protected void |
fireTransactionStartEvent(int firstRecordToLock) |
T |
get()
Return the current record object.
|
T |
get(int index)
Return 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 |
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 Array<DataLoadedHandler> dataLoadedHandlers
protected Array<DataLoadStoppedHandler> dataStopLoadHandlers
protected Array<DataChangedHandler> dataChangedHandlers
protected Array<TransactionEndHandler> transactionEndHandlers
protected Array<TransactionStartHandler> transactionStartHandlers
protected Array<DataProviderRecord<T>> data
protected int currentRecord
protected boolean loaded
public void next()
DataProvidernext in interface DataProvider<T>public void previous()
DataProviderprevious in interface DataProvider<T>public 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 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 addLoadStoppedHandler(DataLoadStoppedHandler handler)
DataProvideraddLoadStoppedHandler in interface DataProvider<T>handler - to be called when DataProvider loading is abortedpublic com.google.gwt.event.shared.HandlerRegistration addDataChangedHandler(DataChangedHandler handler)
DataProvideraddDataChangedHandler in interface DataProvider<T>handler - to be called when data provider is changedpublic T get()
DataProviderget in interface DataProvider<T>public T get(int index)
DataProviderget in interface DataProvider<T>index - the object positionpublic void reset()
DataProviderreset in interface DataProvider<T>public void stopLoading()
DataProviderstopLoading in interface DataProvider<T>protected void setLoaded()
public boolean isLoaded()
DataProviderisLoaded in interface DataProvider<T>protected void concludeEdition(boolean commited)
protected void fireTransactionEndEvent(boolean commited)
protected void fireTransactionStartEvent(int firstRecordToLock)
protected void fireLoadedEvent()
protected void fireStopLoadEvent()
protected void fireDataChangedEvent(DataChangedEvent event)
protected abstract void updateState(DataProviderRecord<T> record, org.cruxframework.crux.core.client.dataprovider.DataProviderRecord.DataProviderRecordState previousState)
Copyright © 2015. All rights reserved.