public abstract class AbstractPager extends Composite
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
DEBUG_ID_PREFIX
Constructor and Description |
---|
AbstractPager() |
Modifier and Type | Method and Description |
---|---|
protected void |
firstPage()
Go to the first page.
|
HasRows |
getDisplay()
Get the
HasRows being paged. |
protected int |
getPage()
Get the current page index.
|
protected int |
getPageCount()
Get the number of pages based on the data size.
|
int |
getPageSize()
Get the page size.
|
int |
getPageStart()
Get the page start index.
|
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. |
protected boolean |
hasNextPages(int pages)
Returns true if there is enough data to display a given number of
additional pages.
|
protected boolean |
hasPage(int index)
Returns true if there is enough data such that the specified page is within
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. |
protected boolean |
hasPreviousPages(int pages)
Returns true if there is enough data to display a given number of previous
pages.
|
boolean |
isRangeLimited()
Check if the page should be limited to the actual data size.
|
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.
|
protected void |
previousPage()
Move the starting row back by 'pageSize' rows.
|
void |
setDisplay(HasRows display)
Set the
HasRows to be paged. |
protected void |
setPage(int index)
Go to a specific page.
|
protected void |
setPageSize(int pageSize)
Set the page size of the display.
|
protected void |
setPageStart(int index)
Set the page start index.
|
void |
setRangeLimited(boolean isRangeLimited)
Set whether or not the page range should be limited to the actual data
size.
|
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
public HasRows getDisplay()
HasRows
being paged.HasRows
setDisplay(HasRows)
public int getPageSize()
setPageSize(int)
public int getPageStart()
setPageStart(int)
public boolean isRangeLimited()
setRangeLimited(boolean)
public void setRangeLimited(boolean isRangeLimited)
isRangeLimited
- true to limit the range, false not toisRangeLimited()
public void setDisplay(HasRows display)
HasRows
to be paged.display
- the HasRows
getDisplay()
protected void firstPage()
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.
setPage(int)
protected int getPageCount()
protected boolean hasNextPage()
nextPage()
will succeed in moving the starting point of the table
forward.protected boolean hasNextPages(int pages)
pages
- the number of pages to querypages
next pagesprotected boolean hasPage(int index)
index
- the page indexprotected boolean hasPreviousPage()
previousPage()
will succeed in moving the starting point of the
table backward.protected boolean hasPreviousPages(int pages)
pages
- the number of previous pages to querypages
previous pagesprotected void lastPage()
protected void lastPageStart()
protected void nextPage()
protected abstract void onRangeOrRowCountChanged()
protected void previousPage()
protected void setPage(int index)
index
- the page indexgetPage()
protected void setPageSize(int pageSize)
pageSize
- the new page sizegetPageSize()
protected void setPageStart(int index)
index
- the indexgetPageStart()
Copyright © 2018. All rights reserved.