Class UberfireSimplePager
- 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
-
- org.uberfire.ext.widgets.table.client.UberfireSimplePager
-
- All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers,com.google.gwt.event.shared.HasHandlers,com.google.gwt.user.client.EventListener,com.google.gwt.user.client.ui.HasVisibility,com.google.gwt.user.client.ui.IsRenderable,com.google.gwt.user.client.ui.IsWidget
public class UberfireSimplePager extends com.google.gwt.user.cellview.client.AbstractPagerEssentially a fork of GWT's SimplePager that maintains a set page size and displays page numbers and total pages more elegantly. SimplePager will ensurepageSizerows are always rendered even if the "last" page has less thanpageSizerows remain. Forked not sub-classed as GWTs code is largely private and not open to extension :(
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceUberfireSimplePager.StyleStyles used by this widget.static classUberfireSimplePager.TextLocationThe location of the text relative to the paging buttons.
-
Constructor Summary
Constructors Constructor Description UberfireSimplePager()Construct aSimplePagerwith the default text location.UberfireSimplePager(boolean showFastForwardButton, boolean showLastPageButton)UberfireSimplePager(UberfireSimplePager.TextLocation location)Construct aSimplePagerwith the specified text location.UberfireSimplePager(UberfireSimplePager.TextLocation location, UberfireSimplePagerResources resources, boolean showFastForwardButton, int fastForwardRows, boolean showLastPageButton)Construct aSimplePagerwith the specified resources.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringcreateText()intgetPageSize()voidnextPage()protected voidonRangeOrRowCountChanged()voidpreviousPage()voidsetDisplay(com.google.gwt.view.client.HasRows display)voidsetPage(int index)voidsetPageSize(int pageSize)voidsetPageStart(int index)voidsetShowFastFordwardPageButton(boolean showFastFordwardPageButton)voidsetShowLastPageButton(boolean showLastPageButton)voidstartLoading()Let the page know that the table is loading.-
Methods inherited from class com.google.gwt.user.cellview.client.AbstractPager
firstPage, getDisplay, getPage, getPageCount, getPageStart, hasNextPage, hasNextPages, hasPage, hasPreviousPage, hasPreviousPages, isRangeLimited, lastPage, lastPageStart, setRangeLimited
-
Methods inherited from class com.google.gwt.user.client.ui.Composite
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
-
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
-
Methods inherited from class com.google.gwt.user.client.ui.UIObject
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
-
-
-
-
Constructor Detail
-
UberfireSimplePager
public UberfireSimplePager()
Construct aSimplePagerwith the default text location.
-
UberfireSimplePager
public UberfireSimplePager(UberfireSimplePager.TextLocation location)
Construct aSimplePagerwith the specified text location.- Parameters:
location- the location of the text relative to the buttons
-
UberfireSimplePager
public UberfireSimplePager(boolean showFastForwardButton, boolean showLastPageButton)
-
UberfireSimplePager
public UberfireSimplePager(UberfireSimplePager.TextLocation location, UberfireSimplePagerResources resources, boolean showFastForwardButton, int fastForwardRows, boolean showLastPageButton)
Construct aSimplePagerwith the specified resources.- Parameters:
location- the location of the text relative to the buttonsresources- theUberfireSimplePagerResourcesto useshowFastForwardButton- if true, show a fast-forward button that advances by a larger increment than a single pagefastForwardRows- the number of rows to jump when fast forwardingshowLastPageButton- if true, show a button to go the the last page
-
-
Method Detail
-
setShowLastPageButton
public void setShowLastPageButton(boolean showLastPageButton)
-
setShowFastFordwardPageButton
public void setShowFastFordwardPageButton(boolean showFastFordwardPageButton)
-
getPageSize
public int getPageSize()
- Overrides:
getPageSizein classcom.google.gwt.user.cellview.client.AbstractPager
-
setPageSize
public void setPageSize(int pageSize)
- Overrides:
setPageSizein classcom.google.gwt.user.cellview.client.AbstractPager
-
nextPage
public void nextPage()
- Overrides:
nextPagein classcom.google.gwt.user.cellview.client.AbstractPager
-
previousPage
public void previousPage()
- Overrides:
previousPagein classcom.google.gwt.user.cellview.client.AbstractPager
-
setDisplay
public void setDisplay(com.google.gwt.view.client.HasRows display)
- Overrides:
setDisplayin classcom.google.gwt.user.cellview.client.AbstractPager
-
setPage
public void setPage(int index)
- Overrides:
setPagein classcom.google.gwt.user.cellview.client.AbstractPager
-
setPageStart
public void setPageStart(int index)
- Overrides:
setPageStartin classcom.google.gwt.user.cellview.client.AbstractPager
-
startLoading
public void startLoading()
Let the page know that the table is loading. Call this method to clear all data from the table and hide the current range when new data is being loaded into the table.
-
createText
protected String createText()
-
onRangeOrRowCountChanged
protected void onRangeOrRowCountChanged()
- Specified by:
onRangeOrRowCountChangedin classcom.google.gwt.user.cellview.client.AbstractPager
-
-