Actually, I decided to write a Generator for this, being curious

You would have an ImageBundle

public interface IconsImageBundle extends ImageBundle
{
          @Resource("save.gif")
          public AbstractImagePrototype saveIcon();

}

Second you would have an ImageBundleMap

public interface IconsImageBundleMap extends
ImageBundleMap,IconsImageBundle
{

}

IconsImageBundleMap icons = GWT.create(IconsImageBundleMap.class);

Then is can be used BOTH ways:

AbstractImagePrototype save = icons.getByName("saveIcon"); // this CAN
return NULL.

or

AbstractImagePrototype save = icons.saveIcon();

also you can get the collection underneath:

Map<String, AbstractImageBundle> list = icons.getImageMap();

Also, you can implement MULTIPLE ImageBundles and it coalesces them:

public interface ApplicationImageBundleMap extends ImageBundleMap,
IconsImageBundle, LogosImageBundle, ActionsImageBundle
{

}

On Aug 24, 10:40 pm, "Dean S. Jones" <[email protected]> wrote:
> There is no easy way to do this, Reflection is not supported in GWT.
> The only thing "GWT'ish" I can think of is wrapping theImageBundlein
> some Interface makes a Map<String, AbstractImagePrototype> from a GWT
> "Generator"
>
> Thats a bit too much trouble for a few ImageBundles, so I just created
> class with a Map of<String, AbstractImagePrototypeFactory> that
> creates the AbstractImagePrototype lazily(via a factory), and
> optionally caches the results.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to