summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-12-14 04:09:29 (EST)
committer Stephan Born2013-01-25 12:35:59 (EST)
commit09ac4e72edd909b5e8dac00f42a90f9dcb56acc1 (patch)
treeeb6b1e6b722881e23de0b2edb8dd79c4788a1271
parent733f461da1c02e48842a0c13b4c7fac2922adef1 (diff)
downloadorg.eclipse.stardust.ui.web-09ac4e72edd909b5e8dac00f42a90f9dcb56acc1.zip
org.eclipse.stardust.ui.web-09ac4e72edd909b5e8dac00f42a90f9dcb56acc1.tar.gz
org.eclipse.stardust.ui.web-09ac4e72edd909b5e8dac00f42a90f9dcb56acc1.tar.bz2
Jira-ID: CRNT-27121
Added javadoc and formatted some code in IppThemeProvider git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@61577 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/spi/theme/impl/IppThemeProvider.java32
1 files changed, 19 insertions, 13 deletions
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/spi/theme/impl/IppThemeProvider.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/spi/theme/impl/IppThemeProvider.java
index d4195cb..2953fdf 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/spi/theme/impl/IppThemeProvider.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/common/spi/theme/impl/IppThemeProvider.java
@@ -79,10 +79,10 @@ public class IppThemeProvider implements ThemeProvider
"views.configurationPanel.skins.defaultSkin")));
Set<Theme> availableThemesSet = CollectionUtils.newHashSet();
-
+ // Themes name should be unique on UI, so maintaining a set
availableThemesSet.addAll(bootstrapThemes());
availableThemesSet.addAll(bootstrapPluginThemes());
-
+
availableThemes.addAll(availableThemesSet);
loginStyleSheet = Parameters.instance().getString(LoginDialogBean.LOGIN_SKIN_CSS_PARAM,
@@ -146,19 +146,21 @@ public class IppThemeProvider implements ThemeProvider
{
skinFolder = wrapForFetchingChildren(skinFolder);
- @SuppressWarnings("unchecked")
- List<Document> documents = skinFolder.getDocuments();
- for (Document skinFile : documents)
+ if(null !=skinFolder)
{
- if (skinFile.getName().toLowerCase().endsWith(".css")
- && !loginStyleSheet.equals(skinFile.getName()))
+ @SuppressWarnings("unchecked")
+ List<Document> documents = skinFolder.getDocuments();
+ for (Document skinFile : documents)
{
- String path = skinFile.getPath();
- path = path.replace(skinRoot.getPath() + "/", "");
- jcrStyleSheets.add(THEME_SERVLET_PATH + path);
- }
+ if (skinFile.getName().toLowerCase().endsWith(".css")
+ && !loginStyleSheet.equals(skinFile.getName()))
+ {
+ String path = skinFile.getPath();
+ path = path.replace(skinRoot.getPath() + "/", "");
+ jcrStyleSheets.add(THEME_SERVLET_PATH + path);
+ }
+ }
}
-
break;
}
}
@@ -168,7 +170,8 @@ public class IppThemeProvider implements ThemeProvider
}
/**
- *
+ * When folderId is in pattern <plugin-id>/public/skins/<skinId>, Plugin skins are
+ * loader ex. <views-common/public/skins/red>
*/
private void loadPluginThemeStyleSheets()
{
@@ -187,6 +190,9 @@ public class IppThemeProvider implements ThemeProvider
{
if (skinFile.toLowerCase().endsWith(".css") && !loginStyleSheet.equals(skinFile))
{
+ // path : a string concat of plugin-root (/plugin) + folderId +
+ // skinFile(say camino.css) ex:
+ // "/plugin/views-common/public/skins/red/camino.css"
String path = Constants.PLUGIN_ROOT_FOLDER_PATH + skinFolderId + "/"
+ skinFile.substring(skinFile.lastIndexOf("\\") + 1);
pluginStyleSheets.add(path);