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;
public class Theme {
private final static Log log = LogFactory.getLog(Theme.class);
- private final String themeId;
+ private String themeId;
private Map<String, ResourceLoader> css = new HashMap<>();
private Map<String, ResourceLoader> resources = new HashMap<>();
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");
}
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);
}
for (String name : css.keySet()) {
application.addStyleSheet(themeId, name, css.get(name));
+ if (log.isDebugEnabled())
+ log.debug("Added RAP CSS " + name);
}
}
return themeId;
}
+ public void setThemeId(String themeId) {
+ this.themeId = themeId;
+ }
+
public String getBasePath() {
return basePath;
}