Search in sources :

Example 1 with TextSearchEngineRegistry

use of org.eclipse.search.internal.core.text.TextSearchEngineRegistry in project eclipse.platform.text by eclipse.

the class SearchPreferencePage method createFieldEditors.

@Override
protected void createFieldEditors() {
    addField(new BooleanFieldEditor(REUSE_EDITOR, SearchMessages.SearchPreferencePage_reuseEditor, getFieldEditorParent()));
    addField(new BooleanFieldEditor(BRING_VIEW_TO_FRONT, SearchMessages.SearchPreferencePage_bringToFront, getFieldEditorParent()));
    fIgnorePotentialMatchesCheckbox = new BooleanFieldEditor(IGNORE_POTENTIAL_MATCHES, SearchMessages.SearchPreferencePage_ignorePotentialMatches, getFieldEditorParent());
    addField(fIgnorePotentialMatchesCheckbox);
    fEmphasizedCheckbox = new BooleanFieldEditor(EMPHASIZE_POTENTIAL_MATCHES, SearchMessages.SearchPreferencePage_emphasizePotentialMatches, getFieldEditorParent());
    addField(fEmphasizedCheckbox);
    fColorEditor = new ColorFieldEditor(POTENTIAL_MATCH_FG_COLOR, SearchMessages.SearchPreferencePage_potentialMatchFgColor, getFieldEditorParent());
    addField(fColorEditor);
    fEmphasizedCheckbox.setEnabled(!arePotentialMatchesIgnored(), getFieldEditorParent());
    fColorEditor.setEnabled(!arePotentialMatchesIgnored() && arePotentialMatchesEmphasized(), getFieldEditorParent());
    handleDeletedPerspectives();
    String[][] perspectiveNamesAndIds = getPerspectiveNamesAndIds();
    ComboFieldEditor comboEditor = new ComboFieldEditor(DEFAULT_PERSPECTIVE, SearchMessages.SearchPreferencePage_defaultPerspective, perspectiveNamesAndIds, getFieldEditorParent());
    addField(comboEditor);
    // in case we have a contributed engine, let the user choose.
    TextSearchEngineRegistry reg = SearchPlugin.getDefault().getTextSearchEngineRegistry();
    String[][] engineNamesAndIds = reg.getAvailableEngines();
    if (engineNamesAndIds.length > 1) {
        comboEditor = new ComboFieldEditor(TEXT_SEARCH_ENGINE, SearchMessages.SearchPreferencePage_textSearchEngine, engineNamesAndIds, getFieldEditorParent());
        addField(comboEditor);
    }
}
Also used : ColorFieldEditor(org.eclipse.jface.preference.ColorFieldEditor) BooleanFieldEditor(org.eclipse.jface.preference.BooleanFieldEditor) ComboFieldEditor(org.eclipse.jface.preference.ComboFieldEditor) TextSearchEngineRegistry(org.eclipse.search.internal.core.text.TextSearchEngineRegistry)

Aggregations

BooleanFieldEditor (org.eclipse.jface.preference.BooleanFieldEditor)1 ColorFieldEditor (org.eclipse.jface.preference.ColorFieldEditor)1 ComboFieldEditor (org.eclipse.jface.preference.ComboFieldEditor)1 TextSearchEngineRegistry (org.eclipse.search.internal.core.text.TextSearchEngineRegistry)1