Preparatory work for ticket #1347.
authorem.lee <em.lee@localhost>
Fri, 8 Jan 2010 16:41:53 +0000 (16:41 +0000)
committerem.lee <em.lee@localhost>
Fri, 8 Jan 2010 16:41:53 +0000 (16:41 +0000)
taxeditor-navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/search/SearchBar.java

index c2f940964d19f27c3b1d492411b7168f6f466db2..5a83aaf9ee3eaa944ce7177eda09965d5411383a 100644 (file)
@@ -95,6 +95,7 @@ public class SearchBar extends WorkbenchWindowControlContribution {
                dropdownListener.add(SearchOption.SYNONYM);
                dropdownListener.add(SearchOption.NAME);
                dropdownListener.add(SearchOption.COMMON_NAME);
+               dropdownListener.add(SearchOption.ORPHANED_TAXON);
 
                toolItem.addSelectionListener(dropdownListener);
        }
@@ -252,6 +253,8 @@ public class SearchBar extends WorkbenchWindowControlContribution {
                                getConfigurator().setDoNamesWithoutTaxa(getConfigurator().isDoNamesWithoutTaxa() ? false : true);
                        } else if (option == SearchOption.COMMON_NAME) {
                                getConfigurator().setDoTaxaByCommonNames(getConfigurator().isDoTaxaByCommonNames() ? false : true);
+                       } else if (option == SearchOption.ORPHANED_TAXON) {
+                               getConfigurator().setDoTaxaByOrphanedTaxa(getConfigurator().isDoTaxaByOrphanedTaxa() ? false : true);
                        }
                        saveConfigurator();
                }
@@ -273,8 +276,8 @@ public class SearchBar extends WorkbenchWindowControlContribution {
         * Enumerations
         */
        enum SearchOption {
-               TAXON("Taxa"), SYNONYM("Synonyms"), NAME("Names (without taxa)"), COMMON_NAME(
-                               "Common Names");
+               TAXON("Taxa"), SYNONYM("Synonyms"), NAME("Names (without taxa)"), 
+               COMMON_NAME("Common Names"), ORPHANED_TAXON("Orphaned Taxa");
 
                private String label;
 
@@ -307,6 +310,9 @@ public class SearchBar extends WorkbenchWindowControlContribution {
                        case COMMON_NAME:
                                return PreferencesUtil.getPreferenceStore().getBoolean(
                                                                PreferencesUtil.TAXON_SERVICE_CONFIGURATOR_COMMON_NAMES);
+                       case ORPHANED_TAXON:
+                               return PreferencesUtil.getPreferenceStore().getBoolean(
+                                                               PreferencesUtil.TAXON_SERVICE_CONFIGURATOR_ORPHANED_TAXA);
                        }
 
                        return true;