X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms.ui%2Fsrc%2Forg%2Fargeo%2Fcms%2Fweb%2FMinimalWebApp.java;h=188391c42e68d4b736d444fc88e374a06d142946;hb=1233dcea2383bfe5c83e5ec33d0c502afff22601;hp=fe8b20c92097286b31e9dc63986ac50502f7dbbb;hpb=28eae1d74809cb8752ab72219063e822e264c77d;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.cms.ui/src/org/argeo/cms/web/MinimalWebApp.java b/org.argeo.cms.ui/src/org/argeo/cms/web/MinimalWebApp.java index fe8b20c92..188391c42 100644 --- a/org.argeo.cms.ui/src/org/argeo/cms/web/MinimalWebApp.java +++ b/org.argeo.cms.ui/src/org/argeo/cms/web/MinimalWebApp.java @@ -1,11 +1,11 @@ package org.argeo.cms.web; -import static org.argeo.cms.ui.util.CmsTheme.CMS_THEME_BUNDLE_PROPERTY; +import static org.argeo.cms.ui.util.BundleCmsTheme.CMS_THEME_BUNDLE_PROPERTY; import java.util.HashMap; import java.util.Map; -import org.argeo.cms.ui.util.CmsTheme; +import org.argeo.cms.ui.util.BundleCmsTheme; import org.eclipse.rap.rwt.RWT; import org.eclipse.rap.rwt.application.Application; import org.eclipse.rap.rwt.application.ApplicationConfiguration; @@ -15,12 +15,12 @@ import org.osgi.framework.BundleContext; /** Lightweight web app using only RWT and not the whole Eclipse platform. */ public class MinimalWebApp implements ApplicationConfiguration { - private CmsTheme theme; + private BundleCmsTheme theme; public void init(BundleContext bundleContext, Map properties) { if (properties.containsKey(CMS_THEME_BUNDLE_PROPERTY)) { String cmsThemeBundle = properties.get(CMS_THEME_BUNDLE_PROPERTY).toString(); - theme = new CmsTheme(bundleContext, cmsThemeBundle); + theme = new BundleCmsTheme(bundleContext, cmsThemeBundle); } } @@ -36,16 +36,21 @@ public class MinimalWebApp implements ApplicationConfiguration { @Override public void configure(Application application) { if (theme != null) - theme.apply(application); + WebThemeUtils.apply(application, theme); Map properties = new HashMap<>(); if (theme != null) { properties.put(WebClient.THEME_ID, theme.getThemeId()); - properties.put(WebClient.HEAD_HTML, theme.getAdditionalHeaders()); + properties.put(WebClient.HEAD_HTML, theme.getHtmlHeaders()); } else { properties.put(WebClient.THEME_ID, RWT.DEFAULT_THEME_ID); } addEntryPoints(application, properties); } + + public void setTheme(BundleCmsTheme theme) { + this.theme = theme; + } + }