3

I noticed that when running GWT, it doesn't alert me of css errors such as missing/misspelled classes. Even the error console of Firefox doesn't prompt anything.

I'm skinning my web app pretty intensively, need a way to show up the css errors, any suggestion that I can try?

Thanks in advance.

Style
  • 155
  • 1
  • 1
  • 9
  • Are you using UiBinder and/or CssResource? – Igor Klimer Apr 07 '10 at 22:44
  • Hi there! I'm not using both of them yet, basically editing the css file generated when you create a new GWT project (via Eclipse plugin). The weirdest thing is Firefox is also not reporting the css errors.. – Style Apr 08 '10 at 02:31

1 Answers1

2

In order for GWT to report any CSS errors (misspelled/missing class names), you need to be including your CSSs in your GWT project via CssResource (check out the docs for usage examples, etc). If you are using UiBinder, all the CSS you declare in UiBinder's XML files are automagically converted to CssResources, so you get the benefits there too (plus, with the Google Plugin for Eclipse, you'll get nice, red underlines under any misspelled/missing class names, just as you do with any other Java errors).

Note however, that CssResource obfuscates your style names by default, so it might take a bit of work to refactor your project to take that into account (again, see the docs for a more extensive read).

Igor Klimer
  • 15,321
  • 3
  • 47
  • 57
  • Thank you very much :) Was away thus the late reply~ Thanks for including the links, they help a lot. By the way, I'm wondering about UiBinder: How is it better than the way of building the UI in a Java Swing way? – Style Apr 29 '10 at 16:10
  • There are many questions here on SO and on Google GWT Group about that - like http://stackoverflow.com/questions/2690224/what-is-the-best-approach-towards-styling-gwt-applications – Igor Klimer Apr 29 '10 at 17:49