@Override protected void onRangeOrRowCountChanged() { HasRows display = getDisplay(); label.setText(createText()); // Update the prev and first buttons. setPrevPageButtonsDisabled(!hasPreviousPage()); // Update the next and last buttons. if (isRangeLimited() || !display.isRowCountExact()) { setNextPageButtonsDisabled(!hasNextPage()); setFastForwardDisabled(!hasNextPages(getFastForwardPages())); } }
@Override protected void onRangeOrRowCountChanged() { HasRows display = getDisplay(); label.setText(createText()); // Update the prev and first buttons. setPrevPageButtonsDisabled(!hasPreviousPage()); // Update the next and last buttons. if (isRangeLimited() || !display.isRowCountExact()) { setNextPageButtonsDisabled(!hasNextPage()); setFastForwardDisabled(!hasNextPages(getFastForwardPages())); } }
@Override protected void onRangeOrRowCountChanged() { HasRows display = getDisplay(); label.setText(createText()); // Update the prev and first buttons. setPrevPageButtonsDisabled(!hasPreviousPage()); // Update the next and last buttons. if (isRangeLimited() || !display.isRowCountExact()) { setNextPageButtonsDisabled(!hasNextPage()); setFastForwardDisabled(!hasNextPages(getFastForwardPages())); } }
/** * 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 */ 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); } } } } }
/** * 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 */ 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); } } } } }
prev.setEnabled(pager.hasPreviousPage());
prev.setEnabled(pager.hasPreviousPage());