diff options
author | Ralf Mollik | 2019-01-30 12:30:08 +0000 |
---|---|---|
committer | Ralf Mollik | 2019-01-30 12:30:08 +0000 |
commit | 4234ccde3b8839dcd3e898c077910f8f02a7f9ca (patch) | |
tree | 455ec78e8ac467d66f1304012ed25ceae0ae4cdf | |
parent | 467cc137662f7cb90e5c42eb2906b797ed2b95e0 (diff) | |
download | org.eclipse.osbp.vaaclipse.addons-4234ccde3b8839dcd3e898c077910f8f02a7f9ca.tar.gz org.eclipse.osbp.vaaclipse.addons-4234ccde3b8839dcd3e898c077910f8f02a7f9ca.tar.xz org.eclipse.osbp.vaaclipse.addons-4234ccde3b8839dcd3e898c077910f8f02a7f9ca.zip |
catch up with branch daily
Signed-off-by: Ralf Mollik <ramollik@compex-commerce.com>
4 files changed, 35 insertions, 5 deletions
diff --git a/org.eclipse.osbp.vaaclipse.addons.common/META-INF/MANIFEST.MF b/org.eclipse.osbp.vaaclipse.addons.common/META-INF/MANIFEST.MF index d337e73..667c7a2 100644 --- a/org.eclipse.osbp.vaaclipse.addons.common/META-INF/MANIFEST.MF +++ b/org.eclipse.osbp.vaaclipse.addons.common/META-INF/MANIFEST.MF @@ -7,6 +7,7 @@ Bundle-Version: 0.9.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: javax.annotation, javax.inject, + org.eclipse.osbp.ui.api.e4;version="0.9.0", org.eclipse.osgi.util;version="[1.1.0,1.2.0)", org.osgi.framework;version="1.8.0", org.osgi.service.component.annotations;version="1.2.0", diff --git a/org.eclipse.osbp.vaaclipse.addons.common/OSGI-INF/org.eclipse.osbp.vaaclipse.addons.common.selection.ESelectionServiceFactory.xml b/org.eclipse.osbp.vaaclipse.addons.common/OSGI-INF/org.eclipse.osbp.vaaclipse.addons.common.selection.ESelectionServiceFactory.xml new file mode 100644 index 0000000..f3d800a --- /dev/null +++ b/org.eclipse.osbp.vaaclipse.addons.common/OSGI-INF/org.eclipse.osbp.vaaclipse.addons.common.selection.ESelectionServiceFactory.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.osbp.vaaclipse.addons.common.selection.ESelectionServiceFactory"> + <property name="service.context.key" value="org.eclipse.e4.ui.workbench.modeling.ESelectionService"/> + <service> + <provide interface="org.eclipse.e4.core.contexts.IContextFunction"/> + </service> + <implementation class="org.eclipse.osbp.vaaclipse.addons.common.selection.ESelectionServiceFactory"/> +</scr:component>
\ No newline at end of file diff --git a/org.eclipse.osbp.vaaclipse.addons.common/src/org/eclipse/osbp/vaaclipse/addons/common/selection/ESelectionServiceFactory.java b/org.eclipse.osbp.vaaclipse.addons.common/src/org/eclipse/osbp/vaaclipse/addons/common/selection/ESelectionServiceFactory.java new file mode 100644 index 0000000..63ff888 --- /dev/null +++ b/org.eclipse.osbp.vaaclipse.addons.common/src/org/eclipse/osbp/vaaclipse/addons/common/selection/ESelectionServiceFactory.java @@ -0,0 +1,18 @@ +package org.eclipse.osbp.vaaclipse.addons.common.selection; + +import org.eclipse.e4.core.contexts.ContextFunction; +import org.eclipse.e4.core.contexts.ContextInjectionFactory; +import org.eclipse.e4.core.contexts.IEclipseContext; +import org.eclipse.e4.ui.internal.workbench.SelectionServiceImpl; +import org.eclipse.e4.ui.workbench.modeling.ESelectionService; +import org.osgi.service.component.annotations.Component; + +@Component(service = org.eclipse.e4.core.contexts.IContextFunction.class, property = { "service.context.key=org.eclipse.e4.ui.workbench.modeling.ESelectionService" }) +public class ESelectionServiceFactory extends ContextFunction { + @Override + public Object compute(IEclipseContext context, String contextKey) { + ESelectionService selectionService = ContextInjectionFactory.make(SelectionServiceImpl.class, context); + context.set(ESelectionService.class, selectionService); + return selectionService; + } +} diff --git a/org.eclipse.osbp.vaaclipse.addons.common/src/org/eclipse/osbp/vaaclipse/addons/common/status/StatusManager.java b/org.eclipse.osbp.vaaclipse.addons.common/src/org/eclipse/osbp/vaaclipse/addons/common/status/StatusManager.java index 53d697d..2f7a808 100644 --- a/org.eclipse.osbp.vaaclipse.addons.common/src/org/eclipse/osbp/vaaclipse/addons/common/status/StatusManager.java +++ b/org.eclipse.osbp.vaaclipse.addons.common/src/org/eclipse/osbp/vaaclipse/addons/common/status/StatusManager.java @@ -27,6 +27,7 @@ import org.eclipse.e4.core.services.events.IEventBroker; import org.eclipse.e4.ui.model.application.ui.basic.MPart; import org.eclipse.e4.ui.workbench.modeling.EPartService; import org.eclipse.osbp.runtime.common.validation.IStatus; +import org.eclipse.osbp.ui.api.e4.IE4Dialog; import org.eclipse.osbp.vaaclipse.addons.common.api.IE4Topics; import org.eclipse.osbp.vaaclipse.addons.common.api.status.IStatusManager; import org.eclipse.osbp.vaaclipse.addons.common.api.status.IStatusScope; @@ -87,18 +88,20 @@ public class StatusManager implements IStatusManager { */ @Inject public void setActiveView(@Active @Optional MPart activePart) { - - this.activePart = activePart; if (activePart == null) { return; } + // allow dialogs only + IE4Dialog content = activePart.getContext().get(IE4Dialog.class); + if(content == null) { + return; + } + this.activePart = activePart; ensureScope(this.activePart); Map<String, Object> props = new HashMap<String, Object>(); props.put(IE4Topics.StatusManagerEvents.PROP_SCOPE, getActiveScope()); - eventBroker - .post(IE4Topics.StatusManagerEvents.ACTIVE_SCOPE_CHANGED_TOPIC, - props); + eventBroker.post(IE4Topics.StatusManagerEvents.ACTIVE_SCOPE_CHANGED_TOPIC, props); } /** |