public abstract class

ListPager

extends Object
java.lang.Object
   ↳ com.atlassian.jira.web.action.util.lists.ListPager<T>

Class Overview

This is a simple pager that can reduce a big list into paged sizes. Its designed for use within webwork actions/jsp in that it is immutable (eg one page per created ListPager) and actions can only really show one page of data per render.

You need to specify the page number you want to go to, the number of rows per page and the full list you want to page.

Summary

Public Constructors
ListPager(List<T> fullList, int pageNo, int rowsPerPage)
Creates a ListPager that pages a list from a certain page number.
Public Methods
String getEndPageURL()
int getFromIndex()
int getFullListSize()
List<T> getList()
String getNextPageURL()
int getPageNumber()
String getPrevPageURL()
int getRowsPerPage()
String getStartPageURL()
int getToIndex()
boolean hasMultiplePages()
Returns true if the pager has multiple pages.
Protected Methods
abstract String generatePageURL(int targetPageNo, int rowsPerPage)
Each implementation of this class is expected to generate their own URLS based on the passed in page number
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ListPager (List<T> fullList, int pageNo, int rowsPerPage)

Creates a ListPager that pages a list from a certain page number. If the page number is greater than makes sense, it is trims it back to the last possible page number.

Parameters
fullList is the full list of object
pageNo is a zero based index
rowsPerPage must be > 0

Public Methods

public String getEndPageURL ()

public int getFromIndex ()

public int getFullListSize ()

public List<T> getList ()

Returns
  • the paged list of object

public String getNextPageURL ()

Returns

public int getPageNumber ()

public String getPrevPageURL ()

Returns

public int getRowsPerPage ()

public String getStartPageURL ()

public int getToIndex ()

public boolean hasMultiplePages ()

Returns true if the pager has multiple pages. If this is false, then all the link generating methods will return null, since there isnt more than one page of data.

Returns
  • returns true if the pager has multiple pages

Protected Methods

protected abstract String generatePageURL (int targetPageNo, int rowsPerPage)

Each implementation of this class is expected to generate their own URLS based on the passed in page number

Parameters
targetPageNo the target page number
rowsPerPage the rows per page
Returns
  • an non null URL