views:

34

answers:

1
public interface ReviewPanelStyle extends CssResource {...}

@Source("BlueReviewPanelStyle.css")
ReviewPanelStyle BlueReviewPanelStyle();

@Source("YellowReviewPanelStyle.css")
ReviewPanelStyle YellowReviewPanelStyle();

We would think that this should work, however it does not.

The color of elements styled (regardless of weather associated with the Yellow or Blue css) will be styled based on the order of these two lines.

Resources.INSTANCE.YellowReviewPanelStyle().ensureInjected();
Resources.INSTANCE.BlueReviewPanelStyle().ensureInjected();

As a work around I duplicated ReviewPanelStyle (ReviewPanelStyle2), but I rather not...any ideas?

A: 

Scoping of obfuscated class names is defined by the return type of the CssResource accessor method

Defining two separate interfaces for each style should do the trick. More information at http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.html#Scope

z00bs
Thanks! This looks like the solution. Will try tomorrow at work.
nick