I'm trying to use a Map in a Constants interface, and I'm running into
a couple of problems.  I'm using the documentation <a href="http://
google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/i18n/
client/Constants.html">here</a> as a guide, and I'm a little confused.

First, the document seems to indicate that if i have the following
four entries in my properties file -
a = X
b = Y
c = Z
someMap = a, b, c

I should end up with 3 String methods (a, b, c) and a Map method
(someMap).  When I use I18NSync to generate the interface from the
properties file, I end up with 4 String methods.

OK, not what I was hoping, so, in hopes of gaining some understanding,
I move on to directly manipulating the Interface file.  I switch the
annotation of someMap from @DefaultStringValue to
@DefaultStringMapValue.  I'd expect DefaultStringMapValue to want only
the keys (ie @DefaultStringMapValue("a", "b", "c")), but it turns out
it wants the keys and values.  Again, not so great if I want to manage
larger maps.  So, I key in an entry in what I think is the correct
format: @DefaultStringMapValue("a", "P", "b", "Q", "c", "R").
Notice that I've decided, for shucks and giggles, to map the keys to
different values than they were defined for as "separate" values.
So, I fire up the app, look at the map, and what to my wondering eyes
does appear, but this:  {a=X, b=Y, c=Z} !!!!!...

Now I'm really confused (and maybe a little dazed).
So, I'm left with two questions to the group:
1.  Can I automatically generate Map entries for Constants from my
properties files?  (ie, was I just doing something wrong?)
2.  What (TF) is up with the @DefaultStringMapValue annotation?  Why
does it require both key and value, if it's just going to chuck the
value and lookup the key anyway?

Thanks,
Mike
--~--~---------~--~----~------------~-------~--~----~
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