aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2014-05-09 05:57:39 (EDT)
committerTom Schindl2014-05-09 05:57:39 (EDT)
commite827a4415c2d09dc845dd984d77a2dfb79785ac2 (patch)
tree9f500d29a14a1855e5e95b83a19345004527c9eb
parentd9049e285f2a3e0fe24ac790e949d84999b715d7 (diff)
downloadorg.eclipse.rap.incubator.e4-e827a4415c2d09dc845dd984d77a2dfb79785ac2.zip
org.eclipse.rap.incubator.e4-e827a4415c2d09dc845dd984d77a2dfb79785ac2.tar.gz
org.eclipse.rap.incubator.e4-e827a4415c2d09dc845dd984d77a2dfb79785ac2.tar.bz2
Bug 434481 - [e4] Allow PostContextCreate to return a boolean to stop
the start up
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java13
-rw-r--r--bundles/org.eclipse.rap.e4/src/org/eclipse/rap/e4/E4ApplicationConfig.java8
-rw-r--r--demo/org.eclipse.rap.e4.demo/META-INF/MANIFEST.MF3
-rw-r--r--demo/org.eclipse.rap.e4.demo/src/org/eclipse/rap/e4/demo/BasicApplication.java7
4 files changed, 27 insertions, 4 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java b/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java
index 96f8474..86c3c90 100644
--- a/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java
+++ b/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java
@@ -148,6 +148,10 @@ public class E4Application implements IApplication {
try {
E4Workbench workbench = createE4Workbench(applicationContext,
display);
+ if (workbench == null) {
+ display.dispose();
+ return EXIT_OK;
+ }
instanceLocation = (Location) workbench.getContext().get(
E4Workbench.INSTANCE_LOCATION);
@@ -238,8 +242,13 @@ public class E4Application implements IApplication {
lcManager = factory.create(lifeCycleURI, appContext);
if (lcManager != null) {
// Let the manager manipulate the appContext if desired
- ContextInjectionFactory.invoke(lcManager,
- PostContextCreate.class, appContext, null);
+ Object state = ContextInjectionFactory.invoke(lcManager,
+ PostContextCreate.class, appContext, Boolean.TRUE);
+ if (state != null && state instanceof Boolean) {
+ if (!((Boolean) state).booleanValue()) {
+ return null;
+ }
+ }
}
}
diff --git a/bundles/org.eclipse.rap.e4/src/org/eclipse/rap/e4/E4ApplicationConfig.java b/bundles/org.eclipse.rap.e4/src/org/eclipse/rap/e4/E4ApplicationConfig.java
index 0a5ca15..838c6f7 100644
--- a/bundles/org.eclipse.rap.e4/src/org/eclipse/rap/e4/E4ApplicationConfig.java
+++ b/bundles/org.eclipse.rap.e4/src/org/eclipse/rap/e4/E4ApplicationConfig.java
@@ -45,7 +45,15 @@ public class E4ApplicationConfig {
return new E4ApplicationConfig(xmiURI, null, null, true, false, true);
}
+ public static E4ApplicationConfig create(String xmiURI, String lifecycleURI) {
+ return new E4ApplicationConfig(xmiURI, lifecycleURI, null, true, false, true);
+ }
+
public static E4ApplicationConfig create(String xmiURI, boolean defaultPush) {
return new E4ApplicationConfig(xmiURI, null, null, true, false, true);
}
+
+ public static E4ApplicationConfig create(String xmiURI, String lifecycleURI, boolean defaultPush) {
+ return new E4ApplicationConfig(xmiURI, lifecycleURI, null, true, false, true);
+ }
}
diff --git a/demo/org.eclipse.rap.e4.demo/META-INF/MANIFEST.MF b/demo/org.eclipse.rap.e4.demo/META-INF/MANIFEST.MF
index 29e0efa..4146b17 100644
--- a/demo/org.eclipse.rap.e4.demo/META-INF/MANIFEST.MF
+++ b/demo/org.eclipse.rap.e4.demo/META-INF/MANIFEST.MF
@@ -10,7 +10,8 @@ Require-Bundle: org.eclipse.rap.rwt;bundle-version="[2.0.0,3.0.0)",
org.eclipse.rap.jface,
org.eclipse.e4.core.services,
org.eclipse.e4.ui.di,
- org.eclipse.equinox.common
+ org.eclipse.equinox.common,
+ org.eclipse.e4.ui.workbench;bundle-version="1.1.0"
Service-Component: OSGI-INF/contribution.xml
Import-Package: javax.annotation;version="1.2.0",
javax.inject;version="1.0.0"
diff --git a/demo/org.eclipse.rap.e4.demo/src/org/eclipse/rap/e4/demo/BasicApplication.java b/demo/org.eclipse.rap.e4.demo/src/org/eclipse/rap/e4/demo/BasicApplication.java
index 3d63fb9..65ab492 100644
--- a/demo/org.eclipse.rap.e4.demo/src/org/eclipse/rap/e4/demo/BasicApplication.java
+++ b/demo/org.eclipse.rap.e4.demo/src/org/eclipse/rap/e4/demo/BasicApplication.java
@@ -16,7 +16,12 @@ public class BasicApplication implements ApplicationConfiguration {
public void configure(Application application) {
Map<String, String> properties = new HashMap<String, String>();
properties.put(WebClient.PAGE_TITLE, "Hello e4 RAP");
- application.addEntryPoint("/hello", new E4EntryPointFactory(E4ApplicationConfig.create("platform:/plugin/org.eclipse.rap.e4.demo/Application.e4xmi")), properties);
+ application.addEntryPoint("/hello", new E4EntryPointFactory(
+ E4ApplicationConfig.create(
+ "platform:/plugin/org.eclipse.rap.e4.demo/Application.e4xmi",
+ "bundleclass://org.eclipse.rap.e4.demo/org.eclipse.rap.e4.demo.lifecycle.LoginLifcecycle"
+ )
+ ), properties);
application.setOperationMode( OperationMode.SWT_COMPATIBILITY );
}