if ( rootThemeFolder == null ) {
return;
}
// Things look good. Build-up theme information for this plugin.
ModuleThemeInfo moduleThemeInfo = new ModuleThemeInfo( pluginId );
List<Element> pluginNodes = pluginManifest.getRootElement().elements();
for ( Element themeNode : pluginNodes ) {
String themeId = themeNode.getName();
String themeName = StringUtils.defaultIfEmpty( themeNode.attributeValue( "display-name" ), themeId );
if ( themeName.startsWith( "${" ) && resourceBundle != null ) {
themeName = resourceBundle.getString( themeName );
}
Theme theme = new Theme( themeId, themeName, pluginId + "/" + rootThemeFolder + "/" + themeId + "/" );
theme.setHidden( "true".equals( themeNode.attributeValue( "hidden" ) ) );
if ( "true".equals( themeNode.attributeValue( "system" ) ) ) {
moduleThemeInfo.getSystemThemes().add( theme );
} else {
moduleThemeInfo.getModuleThemes().add( theme );
}
List<Element> resourceList = themeNode.elements();
for ( Element res : resourceList ) {
theme.addResource( new ThemeResource( theme, res.getText() ) );