final List sses = new LinkedList(); //a list of StyleSheet
for (Iterator it = LanguageDefinition.getByDeviceType(deviceType).iterator();
it.hasNext();) {
final LanguageDefinition langdef = (LanguageDefinition)it.next();
for (Iterator e = langdef.getStyleSheets().iterator(); e.hasNext();) {
final StyleSheet ss = (StyleSheet)e.next();
if (!disabled.contains(ss.getHref()))
sses.add(ss);
}
}
//Process configuration
final ThemeProvider themeProvider = config.getThemeProvider();
if (themeProvider != null) {
final List orgss = new LinkedList();
for (Iterator it = sses.iterator(); it.hasNext();) {
final StyleSheet ss = (StyleSheet)it.next();
final String href = ss.getHref();
if (href != null && href.length() > 0)
orgss.add(ss.getMedia() != null ? ss: (Object)href); //we don't support getContent
}
final String[] hrefs = config.getThemeURIs();
for (int j = 0; j < hrefs.length; ++j)
orgss.add(hrefs[j]);
sses.clear();
final Collection res = themeProvider.getThemeURIs(exec, orgss);
if (res != null) {
for (Iterator it = res.iterator(); it.hasNext();) {
final Object re = it.next();
sses.add(re instanceof StyleSheet ? (StyleSheet)re:
new StyleSheet((String)re, "text/css"));
}
}
} else {
final String[] hrefs = config.getThemeURIs();
for (int j = 0; j < hrefs.length; ++j)
sses.add(new StyleSheet(hrefs[j], "text/css"));
}
return sses;
}