diff options
Diffstat (limited to 'org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPreferencePage.java')
-rw-r--r-- | org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPreferencePage.java | 120 |
1 files changed, 0 insertions, 120 deletions
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 deleted file mode 100644 index 176376235d3..00000000000 --- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPreferencePage.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * (c) Copyright IBM Corp. 2000, 2002. - * All Rights Reserved. - */ -package org.eclipse.search.internal.ui; - -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.widgets.Composite; - -import org.eclipse.jface.preference.BooleanFieldEditor; -import org.eclipse.jface.preference.ColorFieldEditor; -import org.eclipse.jface.preference.FieldEditorPreferencePage; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.PreferenceConverter; -import org.eclipse.jface.util.PropertyChangeEvent; - -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; -import org.eclipse.ui.help.WorkbenchHelp; - -/* - * The page for setting the Search preferences. - */ -public class SearchPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { - - public static final String IGNORE_POTENTIAL_MATCHES= "org.eclipse.search.potentialMatch.ignore"; //$NON-NLS-1$ - public static final String EMPHASIZE_POTENTIAL_MATCHES= "org.eclipse.search.potentialMatch.emphasize"; //$NON-NLS-1$ - public static final String POTENTIAL_MATCH_FG_COLOR= "org.eclipse.search.potentialMatch.fgColor"; //$NON-NLS-1$ - public static final String REUSE_EDITOR= "org.eclipse.search.reuseEditor"; //$NON-NLS-1$ - - private ColorFieldEditor fColorEditor; - private BooleanFieldEditor fEmphasizedCheckbox; - private BooleanFieldEditor fIgnorePotentialMatchesCheckbox; - private Composite fParent; - - public SearchPreferencePage() { - super(GRID); - setPreferenceStore(SearchPlugin.getDefault().getPreferenceStore()); - } - - public static void initDefaults(IPreferenceStore store) { - RGB gray= new RGB(85, 85, 85); - store.setDefault(EMPHASIZE_POTENTIAL_MATCHES, true); - store.setDefault(IGNORE_POTENTIAL_MATCHES, false); - PreferenceConverter.setDefault(store, POTENTIAL_MATCH_FG_COLOR, gray); - store.setDefault(REUSE_EDITOR, false); - } - - public static boolean isEditorReused() { - IPreferenceStore store= SearchPlugin.getDefault().getPreferenceStore(); - return store.getBoolean(REUSE_EDITOR); - } - - public static boolean arePotentialMatchesIgnored() { - IPreferenceStore store= SearchPlugin.getDefault().getPreferenceStore(); - return store.getBoolean(IGNORE_POTENTIAL_MATCHES); - } - - public static boolean arePotentialMatchesEmphasized() { - IPreferenceStore store= SearchPlugin.getDefault().getPreferenceStore(); - return store.getBoolean(EMPHASIZE_POTENTIAL_MATCHES); - } - - public static RGB getPotentialMatchBackgroundColor() { - IPreferenceStore store= SearchPlugin.getDefault().getPreferenceStore(); - return PreferenceConverter.getColor(store, POTENTIAL_MATCH_FG_COLOR); - } - - public void createControl(Composite parent) { - super.createControl(parent); - WorkbenchHelp.setHelp(getControl(), ISearchHelpContextIds.SEARCH_PREFERENCE_PAGE); - } - - protected void createFieldEditors() { - BooleanFieldEditor boolEditor= new BooleanFieldEditor( - REUSE_EDITOR, - SearchMessages.getString("SearchPreferencePage.reuseEditor"), //$NON-NLS-1$ - getFieldEditorParent() - ); - addField(boolEditor); - - fIgnorePotentialMatchesCheckbox= new BooleanFieldEditor( - IGNORE_POTENTIAL_MATCHES, - SearchMessages.getString("SearchPreferencePage.ignorePotentialMatches"), //$NON-NLS-1$ - getFieldEditorParent()); - addField(fIgnorePotentialMatchesCheckbox); - - fEmphasizedCheckbox= new BooleanFieldEditor( - EMPHASIZE_POTENTIAL_MATCHES, - SearchMessages.getString("SearchPreferencePage.emphasizePotentialMatches"), //$NON-NLS-1$ - getFieldEditorParent()); - addField(fEmphasizedCheckbox); - - fColorEditor= new ColorFieldEditor( - POTENTIAL_MATCH_FG_COLOR, - SearchMessages.getString("SearchPreferencePage.potentialMatchFgColor"), //$NON-NLS-1$ - getFieldEditorParent() - ); - addField(fColorEditor); - - fEmphasizedCheckbox.setEnabled(!arePotentialMatchesIgnored(), getFieldEditorParent()); - fColorEditor.setEnabled(!arePotentialMatchesIgnored() && arePotentialMatchesEmphasized(), getFieldEditorParent()); - } - - public void propertyChange(PropertyChangeEvent event) { - boolean arePotentialMatchesIgnored= fIgnorePotentialMatchesCheckbox.getBooleanValue(); - fEmphasizedCheckbox.setEnabled(!arePotentialMatchesIgnored, getFieldEditorParent()); - fColorEditor.setEnabled(!arePotentialMatchesIgnored && fEmphasizedCheckbox.getBooleanValue(), getFieldEditorParent()); - } - - public void init(IWorkbench workbench) { - } - - protected void performDefaults() { - super.performDefaults(); - boolean arePotentialMatchesIgnored= fIgnorePotentialMatchesCheckbox.getBooleanValue(); - fEmphasizedCheckbox.setEnabled(!arePotentialMatchesIgnored, getFieldEditorParent()); - fColorEditor.setEnabled(!arePotentialMatchesIgnored && fEmphasizedCheckbox.getBooleanValue(), getFieldEditorParent()); - } -} |