import org.eclipse.rap.rwt.client.WebClient;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.event.EventAdmin;
/** An RWT web app integrating with a {@link CmsApp}. */
public class CmsWebApp implements ApplicationConfiguration, CmsAppListener {
private BundleContext bundleContext;
private CmsApp cmsApp;
+ private EventAdmin eventAdmin;
private ServiceRegistration<ApplicationConfiguration> rwtAppReg;
public void init(BundleContext bundleContext, Map<String, String> properties) {
this.bundleContext = bundleContext;
contextName = properties.get(CONTEXT_NAME);
+ if (cmsApp != null)
+ themingUpdated();
// registerIfAllThemesAvailable();
}
public void destroy(BundleContext bundleContext, Map<String, String> properties) {
-
+ if (cmsApp != null)
+ cmsApp.removeCmsAppListener(this);
}
@Override
// log.warn("Theme id " + themeId + " was specified but it was not found, using default RWT theme.");
}
application.addEntryPoint("/" + uiName, () -> {
- return new CmsWebEntryPoint(this, uiName);
+ CmsWebEntryPoint entryPoint = new CmsWebEntryPoint(this, uiName);
+ entryPoint.setEventAdmin(eventAdmin);
+ return entryPoint;
}, properties);
if (log.isDebugEnabled())
log.info("Added web entry point /" + (contextName != null ? contextName : "") + "/" + uiName);
}
}
+ public void setEventAdmin(EventAdmin eventAdmin) {
+ this.eventAdmin = eventAdmin;
+ }
+
}