]> git.argeo.org Git - gpl/argeo-suite.git/blob - org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/ArgeoOfficeRapE4App.java
Merge branch 'master' of https://mbaudier@code.argeo.org/git/gpl/argeo-suite.git
[gpl/argeo-suite.git] / org.argeo.suite.e4.rap / src / org / argeo / suite / e4 / rap / ArgeoOfficeRapE4App.java
1 package org.argeo.suite.e4.rap;
2
3 import java.util.Map;
4
5 import org.argeo.cms.e4.rap.AbstractRapE4App;
6 import org.argeo.cms.util.BundleResourceLoader;
7 import org.eclipse.rap.e4.E4ApplicationConfig;
8 import org.eclipse.rap.rwt.RWT;
9 import org.eclipse.rap.rwt.application.Application;
10 import org.eclipse.rap.rwt.client.WebClient;
11 import org.osgi.framework.Bundle;
12 import org.osgi.framework.BundleContext;
13 import org.osgi.framework.FrameworkUtil;
14
15 public class ArgeoOfficeRapE4App extends AbstractRapE4App {
16 private BundleContext bc = FrameworkUtil.getBundle(getClass()).getBundleContext();
17
18 public ArgeoOfficeRapE4App() {
19 setPageTitle("Argeo Office");
20 setE4Xmi("org.argeo.suite.e4/e4xmi/argeo-office.e4xmi");
21 setPath("/office");
22 setLifeCycleUri("bundleclass://org.argeo.suite.e4.rap/org.argeo.suite.e4.rap.ArgeoSuiteLoginLifecycle");
23 }
24
25 @Override
26 protected void addEntryPoint(Application application, E4ApplicationConfig config, Map<String, String> properties) {
27 // String theme ="org.argeo.theme.argeo2.office";
28 String theme = RWT.DEFAULT_THEME_ID;
29 Bundle themeBundle = findTheme("org.argeo.theme.argeo2");
30 // application.addStyleSheet(theme, "rap/office-rwt.css", new
31 // BundleResourceLoader(themeBundle));
32 application.addStyleSheet(theme, "rap/office.css", new BundleResourceLoader(themeBundle));
33 properties.put(WebClient.THEME_ID, theme);
34 String font = "<link rel='stylesheet' href='http://fonts.googleapis.com/css?family=Source+Sans+Pro'/>";
35 properties.put(WebClient.HEAD_HTML, font);
36 super.addEntryPoint(application, config, properties);
37 }
38
39 Bundle findTheme(String symbolicName) {
40 for (Bundle b : bc.getBundles())
41 if (symbolicName.equals(b.getSymbolicName()))
42 return b;
43 throw new RuntimeException("Theme bundle " + symbolicName + " not found");
44 }
45 }