Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2002-10-18 10:22:44 +0000
committerDani Megert2002-10-18 10:22:44 +0000
commiteb4c6bf95ad242c09b05578c35f0b37592fbd7f3 (patch)
tree907d85203787b2b66aa21b41f6b5ecd60bbe1d6b /org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPlugin.java
parent137483ddc989957b42c535320d449c8af9b25c19 (diff)
downloadeclipse.platform.text-eb4c6bf95ad242c09b05578c35f0b37592fbd7f3.tar.gz
eclipse.platform.text-eb4c6bf95ad242c09b05578c35f0b37592fbd7f3.tar.xz
eclipse.platform.text-eb4c6bf95ad242c09b05578c35f0b37592fbd7f3.zip
Fixed bug 6046: Losing context when looking at search results
Diffstat (limited to 'org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPlugin.java')
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPlugin.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPlugin.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPlugin.java
index 490b465ec95..038ad5a909c 100644
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPlugin.java
+++ b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPlugin.java
@@ -1,5 +1,5 @@
/*
- * (c) Copyright IBM Corp. 2000, 2001.
+ * (c) Copyright IBM Corp. 2000, 2002.
* All Rights Reserved.
*/
package org.eclipse.search.internal.ui;
@@ -34,6 +34,8 @@ import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.WorkbenchException;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.search.ui.IContextMenuConstants;
@@ -164,6 +166,19 @@ public class SearchPlugin extends AbstractUIPlugin {
* @return <code>true</code> if the search result view could be activated
*/
public static boolean activateSearchResultView() {
+
+ String defaultPerspectiveId= SearchUI.getDefaultPerspectiveId();
+ if (defaultPerspectiveId != null) {
+ IWorkbenchWindow window= window= getActiveWorkbenchWindow();
+ if (window != null && window.getShell() != null && !window.getShell().isDisposed()) {
+ try {
+ PlatformUI.getWorkbench().showPerspective(defaultPerspectiveId, window);
+ } catch (WorkbenchException ex) {
+ // show view in current perspective
+ }
+ }
+ }
+
try {
return (getActivePage().showView(SearchUI.SEARCH_RESULT_VIEW_ID) != null);
} catch (PartInitException ex) {

Back to the top