0

I used applyTo(image) on a AbstractImagePrototype in the past. But now resources are mainly created with a @Resource AbstractImagePrototype line.

http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/ui/AbstractImagePrototype.html

The applyTo(Image) method provides an efficient way to replace the contents of an existing Image. This is useful in cases where an image changes its appearance based on a user's action. Instead of creating two Image objects then alternately hiding/showing them, one can use the applyTo(Image) method of two AbstractImagePrototype objects to transform a single Image object between two (or more) visual representations.

But now it seems better to use a ClientBundle with @Source ImageResource. Unfortunately this ImageResource does not provide a applyTo(image) method. What to I have to change to have the same functionality to just replace an image?

Jarrod
  • 9,349
  • 5
  • 58
  • 73
membersound
  • 81,582
  • 193
  • 585
  • 1,120

1 Answers1

0

There's Image#setResource(ImageResource) and AbstractImageResource.create(ImageResource), and many other ways to use an ImageResource.

Thomas Broyer
  • 64,353
  • 7
  • 91
  • 164