com.extjs.gxt.ui.client.data
Class BaseLoader<C,D>

java.lang.Object
  extended by com.extjs.gxt.ui.client.event.BaseObservable
      extended by com.extjs.gxt.ui.client.data.BaseLoader<C,D>
Type Parameters:
C - the config type
D - the data type
All Implemented Interfaces:
Loader<C>, Observable
Direct Known Subclasses:
BaseListLoader, BaseTreeLoader

public class BaseLoader<C,D>
extends BaseObservable
implements Loader<C>

Abstract base loader implementation.


Field Summary
 
Fields inherited from interface com.extjs.gxt.ui.client.data.Loader
BeforeLoad, Load, LoadException
 
Constructor Summary
BaseLoader(DataProxy<C,D> proxy)
          Creates a new base loader instance.
BaseLoader(DataProxy<C,D> proxy, DataReader<C,D> reader)
          Creates a new loader with the given proxy and reader.
BaseLoader(DataReader<C,D> reader)
          Creates a new base loader instance.
 
Method Summary
 void addLoadListener(LoadListener listener)
          Adds a load listener.
 DataProxy<C,D> 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 removeLoadListener(LoadListener listener)
          Removes a load listener.
 void setReuseLoadConfig(boolean reuseLoadConfig)
          Sets whether the same load config instance should be used for load operations.
 
Methods inherited from class com.extjs.gxt.ui.client.event.BaseObservable
addListener, fireEvent, fireEvent, getFiresEvents, hasListeners, hasListeners, removeAllListeners, removeListener, setFiresEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.extjs.gxt.ui.client.event.Observable
addListener, fireEvent, removeAllListeners, removeListener
 

Constructor Detail

BaseLoader

public BaseLoader(DataProxy<C,D> proxy)
Creates a new base loader instance.

Parameters:
proxy - the data proxy

BaseLoader

public BaseLoader(DataProxy<C,D> proxy,
                  DataReader<C,D> reader)
Creates a new loader with the given proxy and reader.

Parameters:
proxy - the data proxy
reader - an optional data reader, if null, null will be passed to proxy.load(Reader, Loadconfig, Datacallback)

BaseLoader

public BaseLoader(DataReader<C,D> reader)
Creates a new base loader instance.

Parameters:
reader - the reader
Method Detail

addLoadListener

public void addLoadListener(LoadListener listener)
Description copied from interface: Loader
Adds a load listener.

Specified by:
addLoadListener in interface Loader<C>
Parameters:
listener - the listener to add

getProxy

public DataProxy<C,D> getProxy()
Returns the loader's data proxy.

Returns:
the data proxy

isReuseLoadConfig

public boolean isReuseLoadConfig()
Returns true if the load config is being reused.

Returns:
the reuse load config state

load

public boolean load()
Description copied from interface: Loader
Loads the data using the current configuration.

Specified by:
load in interface Loader<C>
Returns:
true if the load was requested

load

public boolean load(C loadConfig)
Description copied from interface: Loader
Loads the data using the given load configuration.

Specified by:
load in interface Loader<C>
Parameters:
loadConfig - the load config
Returns:
true if the load was requested

removeLoadListener

public void removeLoadListener(LoadListener listener)
Description copied from interface: Loader
Removes a load listener.

Specified by:
removeLoadListener in interface Loader<C>
Parameters:
listener - the listener to remove

setReuseLoadConfig

public void setReuseLoadConfig(boolean reuseLoadConfig)
Sets whether the same load config instance should be used for load operations.

Parameters:
reuseLoadConfig - true to reuse