Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2012-03-09 10:14:06 -0500
committerTom Schindl2012-03-09 10:14:06 -0500
commit7ce84a7ae5c1f58ddf9736f6528cc1bf59a08714 (patch)
tree9aa54f1d1e54453d5fb22f9843283658231b1362
parentf8a49eee19065a5ed43abe7aa104cae32980a6ca (diff)
downloadorg.eclipse.e4.tools-7ce84a7ae5c1f58ddf9736f6528cc1bf59a08714.tar.gz
org.eclipse.e4.tools-7ce84a7ae5c1f58ddf9736f6528cc1bf59a08714.tar.xz
org.eclipse.e4.tools-7ce84a7ae5c1f58ddf9736f6528cc1bf59a08714.zip
[Bug 373476] [Bridge] No UISynchronizer installed into root context
-rw-r--r--bundles/org.eclipse.e4.tools.compat/src/org/eclipse/e4/tools/compat/internal/ContextServiceFactory.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/bundles/org.eclipse.e4.tools.compat/src/org/eclipse/e4/tools/compat/internal/ContextServiceFactory.java b/bundles/org.eclipse.e4.tools.compat/src/org/eclipse/e4/tools/compat/internal/ContextServiceFactory.java
index 8cf22228..f487fdef 100644
--- a/bundles/org.eclipse.e4.tools.compat/src/org/eclipse/e4/tools/compat/internal/ContextServiceFactory.java
+++ b/bundles/org.eclipse.e4.tools.compat/src/org/eclipse/e4/tools/compat/internal/ContextServiceFactory.java
@@ -20,6 +20,7 @@ import org.eclipse.e4.core.services.log.Logger;
import org.eclipse.e4.tools.services.IClipboardService;
import org.eclipse.e4.ui.css.swt.theme.IThemeEngine;
import org.eclipse.e4.ui.css.swt.theme.IThemeManager;
+import org.eclipse.e4.ui.di.UISynchronize;
import org.eclipse.e4.ui.services.IServiceConstants;
import org.eclipse.e4.ui.services.IStylingEngine;
import org.eclipse.jface.viewers.ISelection;
@@ -63,11 +64,27 @@ public class ContextServiceFactory extends AbstractServiceFactory {
BundleContext bundleContext = bundle.getBundleContext();
IEclipseContext serviceContext = EclipseContextFactory.getServiceContext(bundleContext);
+
final IEclipseContext appContext = serviceContext.createChild("WorkbenchContext"); //$NON-NLS-1$
appContext.set(Display.class, Display.getCurrent());
appContext.set(Logger.class, new WorkbenchLogger());
appContext.set(IClipboardService.class, new ClipboardServiceImpl());
appContext.set(Realm.class, Realm.getDefault());
+
+ final Display d = Display.getCurrent();
+ appContext.set(UISynchronize.class, new UISynchronize() {
+
+ @Override
+ public void syncExec(Runnable runnable) {
+ d.syncExec(runnable);
+ }
+
+ @Override
+ public void asyncExec(Runnable runnable) {
+ d.asyncExec(runnable);
+ }
+ });
+
IContributionFactory contributionFactory = ContextInjectionFactory.make(ReflectionContributionFactory.class, appContext);
appContext.set(IContributionFactory.class.getName(),contributionFactory);

Back to the top