|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sencha.gxt.data.shared.loader.Loader<C,M>
C
- the type of the data used to configureM
- the type of data being returned by the loaderpublic class Loader<C,M>
Abstract base class for objects that can load remote data.
The optional input object passed with the load request is logically called a "load config" with the object returned by the loader called the "load result". Typically, loaders work withDataProxy
and DataReader
to help
perform the load operations. The DataProxy
is responsible for
obtaining the remote data. The DataReader
is responsible for
"processing" the remote data and converting the data to the expected format.
BeforeLoadEvent
LoadEvent
LoadExceptionEvent
Constructor Summary | |
---|---|
Loader(DataProxy<C,M> proxy)
Creates a new base loader instance. |
|
Loader(DataProxy<C,T> proxy,
DataReader<M,T> reader)
Creates a new loader with the given proxy and reader. |
Method Summary | |
---|---|
HandlerRegistration |
addBeforeLoadHandler(BeforeLoadEvent.BeforeLoadHandler<C> handler)
Adds a BeforeLoadEvent handler. |
HandlerRegistration |
addLoaderHandler(LoaderHandler<C,M> handler)
Adds a LoadEvent handler. |
HandlerRegistration |
addLoadExceptionHandler(LoadExceptionEvent.LoadExceptionHandler<C> handler)
Adds a LoadExceptionEvent handler. |
HandlerRegistration |
addLoadHandler(LoadHandler<C,M> handler)
Adds a LoadEvent handler. |
C |
getLastLoadConfig()
Returns the last load config. |
DataProxy<?,?> |
getProxy()
Returns the loader's data proxy. |
boolean |
isReuseLoadConfig()
Returns true if the load config is being reused. |
boolean |
load()
Loads the data using the current configuration. |
boolean |
load(C loadConfig)
Loads the data using the given load configuration. |
void |
setReuseLoadConfig(boolean reuseLoadConfig)
Sets whether the same load config instance should be used for load operations (defaults to false). |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Loader(DataProxy<C,M> proxy)
proxy
- the data proxypublic Loader(DataProxy<C,T> proxy, DataReader<M,T> reader)
proxy
- the data proxyreader
- the data readerMethod Detail |
---|
public HandlerRegistration addBeforeLoadHandler(BeforeLoadEvent.BeforeLoadHandler<C> handler)
BeforeLoadEvent.HasBeforeLoadHandlers
BeforeLoadEvent
handler.
addBeforeLoadHandler
in interface BeforeLoadEvent.HasBeforeLoadHandlers<C>
handler
- the handler
public HandlerRegistration addLoaderHandler(LoaderHandler<C,M> handler)
LoaderHandler.HasLoaderHandlers
LoadEvent
handler.
addLoaderHandler
in interface LoaderHandler.HasLoaderHandlers<C,M>
handler
- the handler
public HandlerRegistration addLoadExceptionHandler(LoadExceptionEvent.LoadExceptionHandler<C> handler)
LoadExceptionEvent.HasLoadExceptionHandlers
LoadExceptionEvent
handler.
addLoadExceptionHandler
in interface LoadExceptionEvent.HasLoadExceptionHandlers<C>
handler
- the handler
public HandlerRegistration addLoadHandler(LoadHandler<C,M> handler)
LoadHandler.HasLoadHandlers
LoadEvent
handler.
addLoadHandler
in interface LoadHandler.HasLoadHandlers<C,M>
handler
- the handler
public C getLastLoadConfig()
public DataProxy<?,?> getProxy()
public boolean isReuseLoadConfig()
public boolean load()
BeforeLoadEvent
before the request, then the LoadEvent
after the load operation.
public boolean load(C loadConfig)
BeforeLoadEvent
before the request, then the LoadEvent
after the load operation. The current load configuration object can be
retrieved using getLastLoadConfig()
.
loadConfig
- the load config
public void setReuseLoadConfig(boolean reuseLoadConfig)
reuseLoadConfig
- true to reuse
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |