List of usage examples for com.google.gwt.resources.css ExtractClassNamesVisitor exec
public static Set<String> exec(CssStylesheet sheet, JClassType... imports)
From source file:fr.onevu.gwt.uibinder.rebind.model.ImplicitCssResource.java
License:Apache License
/** * Returns the set of CSS classnames in the underlying .css files. * * @throws UnableToCompleteException if the user has called for a .css file we * can't find./*from www . ja va 2s . c o m*/ */ public Set<String> getCssClassNames() throws UnableToCompleteException { List<URL> urls = getExternalCss(); if (cssClassNames == null) { final File bodyFile = getGeneratedFile(); if (bodyFile != null) { try { urls.add(bodyFile.toURI().toURL()); } catch (MalformedURLException e) { throw new RuntimeException(e); } } assert urls.size() > 0; CssStylesheet sheet = GenerateCssAst.exec(logger.getTreeLogger(), urls.toArray(new URL[urls.size()])); cssClassNames = ExtractClassNamesVisitor.exec(sheet, imports.toArray(new JClassType[imports.size()])); } return cssClassNames; }