C
- the type of data for the input objectD
- the type of data to be returned by the loaderpublic class ListLoader<C extends ListLoadConfig,D extends ListLoadResult<?>> extends Loader<C,D>
Loader.WrapperProxy<M,C,T>
Modifier and Type | Field and Description |
---|---|
protected boolean |
remoteSort |
protected List<SortInfo> |
sortInfo |
eventBus, lastLoadConfig, proxy, reuseLoadConfig
Constructor and Description |
---|
ListLoader(DataProxy<C,D> proxy)
Creates a new loader instance with the given proxy.
|
ListLoader(DataProxy<C,T> proxy,
DataReader<D,T> reader)
Creates a new loader instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addSortInfo(int index,
SortInfo sortInfo)
Adds a new SortInfo object to the next ListLoadConfig in the indicated
position in the list.
|
void |
addSortInfo(SortInfo sortInfo)
Adds a new SortInfo object to the next ListLoadConfig to the end of the
list.
|
void |
clearSortInfo()
Clears all of the currently set sort info objects
|
List<? extends SortInfo> |
getSortInfo()
Gets the current set of SortInfo objects to be sent to the server.
|
boolean |
isRemoteSort()
Returns true if remote sorting is enabled.
|
protected C |
newLoadConfig()
Template method to allow custom BaseLoader subclasses to provide their own
implementation of LoadConfig
|
protected C |
prepareLoadConfig(C config)
Template method to allow custom subclasses to prepare the load config prior
to loading data
|
void |
removeSortInfo(SortInfo lastSort)
Removes the indicated SortInfo object from the list to send to the server,
if it was present in the list.
|
void |
setRemoteSort(boolean remoteSort)
Sets the remote sort state (defaults to false).
|
void |
useLoadConfig(C loadConfig)
Use the specified LoadConfig for all load calls,
Loader.setReuseLoadConfig(boolean) will be set to true. |
addBeforeLoadHandler, addHandler, addLoaderHandler, addLoadExceptionHandler, addLoadHandler, fireEvent, getLastLoadConfig, getProxy, isReuseLoadConfig, load, load, loadData, loadData, onLoadFailure, onLoadSuccess, setLastLoadConfig, setReuseLoadConfig
public ListLoader(DataProxy<C,D> proxy)
proxy
- the data proxypublic ListLoader(DataProxy<C,T> proxy, DataReader<D,T> reader)
T
- the type of data being proxiedproxy
- the data proxyreader
- the data readerpublic void addSortInfo(int index, SortInfo sortInfo)
index
- the position of the sort info in the list of sort infosortInfo
- the sort info to addpublic void addSortInfo(SortInfo sortInfo)
sortInfo
- the sort info to addpublic void clearSortInfo()
public List<? extends SortInfo> getSortInfo()
public boolean isRemoteSort()
public void removeSortInfo(SortInfo lastSort)
lastSort
- the sort info to removepublic void setRemoteSort(boolean remoteSort)
remoteSort
- true for remote sort, false for local sortingpublic void useLoadConfig(C loadConfig)
Loader.setReuseLoadConfig(boolean)
will be set to true.loadConfig
- the load configprotected C newLoadConfig()
newLoadConfig
in class Loader<C extends ListLoadConfig,D extends ListLoadResult<?>>
protected C prepareLoadConfig(C config)
prepareLoadConfig
in class Loader<C extends ListLoadConfig,D extends ListLoadResult<?>>
Copyright © 2020. All rights reserved.