GWT SimplePager: How to change the image of the pager buttons?

I want to change the images of the pager buttons (first, last, next, prev, fastforward). I'm tired of using CSS, but I could not achieve it. Any help or suggestion would be appreciated. I am using GWT 2.4.0

+4
source share
1 answer

You need to extend the SimplePager.Resources interface and provide your own images. Then pass an instance of these resources to the SimplePager constructor:

 public interface MyPagerImages extends SimplePager.Resources { // Here you can @Override all the methods and place @Source annotation to tell // SimplePager what image should be loaded as a replacement // For example here I am replacing the Fast Forward image. @Override @Source( "myFastForward.gif" ) ImageResource simplePagerFastForward() } 

then when building SimplePager:

 MyPagerImages myImages = GWT.create(MyPagerImages.class); SimplePager pager = new SimplePager(SimplePager.TextLocation.CENTER, myImages, true, 1000 /* that the default */, false); 
+8
source

Source: https://habr.com/ru/post/1387506/


All Articles