use of org.eclipse.wst.css.core.internal.util.CSSClassTraverser in project webtools.sourceediting by eclipse.
the class HTMLDocumentAdapter method getClasses.
/**
*/
public Enumeration getClasses() {
StyleSheetList sheetList = getStyleSheets();
int nSheets = sheetList.getLength();
final ArrayList classes = new ArrayList();
CSSClassTraverser traverser = new CSSClassTraverser();
traverser.setTraverseImported(true);
for (int i = 0; i < nSheets; i++) {
org.w3c.dom.stylesheets.StyleSheet sheet = sheetList.item(i);
if (sheet instanceof ICSSNode) {
traverser.apply((ICSSNode) sheet);
}
}
classes.addAll(traverser.getClassNames());
return new Enumeration() {
int i = 0;
public boolean hasMoreElements() {
return i < classes.size();
}
public Object nextElement() {
return classes.get(i++);
}
};
}
Aggregations