imgPageFirst = imageBundle.page_first().createImage();
imgPagePrev = imageBundle.page_prev().createImage();
imgPageNext = imageBundle.page_next().createImage();
imgPageLast = imageBundle.page_last().createImage();
btnPageFirst = new PushButton(imgPageFirst, this);
btnPagePrev = new PushButton(imgPagePrev, this);
btnPageNext = new PushButton(imgPageNext, this);
btnPageLast = new PushButton(imgPageLast, this);
tbPage.addKeyUpHandler(this);
tbPage.addChangeHandler(this);
tbPage.setMaxLength(4);
tbPage.setStyleName(Styles.PAGE);
// prev buttons (divs)
addButton(btnPageFirst, "First Page");
addButton(btnPagePrev, "Previous Page");
// separator
split = imageBundle.split().createImage();
split.setStylePrimaryName(Toolbar.Styles.SPLIT);
add(split);
// Page x of y
final FlowPanel pageXofY = new FlowPanel();
pageXofY.addStyleName(Styles.PAGE_CONTAINER);
pageXofY.add(lblPagePre);
pageXofY.add(tbPage);
pageXofY.add(lblPagePost);
add(pageXofY);
// separator
split = imageBundle.split().createImage();
split.setStylePrimaryName(Toolbar.Styles.SPLIT);
add(split);
// next buttons (divs)
addButton(btnPageNext, "Next Page");
addButton(btnPageLast, "Last Page");
}
// show refresh button?
if(config.isShowRefreshBtn()) {
imgRefresh = imageBundle.refresh().createImage();
btnRefresh = new PushButton(imgRefresh, this);
if(pageSize > 0) {
// separator
split = imageBundle.split().createImage();
split.setStylePrimaryName(Toolbar.Styles.SPLIT);
add(split);
}
addButton(btnRefresh, "Refresh");
}
// show add button?
if(addRowHandler != null) {
// imgAdd = imageBundle.add().createImage();
final String title = "Add " + config.getListingElementName();
btnAdd = new PushButton(title, this);
if(pageSize > 0 || config.isShowRefreshBtn()) {
// separator
split = imageBundle.split().createImage();
split.setStylePrimaryName(Toolbar.Styles.SPLIT);
add(split);