org.displaytag.pagination
Class Pagination

java.lang.Object
  extended by org.displaytag.pagination.Pagination

public class Pagination
extends java.lang.Object

Helper class for generation of paging banners.

Version:
$Revision: 1138 $ ($Author: fgiust $)
Author:
Fabrizio Giustina

Constructor Summary
Pagination(Href baseHref, java.lang.String pageParameter, TableProperties properties)
          Constructor for Pagination.
 
Method Summary
 void addPage(int number, boolean isSelected)
          Adds a page.
 java.lang.Integer getFirst()
          Gets the number of the first page.
 java.lang.String getFormattedBanner(java.lang.String numberedPageFormat, java.lang.String numberedPageSelectedFormat, java.lang.String numberedPageSeparator, java.lang.String fullBanner)
          Returns the appropriate banner for the pagination.
 java.lang.Integer getLast()
          Gets the number of the last page.
 java.lang.Integer getNext()
          Gets the number of the next page.
 java.lang.Integer getPrevious()
          Gets the number of the previous page.
 boolean isFirst()
          first page selected?
 boolean isLast()
          last page selected?
 boolean isOnePage()
          only one page?
 void setCurrent(java.lang.Integer current)
          Sets the number of the current page.
 void setFirst(java.lang.Integer first)
          Sets the number of the first page.
 void setLast(java.lang.Integer last)
          Sets the number of the last page.
 void setNext(java.lang.Integer next)
          Sets the number of the next page.
 void setPrevious(java.lang.Integer previous)
          Sets the number of the previous page.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pagination

public Pagination(Href baseHref,
                  java.lang.String pageParameter,
                  TableProperties properties)
Constructor for Pagination.

Parameters:
baseHref - Href used for links
pageParameter - name for the page parameter
Method Detail

addPage

public void addPage(int number,
                    boolean isSelected)
Adds a page.

Parameters:
number - int page number
isSelected - is the page selected?

isFirst

public boolean isFirst()
first page selected?

Returns:
boolean

isLast

public boolean isLast()
last page selected?

Returns:
boolean

isOnePage

public boolean isOnePage()
only one page?

Returns:
boolean

getFirst

public java.lang.Integer getFirst()
Gets the number of the first page.

Returns:
Integer number of the first page

setFirst

public void setFirst(java.lang.Integer first)
Sets the number of the first page.

Parameters:
first - Integer number of the first page

getLast

public java.lang.Integer getLast()
Gets the number of the last page.

Returns:
Integer number of the last page

setLast

public void setLast(java.lang.Integer last)
Sets the number of the last page.

Parameters:
last - Integer number of the last page

getPrevious

public java.lang.Integer getPrevious()
Gets the number of the previous page.

Returns:
Integer number of the previous page

setPrevious

public void setPrevious(java.lang.Integer previous)
Sets the number of the previous page.

Parameters:
previous - Integer number of the previous page

getNext

public java.lang.Integer getNext()
Gets the number of the next page.

Returns:
Integer number of the next page

setNext

public void setNext(java.lang.Integer next)
Sets the number of the next page.

Parameters:
next - Integer number of the next page

setCurrent

public void setCurrent(java.lang.Integer current)
Sets the number of the current page.

Parameters:
current - number of the current page

getFormattedBanner

public java.lang.String getFormattedBanner(java.lang.String numberedPageFormat,
                                           java.lang.String numberedPageSelectedFormat,
                                           java.lang.String numberedPageSeparator,
                                           java.lang.String fullBanner)
Returns the appropriate banner for the pagination.

Parameters:
numberedPageFormat - String to be used for a not selected page
numberedPageSelectedFormat - String to be used for a selected page
numberedPageSeparator - separator beetween pages
fullBanner - String basic banner
Returns:
String formatted banner whith pages

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright © 2002-2010 the Displaytag team. All Rights Reserved.