1 package org
.argeo
.cms
.web
;
3 import static org
.argeo
.cms
.osgi
.BundleCmsTheme
.CMS_THEME_BUNDLE_PROPERTY
;
5 import java
.util
.HashMap
;
8 import org
.argeo
.cms
.osgi
.BundleCmsTheme
;
9 import org
.eclipse
.rap
.rwt
.RWT
;
10 import org
.eclipse
.rap
.rwt
.application
.Application
;
11 import org
.eclipse
.rap
.rwt
.application
.ApplicationConfiguration
;
12 import org
.eclipse
.rap
.rwt
.client
.WebClient
;
13 import org
.osgi
.framework
.BundleContext
;
15 /** Lightweight web app using only RWT and not the whole Eclipse platform. */
16 public class MinimalWebApp
implements ApplicationConfiguration
{
18 private BundleCmsTheme theme
;
20 public void init(BundleContext bundleContext
, Map
<String
, Object
> properties
) {
21 if (properties
.containsKey(CMS_THEME_BUNDLE_PROPERTY
)) {
22 String cmsThemeBundle
= properties
.get(CMS_THEME_BUNDLE_PROPERTY
).toString();
23 theme
= new BundleCmsTheme(bundleContext
, cmsThemeBundle
);
27 public void destroy() {
31 /** To be overridden. Does nothing by default. */
32 protected void addEntryPoints(Application application
, Map
<String
, String
> properties
) {
37 public void configure(Application application
) {
39 WebThemeUtils
.apply(application
, theme
);
41 Map
<String
, String
> properties
= new HashMap
<>();
43 properties
.put(WebClient
.THEME_ID
, theme
.getThemeId());
44 properties
.put(WebClient
.HEAD_HTML
, theme
.getHtmlHeaders());
46 properties
.put(WebClient
.THEME_ID
, RWT
.DEFAULT_THEME_ID
);
48 addEntryPoints(application
, properties
);
52 public void setTheme(BundleCmsTheme theme
) {