GWT Plugin: External CSS Files Are Not Being Recognised By The IDE Editor.

At first, I thought I found a problem with GWT, but now I think the problem is with the IntelliJ GWT Studio plugin.

I'm inheriting styles into an application specific GWT module from style sheets I have in another GWT module I created for common code to share between several GWT modules, but I am getting errors displayed in the IDE's editor in my application specific GWT module as if the styles did not exist at all ("Unknown CSS class").

I'm using the Mac OS X version of GWT 1.4 RC2 (version 1.4.59) and IntelliJ IDEA 6.0.5.

I have a common GWT module (names change to protect the guilty). In Common.gwt.xml I have:

... ... ... ... The common.css file is located in the Common module's 'public' directory. My UI widgets in the Common module's 'client' directory are able to set styles defined in common.css without problems and everything compiles without errors. I have an application specific GWT module, MyApp.gwt.xml and it inherits the Common module and also defines its own style sheet: ... ... ... ... ... ... The MyApp module is able to inherit the interfaces and classes defined in the Common module without problems, as you would expect, but if I set Common module styles in my MyApp module UI widgets I get errors in IntelliJ IDEA, "Unknown CSS class." I checked the application's 'exploded' output directory and and the Common.css file was right there alongside the MyApp.css file. There is no reason why my MyApp UI classes cannot see the Common.css file if they can see the MyApp.css file without problems. Despite IntelliJ reporting an "Unknown CSS class" error in the IDE's editor, the application does compile without errors or warnings. When I execute the application it runs just fine and all the styles implemented from the Common.css file are displaying perfectly. Clearly, then, GWT's module inheritance is working. Just to be sure, I closed IntelliJ, deleted it's cache directory, deleted the 'exploded' output directory for my application's resource files and compiled classes and then restarted IntelliJ. IntelliJ rebuilt it's cache directory and then I rebuilt my application and all the GWT modules from scratch. IntelliJ continued to report the "Unknown CSS class" error for my MyApp UI classes in it's editor, but MyApp compiled and executed just fine as before. So, not a GWT problem. As an experiment, I moved the "missing" style class from Common.css to MyApp.css and now the IntelliJ IDEA editor quits complaining about an unknown CSS class. As a further experiment, I reverted the above change and then in my MyApp.gwt.xml file I changed the style sheet reference from MyApp.css to Common.css (since I know they exist side-by-side in the 'exploded' directory), but the IntelliJ IDEA editor continues to complain (now all the style widgets compain about unknown CSS classes!). Next I put a copy of Common.css into MyApp's 'public' directory. The IntelliJ IDEA editor continues to complain, until I add a reference to Common.css in the MyApp.gwt.xml file: ... ... ... ... ... ... ]]>

Now IntelliJ's IDEA editor quits complaining! If I left the gwt.xml file as above and removed the Common.css from MyApp's 'public' folder again the editor goes back to complaining.

Clearly, IntelliJ's IDEA editor (or the GWT Studio plugin) is not accounting for GWT's module inheritance when it comes to CSS files. Everything else regarding inheritance (image files, class files, etc.) seems fine.

Obviously, I do not want to resort to the "hack" I described above to get IntelliJ's IDEA editor to stop complaining.

Thank you in advance for any help or suggestions.

- Garry Archer

Please sign in to leave a comment.