Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GWT SimplePager : How to change the button images of the pager?

Tags:

gwt

I want to change the button images of pager (first, last, next, prev, fastforward). I tired using CSS but i haven't been able to achieve it. Any Help or Suggestion would be appreciated. I am using GWT 2.4.0

like image 815
Abhijith Nagaraja Avatar asked Jan 19 '23 00:01

Abhijith Nagaraja


1 Answers

You need to extend SimplePager.Resources interface and provide your own images. Then pass on an instance of these resources into 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 constructing the SimplePager:

MyPagerImages myImages = GWT.create(MyPagerImages.class);
SimplePager pager = new SimplePager(SimplePager.TextLocation.CENTER, 
  myImages, true, 1000 /* that's the default */, false);
like image 132
Strelok Avatar answered Apr 30 '23 15:04

Strelok