summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorDaniel Rolka2013-08-01 06:55:00 (EDT)
committer Gerrit Code Review @ Eclipse.org2013-08-23 10:03:35 (EDT)
commita7eb676fb6acb5efcf292b051b5bd9684fd19e80 (patch)
tree889f40bff5ab07566e8626f1bb5f67bb0761a107
parent8244a877aba4786e0040155e7d56cea5c6072a88 (diff)
downloadeclipse.platform.ui-a7eb676fb6acb5efcf292b051b5bd9684fd19e80.zip
eclipse.platform.ui-a7eb676fb6acb5efcf292b051b5bd9684fd19e80.tar.gz
eclipse.platform.ui-a7eb676fb6acb5efcf292b051b5bd9684fd19e80.tar.bz2
Bug 395084 - IWorkbench.showPerspective(id, window) not working afterrefs/changes/68/14068/4
switching to 4.2.1 target Change-Id: I72548b611c3eeb9f913b98b0fc3317d56b37ff3e Signed-off-by: Daniel Rolka <daniel.rolka@pl.ibm.com>
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java15
1 files changed, 6 insertions, 9 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java
index 00bb69b..005592c 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java
@@ -2808,18 +2808,18 @@ UIEvents.Context.TOPIC_CONTEXT,
*/
public IWorkbenchPage showPerspective(String perspectiveId, IWorkbenchWindow window)
throws WorkbenchException {
- return showPerspective(perspectiveId, window, null);
+ return showPerspective(perspectiveId, window, advisor.getDefaultPageInput());
}
- private boolean activate(String perspectiveId, IWorkbenchPage page, IAdaptable input,
- boolean checkPerspective) {
+ private boolean activate(String perspectiveId, IWorkbenchPage page, IAdaptable input) {
if (page != null) {
for (IPerspectiveDescriptor openedPerspective : page.getOpenPerspectives()) {
- if (!checkPerspective || openedPerspective.getId().equals(perspectiveId)) {
+ if (openedPerspective.getId().equals(perspectiveId)) {
if (page.getInput() == input) {
WorkbenchWindow wwindow = (WorkbenchWindow) page.getWorkbenchWindow();
MWindow model = wwindow.getModel();
application.setSelectedElement(model);
+ page.setPerspective(openedPerspective);
return true;
}
}
@@ -2843,23 +2843,20 @@ UIEvents.Context.TOPIC_CONTEXT,
if (targetWindow != null) {
IWorkbenchPage page = targetWindow.getActivePage();
- if (activate(perspectiveId, page, input, true)) {
+ if (activate(perspectiveId, page, input)) {
return page;
}
}
for (IWorkbenchWindow window : getWorkbenchWindows()) {
IWorkbenchPage page = window.getActivePage();
- if (activate(perspectiveId, page, input, true)) {
+ if (activate(perspectiveId, page, input)) {
return page;
}
}
if (targetWindow != null) {
IWorkbenchPage page = targetWindow.getActivePage();
- if (activate(perspectiveId, page, input, false)) {
- return page;
- }
IPreferenceStore store = WorkbenchPlugin.getDefault().getPreferenceStore();
int mode = store.getInt(IPreferenceConstants.OPEN_PERSP_MODE);