Possibly not as simple as you wanted, but you can do something like this:
(1) Create base class com.foo.ThemeInfo and subclasses ThemeInfoOne and
ThemeInfoTwo
(2) Add this to your gwt.xml:
<replace-with class="com.foo.ThemeInfoOne">
<when-type-is class="com.foo.ThemeInfo"/>
<when-property-is name="theme" value="theme1"/>
</replace-with>
<replace-with class="com.foo.ThemeInfoTwo">
<when-type-is class="com.foo.ThemeInfo"/>
<when-property-is name="theme" value="theme2"/>
</replace-with>
(3) In your client-side code:
ThemeInfo info = GWT.create(ThemeInfo.class);
and you'll get an instance of ThemeInfoOne when using theme1 and ThemeInfoTwo
when using theme2 and an instance of the ThemeInfo base class otherwise
This should let you do what you want, and also move the "if using theme#1" test
to compile time.
HTH
Paul
On 15/03/11 12:46, Raphael André Bauer wrote:
Hi,
is there a simple way to get a gwt-property when the GWT app is running?
e.g. I have:
<define-property name="theme"/ values="theme1, theme2"/>
Then at compile time I get nice permutations for theme1 and theme2. Cool so far.
For some agile flexible fine-tuning it would be nice to get the value
of "theme".
Something like GWT.getPermutationProperty("theme")
Is this possible - or plain stupid because that's what compile time
permutations are for... (I know that, but nevertheless...) ?
Thanks!
Raphael
--
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.