use of org.w3c.dom.stylesheets.StyleSheetList in project webtools.sourceediting by eclipse.
the class CSSStyleSheetImpl method getOwnerRules.
/**
* @return org.w3c.dom.css.CSSRuleList
*/
public org.w3c.dom.css.CSSRuleList getOwnerRules() {
StyleSheetList list = getParentStyleSheets();
if (list == null)
return null;
CSSRuleListImpl ruleList = new CSSRuleListImpl();
for (int i = 0; i < list.getLength(); i++) {
ImportRuleCollector trav = new ImportRuleCollector(this);
trav.apply((ICSSStyleSheet) list.item(i));
ruleList.nodes.addAll(trav.getRules());
}
return ruleList;
}
use of org.w3c.dom.stylesheets.StyleSheetList 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