X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms.ui%2Fsrc%2Forg%2Fargeo%2Fcms%2Fscript%2FTheme.java;h=c256a69209233bb9a07e4a6cca50f722c37ff2ae;hb=d2e617c3adda3874dd0fbc26ebe83f64814293c1;hp=2f1ed0efe7d44e02759caa8c499b3660c2f7c85d;hpb=743fc68ed576cb578a9cc6c59e1f423d29213be1;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.cms.ui/src/org/argeo/cms/script/Theme.java b/org.argeo.cms.ui/src/org/argeo/cms/script/Theme.java index 2f1ed0efe..c256a6920 100644 --- a/org.argeo.cms.ui/src/org/argeo/cms/script/Theme.java +++ b/org.argeo.cms.ui/src/org/argeo/cms/script/Theme.java @@ -18,6 +18,7 @@ import org.apache.commons.logging.LogFactory; import org.argeo.cms.CmsException; import org.argeo.cms.util.BundleResourceLoader; import org.argeo.cms.util.ThemeUtils; +import org.eclipse.rap.rwt.RWT; import org.eclipse.rap.rwt.application.Application; import org.eclipse.rap.rwt.service.ResourceLoader; import org.osgi.framework.Bundle; @@ -26,7 +27,7 @@ import org.osgi.framework.BundleContext; public class Theme { private final static Log log = LogFactory.getLog(Theme.class); - private final String themeId; + private String themeId; private Map css = new HashMap<>(); private Map resources = new HashMap<>(); @@ -44,14 +45,14 @@ public class Theme { Bundle themeBundle; if (symbolicName == null) { themeBundle = bundleContext.getBundle(); - basePath = "/theme/internal/"; - cssPath = basePath; +// basePath = "/theme/"; +// cssPath = basePath; } else { themeBundle = ThemeUtils.findThemeBundle(bundleContext, symbolicName); - basePath = "/"; - cssPath = "/rap/"; } - this.themeId = themeBundle.getSymbolicName(); + basePath = "/"; + cssPath = "/rap/"; + this.themeId = RWT.DEFAULT_THEME_ID; addStyleSheets(themeBundle, new BundleResourceLoader(themeBundle)); BundleResourceLoader themeBRL = new BundleResourceLoader(themeBundle); addResources(themeBRL, "*.png"); @@ -82,9 +83,13 @@ public class Theme { public void apply(Application application) { for (String name : resources.keySet()) { application.addResource(name, resources.get(name)); + if (log.isDebugEnabled()) + log.debug("Added resource " + name); } for (String name : css.keySet()) { application.addStyleSheet(themeId, name, css.get(name)); + if (log.isDebugEnabled()) + log.debug("Added RAP CSS " + name); } } @@ -161,6 +166,10 @@ public class Theme { return themeId; } + public void setThemeId(String themeId) { + this.themeId = themeId; + } + public String getBasePath() { return basePath; }