public abstract class

AbstractPager

extends Composite
java.lang.Object
   ↳ com.google.gwt.user.client.ui.UIObject
     ↳ com.google.gwt.user.client.ui.Widget
       ↳ com.google.gwt.user.client.ui.Composite
         ↳ com.google.gwt.user.cellview.client.AbstractPager
Known Direct Subclasses

Class Overview

An abstract pager that exposes many methods useful for paging.

Summary

[Expand]
Inherited Constants
From class com.google.gwt.user.client.ui.UIObject
Public Constructors
AbstractPager()
Public Methods
HasRows getDisplay()
Get the HasRows being paged.
int getPageSize()
Get the page size.
int getPageStart()
Get the page start index.
boolean isRangeLimited()
Check if the page should be limited to the actual data size.
void setDisplay(HasRows display)
Set the HasRows to be paged.
void setRangeLimited(boolean isRangeLimited)
Set whether or not the page range should be limited to the actual data size.
Protected Methods
void firstPage()
Go to the first page.
int getPage()

Get the current page index.

int getPageCount()
Get the number of pages based on the data size.
boolean hasNextPage()
Returns true if there is enough data such that a call to nextPage() will succeed in moving the starting point of the table forward.
boolean hasNextPages(int pages)
Returns true if there is enough data to display a given number of additional pages.
boolean hasPage(int index)
Returns true if there is enough data such that the specified page is within range.
boolean hasPreviousPage()
Returns true if there is enough data such that a call to previousPage() will succeed in moving the starting point of the table backward.
boolean hasPreviousPages(int pages)
Returns true if there is enough data to display a given number of previous pages.
void lastPage()
Go to the last page.
void lastPageStart()
Set the page start to the last index that will still show a full page.
void nextPage()
Advance the starting row by 'pageSize' rows.
abstract void onRangeOrRowCountChanged()
Called when the range or row count changes.
void previousPage()
Move the starting row back by 'pageSize' rows.
void setPage(int index)
Go to a specific page.
void setPageSize(int pageSize)
Set the page size of the display.
void setPageStart(int index)
Set the page start index.
[Expand]
Inherited Methods
From class com.google.gwt.user.client.ui.Composite
From class com.google.gwt.user.client.ui.Widget
From class com.google.gwt.user.client.ui.UIObject
From class java.lang.Object
From interface com.google.gwt.event.logical.shared.HasAttachHandlers
From interface com.google.gwt.event.shared.HasHandlers
From interface com.google.gwt.user.client.EventListener
From interface com.google.gwt.user.client.ui.IsWidget

Public Constructors

public AbstractPager ()

Public Methods

public HasRows getDisplay ()

Get the HasRows being paged.

Returns

public int getPageSize ()

Get the page size.

Returns
  • the page size, or -1 if the display is not set
See Also

public int getPageStart ()

Get the page start index.

Returns
  • the page start index, or -1 if the display is not set

public boolean isRangeLimited ()

Check if the page should be limited to the actual data size. Defaults to true.

Returns
  • true if the range is limited to the data size

public void setDisplay (HasRows display)

Set the HasRows to be paged.

Parameters
display the HasRows
See Also

public void setRangeLimited (boolean isRangeLimited)

Set whether or not the page range should be limited to the actual data size. If true, all operations will adjust so that there is always data visible on the page.

Parameters
isRangeLimited true to limit the range, false not to
See Also

Protected Methods

protected void firstPage ()

Go to the first page.

protected int getPage ()

Get the current page index.

Since the page start index can be set to any value, its possible to be between pages. In this case, the return value is the number of times previousPage() can be called.

Returns
  • the page index, or -1 if the display is not set
See Also

protected int getPageCount ()

Get the number of pages based on the data size.

Returns
  • the page count, or -1 if the display is not set

protected boolean hasNextPage ()

Returns true if there is enough data such that a call to nextPage() will succeed in moving the starting point of the table forward.

Returns
  • true if there is a next page

protected boolean hasNextPages (int pages)

Returns true if there is enough data to display a given number of additional pages.

Parameters
pages the number of pages to query
Returns
  • true if there are pages next pages

protected boolean hasPage (int index)

Returns true if there is enough data such that the specified page is within range.

Parameters
index the page index
Returns
  • true if the specified page is in range

protected boolean hasPreviousPage ()

Returns true if there is enough data such that a call to previousPage() will succeed in moving the starting point of the table backward.

Returns
  • true if there is a previous page

protected boolean hasPreviousPages (int pages)

Returns true if there is enough data to display a given number of previous pages.

Parameters
pages the number of previous pages to query
Returns
  • true if there are pages previous pages

protected void lastPage ()

Go to the last page.

protected void lastPageStart ()

Set the page start to the last index that will still show a full page.

protected void nextPage ()

Advance the starting row by 'pageSize' rows.

protected abstract void onRangeOrRowCountChanged ()

Called when the range or row count changes. Implement this method to update the pager.

protected void previousPage ()

Move the starting row back by 'pageSize' rows.

protected void setPage (int index)

Go to a specific page.

Parameters
index the page index
See Also

protected void setPageSize (int pageSize)

Set the page size of the display.

Parameters
pageSize the new page size
See Also

protected void setPageStart (int index)

Set the page start index.

Parameters
index the index
See Also