diff options
author | Eric Moffatt | 2013-07-30 17:35:25 +0000 |
---|---|---|
committer | Eric Moffatt | 2013-07-30 17:35:25 +0000 |
commit | 13205bd57a0909261cf0b2fd19cd631fe9531999 (patch) | |
tree | 2a02bfbf5316c7b402822459d905c4e87371b8c1 | |
parent | cf9629c20e7bb42834c0852155226ff2dc572b4a (diff) | |
download | eclipse.platform.ui-13205bd57a0909261cf0b2fd19cd631fe9531999.tar.gz eclipse.platform.ui-13205bd57a0909261cf0b2fd19cd631fe9531999.tar.xz eclipse.platform.ui-13205bd57a0909261cf0b2fd19cd631fe9531999.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(); } } |