2 * Copyright (C) 2017 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
9 package eu
.etaxonomy
.taxeditor
.navigation
.search
;
11 import eu
.etaxonomy
.cdm
.api
.service
.config
.IFindTaxaAndNamesConfigurator
;
12 import eu
.etaxonomy
.taxeditor
.navigation
.l10n
.Messages
;
13 import eu
.etaxonomy
.taxeditor
.preference
.IPreferenceKeys
;
14 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
21 public enum SearchOption
{
22 TAXON(Messages
.SearchBar_6
),
23 SYNONYM(Messages
.SearchBar_7
),
24 NAME(Messages
.SearchBar_8
),
25 COMMON_NAME(Messages
.SearchBar_9
);
27 private final String label
;
29 private SearchOption(String label
) {
33 public String
getLabel() {
37 public boolean getPreference() {
38 if (!PreferencesUtil
.getPreferenceStore().contains(IPreferenceKeys
.TAXON_SERVICE_CONFIGURATOR_TAXA
)) {
39 // initializes the search configurator
40 IFindTaxaAndNamesConfigurator configurator
= PreferencesUtil
.initializeSearchConfigurator();
41 PreferencesUtil
.setSearchConfigurator(configurator
);
46 boolean result
= PreferencesUtil
.getPreferenceStore().getBoolean(
47 IPreferenceKeys
.TAXON_SERVICE_CONFIGURATOR_TAXA
);
50 return PreferencesUtil
.getPreferenceStore().getBoolean(
51 IPreferenceKeys
.TAXON_SERVICE_CONFIGURATOR_SYNONYMS
);
53 return PreferencesUtil
.getPreferenceStore().getBoolean(
54 IPreferenceKeys
.TAXON_SERVICE_CONFIGURATOR_NAMES
);
56 return PreferencesUtil
.getPreferenceStore().getBoolean(
57 IPreferenceKeys
.TAXON_SERVICE_CONFIGURATOR_COMMON_NAMES
);