com.atlassian.jira.web.bean
Class PagerFilter

java.lang.Object
  extended by com.atlassian.jira.web.bean.PagerFilter
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
GroupBrowserFilter, UserBrowserFilter, UserPickerFilter

public class PagerFilter
extends Object
implements Serializable

This is a super class that implements paging for browsers.

Most other filters (which want paging ability) will extend this.

See Also:
Serialized Form

Field Summary
protected  Collection pages
          A collection of Page objects
 
Constructor Summary
PagerFilter()
           
PagerFilter(int max)
           
 
Method Summary
 List generatePages(Collection items)
          generates a collection of page objects which keep track of the pages for display
 List getCurrentPage(List itemsCol)
          Gets the current page out of a list of objects.
 int getEnd()
           
 int getMax()
           
 int getNextStart()
           
 List getPages(Collection itemsCol)
           
 int getPreviousStart()
           
 int getStart()
           
static PagerFilter getUnlimitedFilter()
          A pager that will return unlimited number of objects.
 List restrictPages(Collection pages, int size)
          Restrict the pagers to a certain number of pages on either side of the current page.
 void setMax(int max)
           
 void setStart(int start)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pages

protected Collection pages
A collection of Page objects

Constructor Detail

PagerFilter

public PagerFilter()

PagerFilter

public PagerFilter(int max)
Method Detail

getUnlimitedFilter

public static PagerFilter getUnlimitedFilter()
A pager that will return unlimited number of objects.

Returns:
A PagerFilter with a max set to Integer.MAX_VALUE

getCurrentPage

public List getCurrentPage(List itemsCol)
Gets the current page out of a list of objects.

Returns:
the sublist that is the current page.

getPages

public List getPages(Collection itemsCol)

generatePages

public List generatePages(Collection items)
generates a collection of page objects which keep track of the pages for display

Parameters:
items -

restrictPages

public List restrictPages(Collection pages,
                          int size)
Restrict the pagers to a certain number of pages on either side of the current page.

The number of pages to list is stored in PAGES_TO_LIST.


getMax

public int getMax()

setMax

public void setMax(int max)

getStart

public int getStart()

setStart

public void setStart(int start)

getEnd

public int getEnd()

getNextStart

public int getNextStart()

getPreviousStart

public int getPreviousStart()


Copyright © 2002-2009 Atlassian. All Rights Reserved.