Class 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.AbstractPager
    Essentially a fork of GWT's SimplePager that maintains a set page size and displays page numbers and total pages more elegantly. SimplePager will ensure pageSize rows are always rendered even if the "last" page has less than pageSize rows 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 interface  UberfireSimplePager.Style
      Styles used by this widget.
      static class  UberfireSimplePager.TextLocation
      The location of the text relative to the paging buttons.
      • Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject

        com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
    • Field Summary

      • Fields inherited from class com.google.gwt.user.client.ui.UIObject

        DEBUG_ID_PREFIX
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected String createText()  
      int getPageSize()  
      void nextPage()  
      protected void onRangeOrRowCountChanged()  
      void previousPage()  
      void setDisplay​(com.google.gwt.view.client.HasRows display)  
      void setPage​(int index)  
      void setPageSize​(int pageSize)  
      void setPageStart​(int index)  
      void setShowFastFordwardPageButton​(boolean showFastFordwardPageButton)  
      void setShowLastPageButton​(boolean showLastPageButton)  
      void startLoading()
      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 a SimplePager with the default text location.
      • UberfireSimplePager

        public UberfireSimplePager​(UberfireSimplePager.TextLocation location)
        Construct a SimplePager with 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 a SimplePager with the specified resources.
        Parameters:
        location - the location of the text relative to the buttons
        resources - the UberfireSimplePagerResources to use
        showFastForwardButton - if true, show a fast-forward button that advances by a larger increment than a single page
        fastForwardRows - the number of rows to jump when fast forwarding
        showLastPageButton - 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:
        getPageSize in class com.google.gwt.user.cellview.client.AbstractPager
      • setPageSize

        public void setPageSize​(int pageSize)
        Overrides:
        setPageSize in class com.google.gwt.user.cellview.client.AbstractPager
      • nextPage

        public void nextPage()
        Overrides:
        nextPage in class com.google.gwt.user.cellview.client.AbstractPager
      • previousPage

        public void previousPage()
        Overrides:
        previousPage in class com.google.gwt.user.cellview.client.AbstractPager
      • setDisplay

        public void setDisplay​(com.google.gwt.view.client.HasRows display)
        Overrides:
        setDisplay in class com.google.gwt.user.cellview.client.AbstractPager
      • setPage

        public void setPage​(int index)
        Overrides:
        setPage in class com.google.gwt.user.cellview.client.AbstractPager
      • setPageStart

        public void setPageStart​(int index)
        Overrides:
        setPageStart in class com.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:
        onRangeOrRowCountChanged in class com.google.gwt.user.cellview.client.AbstractPager