diff options
| author | Eric Moffatt | 2013-07-30 17:35:25 +0000 |
|---|---|---|
| committer | Paul Webster | 2013-07-30 18:44:04 +0000 |
| commit | 7dd0dc90c7f594c44ccc0255baf2df3b700131e3 (patch) | |
| tree | 0e71dd93f3e29d5c89493b9542543cb46dfb6186 | |
| parent | 59d2e9cb28f973f8167e535ee29c70b258ec6e83 (diff) | |
| download | eclipse.platform.ui-7dd0dc90c7f594c44ccc0255baf2df3b700131e3.tar.gz eclipse.platform.ui-7dd0dc90c7f594c44ccc0255baf2df3b700131e3.tar.xz eclipse.platform.ui-7dd0dc90c7f594c44ccc0255baf2df3b700131e3.zip | |
Fix for Bug 409324 - Editors Ping Pong once the Outline View has been
activated
| -rw-r--r-- | bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/PageBookView.java | 37 | ||||
| -rw-r--r-- | bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/PageSite.java | 7 |
2 files changed, 29 insertions, 15 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/PageBookView.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/PageBookView.java index 89cb1e86afd..f5d3b9a7f01 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/PageBookView.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/PageBookView.java @@ -17,6 +17,7 @@ import java.util.Map; import java.util.Set; import org.eclipse.core.commands.common.EventManager; import org.eclipse.core.runtime.Platform; +import org.eclipse.e4.core.contexts.IEclipseContext; import org.eclipse.e4.ui.model.application.ui.basic.MPart; import org.eclipse.e4.ui.workbench.modeling.ESelectionService; import org.eclipse.jface.action.IAction; @@ -743,22 +744,32 @@ public abstract class PageBookView extends ViewPart implements IPartListener { */ public void partActivated(IWorkbenchPart part) { // Is this an important part? If not just return. - if (!isImportant(part)) { - return; - } - hiddenPart = null; + if (isImportant(part)) { + hiddenPart = null; - // Create a page for the part. - PageRec rec = getPageRec(part); - if (rec == null) { - rec = createPage(part); + // Create a page for the part. + PageRec rec = getPageRec(part); + if (rec == null) { + rec = createPage(part); + } + + // Show the page. + if (rec != null) { + showPageRec(rec); + } else { + showPageRec(defaultPageRec); + } } - // Show the page. - if (rec != null) { - showPageRec(rec); - } else { - showPageRec(defaultPageRec); + // If *we* are activating then activate the context + if (part == this) { + PageSite pageSite = getPageSite(getCurrentPage()); + if (pageSite != null) { + IEclipseContext pageContext = pageSite.getSiteContext(); + if (pageContext != null) { + pageContext.activate(); + } + } } } diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/PageSite.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/PageSite.java index ddeeb980667..dd4b169aac4 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/PageSite.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/part/PageSite.java @@ -251,6 +251,10 @@ public class PageSite implements IPageSite, INestable { selectionProvider = provider; } + /* Package */IEclipseContext getSiteContext() { + return e4Context; + } + /* * (non-Javadoc) * @@ -260,7 +264,7 @@ public class PageSite implements IPageSite, INestable { */ public void activate() { active = true; - e4Context.activate(); + serviceLocator.activate(); if (contextService != null) { @@ -282,6 +286,5 @@ public class PageSite implements IPageSite, INestable { } serviceLocator.deactivate(); - e4Context.deactivate(); } } |
