Ok. I understand the way it works, I just forgot that certain
optimizations aren't applied. It's interesting because unused methods
of the interface are actually eliminated from the code (look at the
generated output). The image strip needs to be generated first, then
the implementation of the interface is generated containing all the
coordinates for each image. After that point the generators are out of
the picture. The normal GWT compilation happens.

The only way to do this is to somehow have a second pass to rebuild
the image strip with only the images needed and update the image
coordinates.

Does anyone know if @ImageResource in the incubator can do this?

On Feb 10, 11:56 pm, reechard <richard.j.wal...@gmail.com> wrote:
> Yes and no. ImageBundle is very useful and easy to set up. So, what
> you want to do is create an imageBundle with everything and the
> kitchen sink commented out, as you suggest. Put all the images you
> might need right where the YourImageBundle.java source is.
>
> What you are missing is that the resulting ImageBundle will only
> contain the images NOT commented out.
>
> You can even set this up as a separate library project, and re-compile
> only when modifying YourImageBundle.java. You can also provide
> multiple ImageBundles this way, as I do for "localized" ImageBundles.
>
> On Feb 10, 12:36 pm, Mark  Renouf <mark.ren...@gmail.com> wrote:
>
> > Should I expect dead code elimination to work on ImageBundle?
>
> > Let's say I have an icon library, and to save time, I'd like to
> > include a lot of images we may choose to use in the future. There
> > could be about 100. Right now, we use only 8 of them. Shouldn't the
> > generated ImageBundle resource only contain those 8 images?
>
> > I'd like to avoid having to copy images one at a time into our
> > project, adding them to the interface as they are needed. The only
> > alternative I can see right now is to comment out the images we are
> > not using.
>
> > Am I missing something?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to