Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2003-10-23 10:27:05 +0000
committerDani Megert2003-10-23 10:27:05 +0000
commitf2470019a5e72e3658342e661485c2c535b9aea5 (patch)
treea708f4da055e976e5c465ad3aee698d675c95f8d
parentbd2da94edf54f03866fce18a0dcc7e60438cc3b1 (diff)
downloadeclipse.platform.text-f2470019a5e72e3658342e661485c2c535b9aea5.tar.gz
eclipse.platform.text-f2470019a5e72e3658342e661485c2c535b9aea5.tar.xz
eclipse.platform.text-f2470019a5e72e3658342e661485c2c535b9aea5.zip
Added feature 44970: Can't search without having a search view
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchMessages.properties1
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPlugin.java6
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPreferencePage.java17
3 files changed, 22 insertions, 2 deletions
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchMessages.properties b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchMessages.properties
index 039d04a82..e4980db57 100644
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchMessages.properties
+++ b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchMessages.properties
@@ -172,6 +172,7 @@ ExceptionDialog.seeErrorLogMessage= See error log for more details
SearchPreferencePage.emphasizePotentialMatches= &Emphasize inexact matches
SearchPreferencePage.potentialMatchFgColor= &Foreground color for inexact matches:
SearchPreferencePage.reuseEditor= &Reuse editors to show matches
+SearchPreferencePage.bringToFront= &Bring search view to front after search
SearchPreferencePage.defaultPerspective= Default &perspective for the Search view:
SearchPreferencePage.defaultPerspective.none= None
SearchPreferencePage.ignorePotentialMatches= &Ignore inexact matches
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 723fa8578..eb98f2a4b 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
@@ -190,7 +190,11 @@ public class SearchPlugin extends AbstractUIPlugin {
}
try {
- return (getActivePage().showView(SearchUI.SEARCH_RESULT_VIEW_ID) != null);
+ IViewPart viewPart= getActivePage().findView(SearchUI.SEARCH_RESULT_VIEW_ID);
+ if (viewPart == null || SearchPreferencePage.isViewBroughtToFront()) {
+ return (getActivePage().showView(SearchUI.SEARCH_RESULT_VIEW_ID) != null);
+ }
+ return true;
} catch (PartInitException ex) {
ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.openResultView.title"), SearchMessages.getString("Search.Error.openResultView.message")); //$NON-NLS-2$ //$NON-NLS-1$
return false;
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPreferencePage.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPreferencePage.java
index 8df06ac24..f07ae469b 100644
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPreferencePage.java
+++ b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPreferencePage.java
@@ -44,7 +44,8 @@ public class SearchPreferencePage extends FieldEditorPreferencePage implements I
public static final String REUSE_EDITOR= "org.eclipse.search.reuseEditor"; //$NON-NLS-1$
public static final String DEFAULT_PERSPECTIVE= "org.eclipse.search.defaultPerspective"; //$NON-NLS-1$
private static final String NO_DEFAULT_PERSPECTIVE= "org.eclipse.search.defaultPerspective.none"; //$NON-NLS-1$
-
+ public static final String BRING_VIEW_TO_FRONT= "org.eclipse.search.bringToFront"; //$NON-NLS-1$
+
private ColorFieldEditor fColorEditor;
private BooleanFieldEditor fEmphasizedCheckbox;
private BooleanFieldEditor fIgnorePotentialMatchesCheckbox;
@@ -77,6 +78,7 @@ public class SearchPreferencePage extends FieldEditorPreferencePage implements I
store.setDefault(IGNORE_POTENTIAL_MATCHES, false);
PreferenceConverter.setDefault(store, POTENTIAL_MATCH_FG_COLOR, gray);
store.setDefault(REUSE_EDITOR, false);
+ store.setDefault(BRING_VIEW_TO_FRONT, true);
store.setDefault(DEFAULT_PERSPECTIVE, NO_DEFAULT_PERSPECTIVE);
}
@@ -84,6 +86,12 @@ public class SearchPreferencePage extends FieldEditorPreferencePage implements I
IPreferenceStore store= SearchPlugin.getDefault().getPreferenceStore();
return store.getBoolean(REUSE_EDITOR);
}
+
+ public static boolean isViewBroughtToFront() {
+ IPreferenceStore store= SearchPlugin.getDefault().getPreferenceStore();
+ return store.getBoolean(BRING_VIEW_TO_FRONT);
+
+ }
public static String getDefaultPerspectiveId() {
handleDeletedPerspectives();
@@ -126,6 +134,13 @@ public class SearchPreferencePage extends FieldEditorPreferencePage implements I
);
addField(boolEditor);
+ boolEditor= new BooleanFieldEditor(
+ BRING_VIEW_TO_FRONT,
+ SearchMessages.getString("SearchPreferencePage.bringToFront"), //$NON-NLS-1$
+ getFieldEditorParent()
+ );
+ addField(boolEditor);
+
fIgnorePotentialMatchesCheckbox= new BooleanFieldEditor(
IGNORE_POTENTIAL_MATCHES,
SearchMessages.getString("SearchPreferencePage.ignorePotentialMatches"), //$NON-NLS-1$

Back to the top