On 27 avr, 10:43, Ed <[email protected]> wrote: > Why is GWT not using CssResource to set styles on his components like > a Button/Label?
Because noone took the time to do it? (and GWT being a toolkit, it has to account for both backwards and forwards compat, so it must be well thought out from the beginning) > I find it hard to use CssResources on reusable widgets, such that the > styles can still be changed through the API of the widget by the > outside world :(.. What's the problem? If you call setStylePrimaryName or addStyleDependentName you should know what you're doing and which are the consequences. The idea is that widgets document (in their JavaDoc) what they're doing internally (default stylePrimaryName, dependent names added or removed on which actions/events, add/removeStyleName on which actions/events) I haven't tried it, but passing some specialized CssResource or ClientBundle to the constructor and then only using setStylePrimaryName and add/removeStyleName (obviously not dependent style names) should do it. GWT already uses ImageResource and ClientBundle (when multiple ImageResources are needed), and it shouldn't be really different with a CssResource. Have a look at Tree and its Tree.Resources, MenuBar and its MenuBar.Resources, HorizontalSplitPanel and VerticalSplitPanel and their *.Resources, and DisclosurePanel which makes direct use of ImageResource, -- 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.
