Theme[] userThemes = new Theme[0];
if (themeCol != null) {
gsThemes = new Theme[themeCol.getChildCount()];
for (int i = 0; i < themeCol.getChildCount(); i++) {
Theme theme = new Theme();
if (themeRegistry.resourceExists(themeCol.getChildren()[i]) && themeRegistry.resourceExists(themeCol.getChildren()[i] + ThemeConstants.THEME_CONF_PATH)) {
Resource themeConf = themeRegistry.get(themeCol.getChildren()[i] + ThemeConstants.THEME_CONF_PATH);
if (themeRegistry.resourceExists(themeCol.getChildren()[i] + "/" + themeConf.getProperty(ThemeConstants.PROP_CSS))) {
String cssPath = themeRegistry.get(themeCol.getChildren()[i] + "/" + themeConf.getProperty(ThemeConstants.PROP_CSS)).getPath();
theme.setCssUrl(cssPath);
}
if (themeRegistry.resourceExists(themeCol.getChildren()[i] + "/" + themeConf.getProperty(ThemeConstants.PROP_THUMB))) {
String thumbPath = themeRegistry.get(themeCol.getChildren()[i] + "/" + themeConf.getProperty(ThemeConstants.PROP_THUMB)).getPath();
theme.setThumbUrl(thumbPath);
}
theme.setThemeName(themeConf.getProperty(ThemeConstants.PROP_NAME));
theme.setThemeAuthor(themeConf.getProperty(ThemeConstants.PROP_AUTHOR));
theme.setThemeDesc(themeConf.getProperty(ThemeConstants.PROP_DESC));
}
gsThemes[i] = theme;
}
}
if (userThemeCol != null) {
userThemes = new Theme[userThemeCol.getChildCount()];
for (int i = 0; i < userThemeCol.getChildCount(); i++) {
Theme theme = new Theme();
if (themeRegistry.resourceExists(userThemeCol.getChildren()[i]) && themeRegistry.resourceExists(userThemeCol.getChildren()[i] + ThemeConstants.THEME_CONF_PATH)) {
Resource themeConf = themeRegistry.get(userThemeCol.getChildren()[i] + ThemeConstants.THEME_CONF_PATH);
if (themeRegistry.resourceExists(userThemeCol.getChildren()[i] + "/" + themeConf.getProperty(ThemeConstants.PROP_CSS))) {
String cssPath = themeRegistry.get(userThemeCol.getChildren()[i] + "/" + themeConf.getProperty(ThemeConstants.PROP_CSS)).getPath();
theme.setCssUrl(cssPath);
}
if (themeRegistry.resourceExists(userThemeCol.getChildren()[i] + "/" + themeConf.getProperty(ThemeConstants.PROP_THUMB))) {
String thumbPath = themeRegistry.get(userThemeCol.getChildren()[i] + "/" + themeConf.getProperty(ThemeConstants.PROP_THUMB)).getPath();
theme.setThumbUrl(thumbPath);
}
theme.setThemeName(themeConf.getProperty(ThemeConstants.PROP_NAME));
theme.setThemeAuthor(themeConf.getProperty(ThemeConstants.PROP_AUTHOR));
theme.setThemeDesc(themeConf.getProperty(ThemeConstants.PROP_DESC));
}
userThemes[i] = theme;
}
}