开发者

one GWT CssResource, two implementations (css files)

开发者 https://www.devze.com 2023-01-19 19:51 出处:网络
public interface ReviewPanelStyle extends CssResource {...} @Source(\"BlueReviewPanelStyle.css\") ReviewPanelStyle BlueReviewPanelStyle();
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().ensure开发者_StackOverflow中文版Injected();

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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消