commit 2a41b80dc5cb38e67ee6976bd541490f34357af9
Author: Katja Luther <k.luther@bgbm.org>
Date:   Thu Feb 23 12:04:27 2017 +0100

    externalize strings for admin menu

diff --git a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties
index f67d84a76..4958c05b1 100644
--- a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties
+++ b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties
@@ -156,3 +156,26 @@ DatabasePreferncesPage_Is_redList=Red List 2020
 DatabasePreferncesPage_Determination_only_for_field_unnits=Determinations only for field units
 DatabasePreferncesPage_Show_Collecting_Areas_in_general_section=Show collecting areas in general section
 DatabasePreferncesPage_Taxon_Associations=Show taxon associations of a specimen in details view
+
+DatabasePreferencesPage_Biocase_Provider=Biocase provider selection
+DatabasePreferencesPage_details_view_configuration=Details view configuration
+DatabasePreferencesPage_show_only_simple_details_view=Show only simple details view
+DatabasePreferencesPage_show_taxon=Show taxon
+DatabasePreferencesPage_show_lsid=Show LSID
+DatabasePreferencesPage_show_nomenclatural_code=Show nomenclatural code
+DatabasePreferencesPage_show_namecache=Show name cache
+DatabasePreferencesPage_show_appended_phrase=Show appended phrase
+DatabasePreferencesPage_show_rank=Show rank
+DatabasePreferencesPage_show_atomised_epithets=Show atomised epithets
+DatabasePreferencesPage_show_authorship_cache=Show authorship cache
+DatabasePreferencesPage_show_author_section=Show author section
+DatabasePreferencesPage_Show_nomenclatural_Ref=Show nomenclatural reference
+DatabasePreferencesPage_Show_nomenclaturalStatus=Show nomenclatural status
+DatabasePreferencesPage_Show_Protologue=Show protologue
+DatabasePreferencesPage_Show_Type_designation=Show type designation
+DatabasePreferencesPage_Show_NameRelations=Show name relations
+DatabasePreferencesPage_Define_Default_NomenclaturalCode=Define default nomenclatural code
+DatabasePreferencesPage_UseLocalPreferences=Allow to use local preference
+DatabasePreferencesPage_Specimen_Or_Observation=Specimen or observation configuration
+
+
diff --git a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties
index f9af42828..dab2b3ea8 100644
--- a/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties
+++ b/eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties
@@ -154,3 +154,24 @@ DatabasePreferncesPage_Is_redList=Rote Liste 2020
 DatabasePreferncesPage_Determination_only_for_field_unnits=Determinations nur für Field Units
 DatabasePreferncesPage_Show_Collecting_Areas_in_general_section=Zeige Sammelgebiete im allgemeinen Teil
 DatabasePreferncesPage_Taxon_Associations=Zeige Taxon Assoziationen eines Specimen im Details View
