You only need to create a sub-interface, and the annotations are only necessary if the image filenames cannot be inferred from the method names in that sub-interface.
It wasn't clear from the original article how Cappuccino handles this...do they automatically throw any image that happens to be in a magic directory into the bundle?
There are other details that are different, so I guess I shouldn't have said "exactly". ImageBundle will make a real PNG for you instead of Base64, for example. Although in 2.0 the new generalized ClientBundle facility (same concept, but you can also bundle CSS, XML, a PDF...) promises to use data: URLs, JSON notation, or other representations when its calculated to be size-appropriate.
The default jakefile we will ship just automatically bundles any image resource in the project.
ImageBundle sounds pretty solid. I guess they are inferring the orientation of an image somehow? I'd like to see how that works. If you use an image in multiple orientations, or if you need to stretch in both directions, using a single .png file just isn't possible, unless there's something I'm missing.
In the current implementation (ImageBundle) you would need to have separate copies for each orientation & scale. That's a really nice thing that the Cappuccino implementation brings. The new ClientBundle implementation promises to, at least, have the compiler flip an image left-to-right when appropriate for a user's locale:
@ImageOptions(flipRtl = true)
...and there's another hint for images that are intended to be tiled:
@ImageOptions(repeatStyle=RepeatStyle.Vertical)
There's no scaling yet, but the tiling annotation covers some of the cases where you might want scaling (such as the edges of a corner-rounded/drop-shadowed box of variable size).
GWT 2.0 ClientBundle will use Base64 for images because GWT will bake those images straight to the compiled JS, along with the CSS styles.
The CSS names would be obfuscated (and also shortened).
All these features are there to support code-splitting (splitting the one big giant compiled and obfuscated Javascript file with everything into several "chunks" of JS files to be sent on-demand).
It wasn't clear from the original article how Cappuccino handles this...do they automatically throw any image that happens to be in a magic directory into the bundle?
There are other details that are different, so I guess I shouldn't have said "exactly". ImageBundle will make a real PNG for you instead of Base64, for example. Although in 2.0 the new generalized ClientBundle facility (same concept, but you can also bundle CSS, XML, a PDF...) promises to use data: URLs, JSON notation, or other representations when its calculated to be size-appropriate.