display.getPullHeader().setHTML("pull down");
display.getPullFooter().setHTML("pull up");
PullArrowStandardHandler headerHandler = new PullArrowStandardHandler(display.getPullHeader(), display.getPullPanel());
headerHandler.setErrorText("Error");
headerHandler.setLoadingText("Loading");
headerHandler.setNormalText("pull down");
headerHandler.setPulledText("release to load");
headerHandler.setPullActionHandler(new PullActionHandler() {
@Override
public void onPullAction(final AsyncCallback<Void> callback) {
new Timer() {
@Override
public void run() {
if (failedHeader) {
callback.onFailure(null);
} else {
for (int i = 0; i < 5; i++) {
list.add(0, new Topic("generated Topic " + (counter + 1), counter));
counter++;
}
display.render(list);
display.refresh();
callback.onSuccess(null);
}
failedHeader = !failedHeader;
}
}.schedule(1000);
}
});
display.setHeaderPullHandler(headerHandler);
PullArrowStandardHandler footerHandler = new PullArrowStandardHandler(display.getPullFooter(), display.getPullPanel());
footerHandler.setErrorText("Error");
footerHandler.setLoadingText("Loading");
footerHandler.setNormalText("pull up");
footerHandler.setPulledText("release to load");
footerHandler.setPullActionHandler(new PullActionHandler() {
@Override
public void onPullAction(final AsyncCallback<Void> callback) {
new Timer() {