Revision: 7402
Author: [email protected]
Date: Thu Jan 14 16:35:41 2010
Log: Add @defs to interfaces created by the CssResource InterfaceGenerator utility class.

Patch by: srinivasanb
Review by: bobv
http://code.google.com/p/google-web-toolkit/source/detail?r=7402

Modified:
 /trunk/user/src/com/google/gwt/resources/css/InterfaceGenerator.java

=======================================
--- /trunk/user/src/com/google/gwt/resources/css/InterfaceGenerator.java Wed Oct 28 09:10:53 2009 +++ /trunk/user/src/com/google/gwt/resources/css/InterfaceGenerator.java Thu Jan 14 16:35:41 2010
@@ -43,7 +43,7 @@
  */
 public class InterfaceGenerator extends ToolBase {

- private static final Comparator<String> CSS_CLASS_COMPARATOR = new Comparator<String>() { + private static final Comparator<String> NAME_COMPARATOR = new Comparator<String>() {
     public int compare(String o1, String o2) {
       return o1.compareToIgnoreCase(o2);
     }
@@ -217,9 +217,12 @@
     // Create AST
CssStylesheet sheet = GenerateCssAst.exec(logger, inputFile.toURI().toURL());

-    // Sort all class names
-    Set<String> classNames = new TreeSet<String>(CSS_CLASS_COMPARATOR);
-    classNames.addAll(ExtractClassNamesVisitor.exec(sheet));
+    // Sort all names
+    Set<String> names = new TreeSet<String>(NAME_COMPARATOR);
+    names.addAll(ExtractClassNamesVisitor.exec(sheet));
+    DefsCollector defs = new DefsCollector();
+    defs.accept(sheet);
+    names.addAll(defs.getDefs());

     // Deduplicate method names
     Set<String> methodNames = new HashSet<String>();
@@ -240,7 +243,7 @@
     sw.println("interface " + interfaceName.substring(lastDot + 1)
         + " extends CssResource {");
     sw.indent();
-    for (String className : classNames) {
+    for (String className : names) {
       String methodName = methodName(className);

       while (!methodNames.add(methodName)) {
-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to