M
- the model data typepublic class TreeLoader<M> extends Loader<M,List<M>>
Loader.WrapperProxy<M,C,T>
Modifier and Type | Field and Description |
---|---|
protected Set<M> |
children |
eventBus, lastLoadConfig, proxy, reuseLoadConfig
Constructor and Description |
---|
TreeLoader(DataProxy<M,List<M>> proxy)
Creates a new tree loader instance.
|
TreeLoader(DataProxy<M,T> proxy,
DataReader<List<M>,T> reader)
Creates a new tree loader instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasChildren(M parent)
Returns true if the model has children.
|
boolean |
loadChildren(M parent)
Initiates a load request for the parent's children.
|
protected void |
onLoadFailure(M loadConfig,
Throwable t)
Called when a load operation fails.
|
protected void |
onLoadSuccess(M loadConfig,
List<M> result)
Called when the remote data has been received.
|
addBeforeLoadHandler, addHandler, addLoaderHandler, addLoadExceptionHandler, addLoadHandler, fireEvent, getLastLoadConfig, getProxy, isReuseLoadConfig, load, load, loadData, loadData, newLoadConfig, prepareLoadConfig, setLastLoadConfig, setReuseLoadConfig
public TreeLoader(DataProxy<M,List<M>> proxy)
proxy
- the data readerpublic TreeLoader(DataProxy<M,T> proxy, DataReader<List<M>,T> reader)
T
- the type of data being proxiedproxy
- the data proxyreader
- the data readerpublic boolean hasChildren(M parent)
parent
- the parent modelpublic boolean loadChildren(M parent)
parent
- the parentprotected void onLoadFailure(M loadConfig, Throwable t)
Loader
onLoadFailure
in class Loader<M,List<M>>
loadConfig
- the load configt
- the exceptionCopyright © 2020. All rights reserved.