@Override public Set<String> nameSet(Theme.Type type) { Set<String> themes = new HashSet<String>(); for (ThemeProvider p : getProviders()) { themes.addAll(p.nameSet(type)); } return themes; }
@Override public boolean hasTheme(String name, Theme.Type type) { for (ThemeProvider p : getProviders()) { if (p.hasTheme(name, type)) { return true; } } return false; }
private Theme findTheme(String name, Theme.Type type) { for (ThemeProvider p : getProviders()) { if (p.hasTheme(name, type)) { try { return p.getTheme(name, type); } catch (IOException e) { log.errorv(e, p.getClass() + " failed to load theme, type={0}, name={1}", type, name); } } } return null; }
private List<ThemeProvider> getProviders() { if (providers == null) { providers = new LinkedList(); for (ThemeProvider p : session.getAllProviders(ThemeProvider.class)) { if (!(p instanceof ExtendingThemeManager)) { if (!p.getClass().equals(ExtendingThemeManager.class)) { providers.add(p); } } } Collections.sort( providers, new Comparator<ThemeProvider>() { @Override public int compare(ThemeProvider o1, ThemeProvider o2) { return o2.getProviderPriority() - o1.getProviderPriority(); } }); } return providers; }