code: private void updatePaginationState(final SimplePager pager) {
  
          for (int i = 0; i < getWidgetCount(); i++) {
              if (i == 0) { //previous button
                  ((AnchorListItem)getWidget(i)).setEnabled(pager.hasPreviousPage());
              }
              else if (i == getWidgetCount() - 1) { //next button
                  ((AnchorListItem)getWidget(i)).setEnabled(pager.hasNextPage());
              }
              else {
                  int index = i - 1;
                  if (index == pager.getPage()) {
                      ((AnchorListItem)getWidget(i)).setActive(true);
                  }
                  else {
                      ((AnchorListItem)getWidget(i)).setActive(false);
                  }
              }
          }
     }
docs: This updates the current active page, and the enabled state
  of the previous and next buttons in the Pagination based
  on the state of the given SimplePager.
  @param pager the SimplePager of the CellTable/DataGrid