On 30 nov, 18:17, Jeff Chimene <[email protected]> wrote:
> Hi:
>
> Is it the case that I must use plaintext (non-obfuscated) CSS selectors w/
> setStylePrimaryName?
>
> For example, the following call
> setStylePrimaryName(INSTANCE.style().menuButton());
>
> works, but the secondary style references the obfuscated primary style name.
> So selectors like "-hovering" and "-down" aren't triggered.
Yes, because the my-MenuButton-hovering will have been obfuscated too,
independently of my-MenuButton.
With CssResource, you'll actually end up using only setStyleName
(instead of setStylePrimaryName) and add/removeStyleName (instead of
add/removeStyleDependentName); On the plus side, it also involves far
less computations at runtime ;-)
On the down side, you can no longer create a widget getting its "style
primary name" at construction time, you'll have to pass it a
CssResource with one method per "state"; in your case:
interface Styles extends CssResource {
String menuButton();
String menuButtonHovering();
String menuButtonDown();
}
...
public MenuButtonWidget(Styles styles) {
...
}
...or you can also disable obfuscation on your whole CSS resource (and
all your CSS resources, <set-configuration-property
name="CssResource.style" value="pretty" />) or selected classes
(@external my-MenuButton, my-MenuButton-hovering, my-MenuButton-down;)
--
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.