Example usage for com.google.gwt.resources.css ExtractClassNamesVisitor exec

List of usage examples for com.google.gwt.resources.css ExtractClassNamesVisitor exec

Introduction

In this page you can find the example usage for com.google.gwt.resources.css ExtractClassNamesVisitor exec.

Prototype

public static Set<String> exec(CssStylesheet sheet) 

Source Link

Document

Extract all CSS class names in the provided stylesheet.

Usage

From source file:org.tessell.generators.css.AbstractCssGenerator.java

License:Apache License

private void extractClassNames(CssStylesheet sheet) {
    // De-duplicate method names
    final Set<String> methodNames = new HashSet<String>();
    for (final String className : ExtractClassNamesVisitor.exec(sheet)) {
        String methodName = GenUtils.toMethodName(className);
        while (!methodNames.add(methodName)) {
            methodName += "_"; // Unusual, handles foo-bar and foo--bar
        }/*  www .  ja v a  2  s  . c  o  m*/
        classToMethod.put(className, methodName);
    }
}