com.missiondata.oss.lakeshore.widget
Class BatchedList
java.lang.Object
com.missiondata.oss.lakeshore.Controller
com.missiondata.oss.lakeshore.Component
com.missiondata.oss.lakeshore.widget.BatchedList
- public class BatchedList
- extends Component
Handles pagination and navigation (with back button support) of lists of items.
The user of this class must render the current list and the navigation, e.g.,
private BatchedList batcher;
public BigList(List listOfItems)
{
batcher = new BatchedList(listOfItems);
}
public void renderOn(Renderer r)
{
for (Iterator iterator = batcher.batch().iterator(); iterator.hasNext();)
{
ListItem listItem = (ListItem)iterator.next();
r.anchor(iterator.next(), new CallBack()
{
public void execute(String s) {//do something interesting}
});
}
r.render(batcher);
}
Methods inherited from class com.missiondata.oss.lakeshore.Controller |
activeController, answer, answer, answerAction, answerAction, call, call, callAction, callAction, callMethod, callMethod, clearDelegate, getParent, getRequestHandler, getSessionAttribute, getUploadedFile, inform, isUserInRole, onAnswer, onAnswer, receiveCall, render, resumeCall, setDelegate, setParent, setRequestHandler, setSessionAttribute, setThreadManager |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_SIZE
public static final int DEFAULT_SIZE
- See Also:
- Constant Field Values
BatchedList
public BatchedList(java.util.List itemList)
BatchedList
public BatchedList(int batchSize,
java.util.List items)
getCurrentPage
public int getCurrentPage()
size
public int size()
startIndex
public int startIndex()
startIndex
public int startIndex(int page)
endIndex
public int endIndex()
endIndex
public int endIndex(int page)
batch
public java.util.List batch()
batch
public java.util.List batch(int page)
maxPages
public int maxPages()
onFirstPage
public boolean onFirstPage()
onLastPage
public boolean onLastPage()
nextPage
public void nextPage()
previousPage
public void previousPage()
renderOn
public void renderOn(Renderer r)
- Specified by:
renderOn
in class Component
setBatchedListPageDecorator
public void setBatchedListPageDecorator(BatchedListPageDecorator batchedListPageDecorator)
sort
public void sort(java.util.Comparator c)
applyFilter
public java.lang.String applyFilter(BatchedListFilter filter)
- Parameters:
filter
-
- Returns:
BatchedListFilter.FILTER_APPLIED
BatchedListFilter.FILTER_REMOVED
BatchedListFilter.FILTER_APPLIED_NO_EFFECT
turnToPageWith
public boolean turnToPageWith(java.lang.Object object)
- Turn to the page with the specific object
- Parameters:
object
-
- Returns:
- true if the object was found, false otherwise