diff options
| author | Eric Moffatt | 2014-02-14 20:02:24 +0000 |
|---|---|---|
| committer | Eric Moffatt | 2014-02-14 20:02:55 +0000 |
| commit | 6bfc82c165a59bea8039c9aa7ce6af39efcf8b83 (patch) | |
| tree | 45eb669694bb5956bd4ca8cf36cfd0a2da673ae1 | |
| parent | 22370370eee1852e2e537d2d6446d18e72ba88c2 (diff) | |
| download | eclipse.platform.ui-6bfc82c165a59bea8039c9aa7ce6af39efcf8b83.tar.gz eclipse.platform.ui-6bfc82c165a59bea8039c9aa7ce6af39efcf8b83.tar.xz eclipse.platform.ui-6bfc82c165a59bea8039c9aa7ce6af39efcf8b83.zip | |
Fix for Bug 423894 - [EditorMgmt][Split editor] Focus lost / commands
broken after splitting editor
2 files changed, 14 insertions, 11 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/splitteraddon/SplitHost.java b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/splitteraddon/SplitHost.java index dadc58a4cd9..15faef772a0 100644 --- a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/splitteraddon/SplitHost.java +++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/splitteraddon/SplitHost.java @@ -2,7 +2,6 @@ package org.eclipse.e4.ui.workbench.addons.splitteraddon; import java.util.List;
import javax.inject.Inject;
-import javax.inject.Named;
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
import org.eclipse.e4.core.di.annotations.Optional;
import org.eclipse.e4.ui.di.Focus;
@@ -13,7 +12,6 @@ import org.eclipse.e4.ui.model.application.ui.MElementContainer; import org.eclipse.e4.ui.model.application.ui.MUIElement;
import org.eclipse.e4.ui.model.application.ui.basic.MCompositePart;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
-import org.eclipse.e4.ui.services.IServiceConstants;
import org.eclipse.e4.ui.workbench.UIEvents;
import org.eclipse.e4.ui.workbench.modeling.EModelService;
import org.eclipse.e4.ui.workbench.modeling.EPartService;
@@ -85,15 +83,6 @@ public class SplitHost { return parentObj == myPart;
}
- @Inject
- void activePartChanged(@Named(IServiceConstants.ACTIVE_PART) MPart newPart) {
- if (newPart != null && newPart.getObject() == this) {
- MPart inner = findInnerActive((MCompositePart) newPart);
- if (inner != null && inner.getContext() != null)
- ps.activate(inner);
- }
- }
-
void callingAllParts(Class clz) {
List<MPart> parts = ms.findElements(myPart, null, MPart.class, null);
for (MPart part : parts) {
diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java index 1aaffd1583f..65fb1e302f9 100644 --- a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java +++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java @@ -39,6 +39,7 @@ import org.eclipse.e4.ui.model.application.ui.MUIElement; import org.eclipse.e4.ui.model.application.ui.advanced.MArea; import org.eclipse.e4.ui.model.application.ui.advanced.MPerspective; import org.eclipse.e4.ui.model.application.ui.advanced.MPlaceholder; +import org.eclipse.e4.ui.model.application.ui.basic.MCompositePart; import org.eclipse.e4.ui.model.application.ui.basic.MInputPart; import org.eclipse.e4.ui.model.application.ui.basic.MPart; import org.eclipse.e4.ui.model.application.ui.basic.MPartStack; @@ -600,6 +601,19 @@ public class PartServiceImpl implements EPartService { return; } + // Delegate activations to a CompositePart's inner part (if any) + if (part instanceof MCompositePart) { + if (part.getContext() != null) { + IEclipseContext pContext = part.getContext(); + if (pContext.getActiveLeaf() != null) { + MPart inner = pContext.getActiveLeaf().get(MPart.class); + if (inner != null) { + part = inner; + } + } + } + } + // only activate parts that is under our control if (!isInContainer(part)) { return; |
