X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms.ui%2Fsrc%2Forg%2Fargeo%2Fcms%2Fscript%2FTheme.java;h=a3dce2f57e58fd9e86c6a5a7df40920915dd3f10;hb=4235aef922df6cc651d65f6668a8b0fa800f4e49;hp=3fa4bc451edae6b324603c5a0dadf5840a1e6bbe;hpb=088c1b517a543e935d8ab65c3b2fd2d0269b551d;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 3fa4bc451..a3dce2f57 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"); @@ -80,7 +81,9 @@ public class Theme { } public void apply(Application application) { - for (String name : resources.keySet()) { + resources: for (String name : resources.keySet()) { + if (name.startsWith("target/")) + continue resources; // skip maven output application.addResource(name, resources.get(name)); if (log.isDebugEnabled()) log.debug("Added resource " + name); @@ -165,6 +168,10 @@ public class Theme { return themeId; } + public void setThemeId(String themeId) { + this.themeId = themeId; + } + public String getBasePath() { return basePath; }