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
subclass which return a list of data. Adds support for
sort field, sort direction, and remote sorting.
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. |
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, addLoaderHandler, addLoadExceptionHandler, addLoadHandler, getLastLoadConfig, getProxy, isReuseLoadConfig, load, load, setReuseLoadConfig
public ListLoader(DataProxy<C,D> proxy)
proxy
- the data proxypublic ListLoader(DataProxy<C,T> proxy, DataReader<D,T> reader)
proxy
- 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()
true
if remote sorting is enabled.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.Copyright © 2015. All rights reserved.