+
+DatabasePreferencesPage_Biocase_Provider=Biocase Provider Auswahl
+DatabasePreferencesPage_details_view_configuration=Details view Konfiguration
+DatabasePreferencesPage_show_only_simple_details_view=Zeige nur einen einfachen (konfigurierbaren) Details View
+DatabasePreferencesPage_show_taxon=Zeige Taxon
+DatabasePreferencesPage_show_lsid=Zeige LSID
+DatabasePreferencesPage_show_nomenclatural_code=Zeige Nomenklatorischen Code
+DatabasePreferencesPage_show_namecache=Zeige Namecache
+DatabasePreferencesPage_show_appended_phrase=Zeige appended phrase
+DatabasePreferencesPage_show_rank=Zeige Rang
+DatabasePreferencesPage_show_atomised_epithets=Zeige atomisierte Epithete
+DatabasePreferencesPage_show_authorship_cache=Zeige Autoren Cache
+DatabasePreferencesPage_show_author_section=Zeige den Autoren Bereich
+DatabasePreferencesPage_Show_nomenclatural_Ref=Zeige nomenklatorische Referenz
+DatabasePreferencesPage_Show_nomenclaturalStatus=Zeige nomenklatorischen Status
+DatabasePreferencesPage_Show_Protologue=Zeige den Protologue
+DatabasePreferencesPage_Show_Type_designation=Zeige Type Designations
+DatabasePreferencesPage_Show_NameRelations=Zeige Namensrelationen
+DatabasePreferencesPage_Define_Default_NomenclaturalCode=Festlegen des default Nomenklatorischen Codes
+DatabasePreferencesPage_UseLocalPreferences=Erlaube das lokale Überschreiben
+DatabasePreferencesPage_Specimen_Or_Observation=Konfiguration von Specimen und Observationen
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/Messages.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/Messages.java
index bc26e7417..59e199548 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/Messages.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/Messages.java
@@ -164,6 +164,26 @@ public class Messages extends NLS {
     public static String DatabasePreferncesPage_Show_Collecting_Areas_in_general_section;
     public static String DatabasePreferncesPage_Taxon_Associations;
 
+    public static String DatabasePreferencesPage_Biocase_Provider;
+    public static String DatabasePreferencesPage_details_view_configuration;
+    public static String DatabasePreferencesPage_show_only_simple_details_view;
+    public static String DatabasePreferencesPage_show_taxon;
+    public static String DatabasePreferencesPage_show_lsid;
+    public static String DatabasePreferencesPage_show_nomenclatural_code;
+    public static String DatabasePreferencesPage_show_namecache;
+    public static String DatabasePreferencesPage_show_appended_phrase;
+    public static String DatabasePreferencesPage_show_rank;
+    public static String DatabasePreferencesPage_show_atomised_epithets;
+    public static String DatabasePreferencesPage_show_authorship_cache;
+    public static String DatabasePreferencesPage_show_author_section;
+    public static String DatabasePreferencesPage_Show_nomenclatural_Ref;
+    public static String DatabasePreferencesPage_Show_nomenclaturalStatus;
+    public static String DatabasePreferencesPage_Show_Protologue;
+    public static String DatabasePreferencesPage_Show_Type_designation;
+    public static String DatabasePreferencesPage_Show_NameRelations;
+    public static String DatabasePreferencesPage_Define_Default_NomenclaturalCode;
+    public static String DatabasePreferencesPage_UseLocalPreferences;
+    public static String DatabasePreferencesPage_Specimen_Or_Observation;
 
     static {
         // initialize resource bundle
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabasePreferencesPage.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabasePreferencesPage.java
index 42502d21e..f722fec82 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabasePreferencesPage.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabasePreferencesPage.java
@@ -59,6 +59,9 @@ public class DatabasePreferencesPage extends WizardPage implements IWizardPage{
     private Combo nomenclaturalCodeCombo;
     private Label nomenclaturalCodeLabel;
 
+//    private UriWithLabelElement nomenclaturalCodeCombo;
+//    private Label nomenclaturalCodeLabel;
+
     String[][] labelAndValues;
 
     /*
@@ -113,7 +116,7 @@ public class DatabasePreferencesPage extends WizardPage implements IWizardPage{
         if (composite == null){
             composite = parent;
         }
-       composite = addTab("Name Details View Configuration");
+       composite = addTab(Messages.DatabasePreferencesPage_details_view_configuration);
 //        TabItem tbtmNameDetailsConfiguration = new TabItem(tabFolder, SWT.NONE);
 //        Composite c2 = new Composite(tabFolder, SWT.BORDER);
 //        c2.setLayout(new GridLayout(1, true));
@@ -126,7 +129,7 @@ public class DatabasePreferencesPage extends WizardPage implements IWizardPage{
 
        isSimpleDetailsViewActivated= PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION);
        final Button activateCheckButton = new Button(composite, SWT.CHECK);
-       activateCheckButton.setText("Show only a simple name details view");
+       activateCheckButton.setText(Messages.DatabasePreferencesPage_show_only_simple_details_view);
        activateCheckButton.setSelection(isSimpleDetailsViewActivated);
        activateCheckButton.addSelectionListener(new SelectionAdapter(){
        @Override
@@ -149,7 +152,7 @@ public class DatabasePreferencesPage extends WizardPage implements IWizardPage{
 
        final Button showTaxon = new Button(child, SWT.CHECK);
        boolean isShowTaxon = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_TAXON);
-       showTaxon.setText("Show taxon of the name");
+       showTaxon.setText(Messages.DatabasePreferencesPage_show_taxon);
        showTaxon.setSelection(isShowTaxon);
        showTaxon.addSelectionListener(new SelectionAdapter(){
             @Override
@@ -161,7 +164,7 @@ public class DatabasePreferencesPage extends WizardPage implements IWizardPage{
 
        final Button showLsid = new Button(child, SWT.CHECK);
        boolean isShowLSID = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_LSID);
-       showLsid.setText("Show Lsid of the name");
+       showLsid.setText(Messages.DatabasePreferencesPage_show_lsid);
        showLsid.setSelection(isShowLSID);
        showLsid.addSelectionListener(new SelectionAdapter(){
             @Override
@@ -173,7 +176,7 @@ public class DatabasePreferencesPage extends WizardPage implements IWizardPage{
 
        final Button showNomenclaturalCode = new Button(child, SWT.CHECK);
        boolean isShowNomenclaturalCode = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE);
-       showNomenclaturalCode.setText("Show the nomenclatural code");
+       showNomenclaturalCode.setText(Messages.DatabasePreferencesPage_show_nomenclatural_code);
        showNomenclaturalCode.setSelection(isShowNomenclaturalCode);
        showNomenclaturalCode.addSelectionListener(new SelectionAdapter(){
             @Override
@@ -185,7 +188,7 @@ public class DatabasePreferencesPage extends WizardPage implements IWizardPage{
 
        final Button showNameCache = new Button(child, SWT.CHECK);
        boolean isShowNameCache = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAMECACHE);
-       showNameCache.setText("Show nameCache of the name (only the scientific name without the author and year)");
+       showNameCache.setText(Messages.DatabasePreferencesPage_show_namecache);
        showNameCache.setSelection(isShowNomenclaturalCode);
        showNameCache.addSelectionListener(new SelectionAdapter(){
             @Override
@@ -196,7 +199,7 @@ public class DatabasePreferencesPage extends WizardPage implements IWizardPage{
         });
        final Button showAppendedPhrase = new Button(child, SWT.CHECK);
        boolean isShowAppendedPhrase = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE);
-       showAppendedPhrase.setText("Show appended phrase");
+       showAppendedPhrase.setText(Messages.DatabasePreferencesPage_show_appended_phrase);
        showAppendedPhrase.setSelection(isShowAppendedPhrase);
        showAppendedPhrase.addSelectionListener(new SelectionAdapter(){
             @Override
@@ -208,7 +211,7 @@ public class DatabasePreferencesPage extends WizardPage implements IWizardPage{
 
        final Button showRank = new Button(child, SWT.CHECK);
        boolean isShowRank = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_RANK);
-       showRank.setText("Show rank of the name");
+       showRank.setText(Messages.DatabasePreferencesPage_show_rank);
        showRank.setSelection(isShowRank);
        showRank.addSelectionListener(new SelectionAdapter(){
             @Override
@@ -219,7 +222,7 @@ public class DatabasePreferencesPage extends WizardPage implements IWizardPage{
         });
        final Button showEpithets = new Button(child, SWT.CHECK);
        boolean isShowEpithets = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS);
-       showEpithets.setText("Show atomised epithets");
+       showEpithets.setText(Messages.DatabasePreferencesPage_show_atomised_epithets);
        showEpithets.setSelection(isShowEpithets);
        showEpithets.addSelectionListener(new SelectionAdapter(){
             @Override
@@ -228,9 +231,21 @@ public class DatabasePreferencesPage extends WizardPage implements IWizardPage{
                 PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS, isShowEpithets);
              }
         });
+       final Button showAuthorshipCache = new Button(child, SWT.CHECK);
+       boolean isShowAuthorshipCache = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE);
+       showAuthorshipCache.setText(Messages.DatabasePreferencesPage_show_authorship_cache);
+       showAuthorshipCache.setSelection(isShowAuthorshipCache);
+       showAuthorshipCache.addSelectionListener(new SelectionAdapter(){
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                boolean isShowAuthorshipCache = showAuthorshipCache.getSelection();
+                PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE, isShowAuthorshipCache);
+             }
+        });
+
        final Button showAuthorship = new Button(child, SWT.CHECK);
        boolean isShowAuthorship = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP);
-       showAuthorship.setText("Show authorship section");
+       showAuthorship.setText(Messages.DatabasePreferencesPage_show_author_section);
        showAuthorship.setSelection(isShowAuthorship);
        showAuthorship.addSelectionListener(new SelectionAdapter(){
             @Override
@@ -242,7 +257,7 @@ public class DatabasePreferencesPage extends WizardPage implements IWizardPage{
 
        final Button showNomenclaturalRef = new Button(child, SWT.CHECK);
        boolean isShowNomenclaturalRef = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE);
-       showNomenclaturalRef.setText("Show nomenclatural reference section");
+       showNomenclaturalRef.setText(Messages.DatabasePreferencesPage_Show_nomenclatural_Ref);
        showNomenclaturalRef.setSelection(isShowNomenclaturalRef);
        showNomenclaturalRef.addSelectionListener(new SelectionAdapter(){
             @Override
@@ -254,7 +269,7 @@ public class DatabasePreferencesPage extends WizardPage implements IWizardPage{
 
        final Button showNomenclaturalStatus = new Button(child, SWT.CHECK);
        boolean isShowNomenclaturalStatus = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS);
-       showNomenclaturalStatus.setText("Show nomenclatural status section");
+       showNomenclaturalStatus.setText(Messages.DatabasePreferencesPage_Show_nomenclaturalStatus);
        showNomenclaturalStatus.setSelection(isShowNomenclaturalStatus);
        showNomenclaturalStatus.addSelectionListener(new SelectionAdapter(){
             @Override
@@ -266,7 +281,7 @@ public class DatabasePreferencesPage extends WizardPage implements IWizardPage{
 
        final Button showProtologue = new Button(child, SWT.CHECK);
        boolean isShowProtologue = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_PROTOLOGUE);
-       showProtologue.setText("Show protologue section");
+       showProtologue.setText(Messages.DatabasePreferencesPage_Show_Protologue);
        showProtologue.setSelection(isShowProtologue);
        showProtologue.addSelectionListener(new SelectionAdapter(){
             @Override
@@ -278,7 +293,7 @@ public class DatabasePreferencesPage extends WizardPage implements IWizardPage{
 
        final Button showTypeDesignation = new Button(child, SWT.CHECK);
        boolean isShowTypeDesignation = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION);
-       showTypeDesignation.setText("Show name type designation section");
+       showTypeDesignation.setText(Messages.DatabasePreferencesPage_Show_Type_designation);
        showTypeDesignation.setSelection(isShowTypeDesignation);
        showTypeDesignation.addSelectionListener(new SelectionAdapter(){
             @Override
@@ -291,7 +306,7 @@ public class DatabasePreferencesPage extends WizardPage implements IWizardPage{
 
        final Button showNameRelationship = new Button(child, SWT.CHECK);
        boolean isShowNameRelationship = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP);
-       showNameRelationship.setText("Show name relationship section");
+       showNameRelationship.setText(Messages.DatabasePreferencesPage_Show_NameRelations);
        showNameRelationship.setSelection(isShowNameRelationship);
        showNameRelationship.addSelectionListener(new SelectionAdapter(){
             @Override
@@ -361,7 +376,7 @@ public class DatabasePreferencesPage extends WizardPage implements IWizardPage{
     }
 
     public void createNomenclaturalCodeTab(Composite parent){
-       composite = addTab("Nomenclatural Code");
+       composite = addTab(Messages.DatabasePreferencesPage_Define_Default_NomenclaturalCode);
        nomenclaturalCodeCombo = new Combo(composite, SWT.READ_ONLY);
       List<NomenclaturalCode> supportedCodes = NomenclaturalCodeHelper
               .getSupportedCodes();
@@ -394,7 +409,7 @@ public class DatabasePreferencesPage extends WizardPage implements IWizardPage{
 
         final Button useLocalPreference = new Button(composite, SWT.CHECK);
         boolean isUseLocalPreference = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.ALLOW_OVERRIDE_NOMENCLATURAL_CODE_KEY);
-        useLocalPreference.setText("allow to use local preference");
+        useLocalPreference.setText(Messages.DatabasePreferencesPage_UseLocalPreferences);
         useLocalPreference.setSelection(isUseLocalPreference);
         useLocalPreference.addSelectionListener(new SelectionAdapter(){
              @Override
@@ -409,9 +424,58 @@ public class DatabasePreferencesPage extends WizardPage implements IWizardPage{
 
 }
 
+    public void createBiocaseProviderTab(Composite parent){
+        composite = addTab(Messages.DatabasePreferencesPage_Biocase_Provider);
+        nomenclaturalCodeCombo = new Combo(composite, SWT.READ_ONLY);
+       List<NomenclaturalCode> supportedCodes = NomenclaturalCodeHelper
+               .getSupportedCodes();
+        for (NomenclaturalCode code: supportedCodes) {
+            nomenclaturalCodeCombo.add(NomenclaturalCodeHelper
+                    .getDescription(code));
+
+        }
+        getLabelAndValues();
+        //get the actual nomenclatural code and set it as selection: doGetPreferenceStore().getString(IPreferenceKeys.CDM_NOMENCLATURAL_CODE_KEY);
+        nomenclaturalCodeCombo.addSelectionListener(new SelectionAdapter() {
+            @Override
+         public void widgetSelected(SelectionEvent evt) {
+
+                String name = nomenclaturalCodeCombo.getText();
+                String selectedPreferenceKey = null;
+                for (String[] labelAndValue: labelAndValues){
+                    if (labelAndValue[0].equals(name)){
+                        selectedPreferenceKey = labelAndValue[1];
+                    }
+                }
+
+
+                PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.CDM_NOMENCLATURAL_CODE_KEY, selectedPreferenceKey);
+
+            }
+        });
+        nomenclaturalCodeLabel = new Label(composite, SWT.READ_ONLY);
+
+
+         final Button useLocalPreference = new Button(composite, SWT.CHECK);
+         boolean isUseLocalPreference = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.ALLOW_OVERRIDE_NOMENCLATURAL_CODE_KEY);
+         useLocalPreference.setText(Messages.DatabasePreferencesPage_UseLocalPreferences);
+         useLocalPreference.setSelection(isUseLocalPreference);
+         useLocalPreference.addSelectionListener(new SelectionAdapter(){
+              @Override
+              public void widgetSelected(SelectionEvent e) {
+                  boolean isUseLocalPreference = useLocalPreference.getSelection();
+                  PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.ALLOW_OVERRIDE_NOMENCLATURAL_CODE_KEY, isUseLocalPreference);
+               }
+          });
+
+
+
+
+ }
+
 
     public void createSpecimenOrObservationTab(Composite parent){
-        composite = addTab("Specimen or Observation");
+        composite = addTab(Messages.DatabasePreferencesPage_Specimen_Or_Observation);
 
         final Button showCollectingAreaInGeneralSectionButton = new Button(composite, SWT.CHECK);
         boolean isShowCollectingAreaInGeneralSection = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_COLLECTING_AREAS_IN_GENERAL_SECTION);
