Revision: 6422 Author: b...@google.com Date: Mon Oct 19 16:08:21 2009 Log: Edited wiki page through web user interface. http://code.google.com/p/google-web-toolkit/source/detail?r=6422
Modified: /wiki/CssResource.wiki ======================================= --- /wiki/CssResource.wiki Fri Aug 28 10:28:46 2009 +++ /wiki/CssResource.wiki Mon Oct 19 16:08:21 2009 @@ -615,6 +615,18 @@ In the above example, the `.obfuscated` class selector will be obfuscated, and the `obfuscated()` method will return the replaced name. Neither of the legacy selectors will be obfuscated and the `legacySelectorA()` method will return the unobfuscated value. Furthermore, because the `legacySelectorB` is explicitly defined in the `...@external` declaration, the `...@strict` annotation will not trigger an error. +== Automatically generating CssResource interfaces == + +A utility is included in the GWT distribution which will analyze a CssResource-compatible CSS file and create a corresponding Java interface for accessing the classnames used in the file. + +{{{ +java -cp gwt-dev.jar:gwt-user.jar com.google.gwt.resources.css.InterfaceGenerator \ + -standalone -typeName some.package.MyCssResource -css input.css +}}} + +The generated interface will be emitted to `System.out`. The `-standalone` option will add the necessary `package` and `import` statements to the output so that it can be used as part of a build process. + + =Important open questions= * Can we manipulate style rules across browsers? * Maybe make MyCSSResource.mySpriteClass() return Rule object --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---