IStyleSheetListAdapter adapter = (IStyleSheetListAdapter) ((INodeNotifier) doc)
.getAdapterFor(IStyleSheetListAdapter.class);
StyleSheetList ssl = (adapter == null ? null : adapter
.getStyleSheets());
CSSClassTraverser traverser = new CSSClassTraverser();
if (ssl != null) {
for (int i = 0, numStyles = ssl.getLength(); i < numStyles; i++) {
// loop for styles (<style> and <link>)
org.w3c.dom.stylesheets.StyleSheet ss = ssl.item(i);
try {
traverser.apply((ICSSNode) ss);
} catch (ClassCastException ex) {
Logger log = PDPlugin
.getLogger(CSSStyleDeclaration.class);
log.error("Error.CSSUtil.0", ex); //$NON-NLS-1$
// FIXME: should this continue to be processed?
}
}
c = traverser.getClassNames();
}
}
String[] result = new String[c.size()];
c.toArray(result);
return result;