On Mon, Nov 30, 2009 at 4:05 PM, Thomas Broyer <[email protected]> wrote:
> > 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 ;-) > Agreed. However, there's a Shiny widget "ComplexButton" that does the Face work for me. I don't see how to make it play nicely w/ obfucasted CSS selectors. > 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;) > Yeah, that's (@external) what I'm doing. Thanks for the CssResource.Style example. I couldn't figure that one out. -- 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.
