commit 852ab2c5eef3ee3a7757670528bd37fc1dbcaac6
Author: Katja Luther <k.luther@bgbm.org>
Date:   Fri Feb 8 23:09:16 2019 +0100

    ref #7849: add message to term selection wizard that no selection -> all terms available, smaller adapation in areaselection dialogs

diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/VocabularyAdminPreferences.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/VocabularyAdminPreferences.java
index 43ca16068..b484ff1d5 100755
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/VocabularyAdminPreferences.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/VocabularyAdminPreferences.java
@@ -14,14 +14,11 @@ import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 
-import eu.etaxonomy.cdm.api.application.ICdmRepository;
-import eu.etaxonomy.cdm.api.service.IPreferenceService;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
 import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.preference.menu.CdmPreferencePage;
-import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.element.CommandHandlerButton;
 
 /**
@@ -79,20 +76,9 @@ public class VocabularyAdminPreferences extends CdmPreferencePage implements IE4
         if (pref == null){
             return true;
         }
-        ICdmRepository controller = CdmStore.getCurrentApplicationConfiguration();
 
-        if(controller!=null){
-            IPreferenceService service = controller.getPreferenceService();
+        PreferencesUtil.updateDBPreferences();
 
-            CdmPreference pref = PreferencesUtil.getPreferenceFromDB(PreferencePredicate.CommonNameAreaVocabularies);
-            if(pref==null){
-                pref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.CommonNameAreaVocabularies, "");
-            }
-            pref.setAllowOverride(allowOverride);
-            service.set(pref);
-
-            PreferencesUtil.updateDBPreferences();
-        }
         return true;
 
     }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/NameDetailsViewComposite.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/NameDetailsViewComposite.java
index 33103e518..fd617c90f 100755
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/NameDetailsViewComposite.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/NameDetailsViewComposite.java
@@ -18,7 +18,6 @@ import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 
 import eu.etaxonomy.taxeditor.l10n.Messages;
-import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
 import eu.etaxonomy.taxeditor.preference.NameDetailsConfigurator;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 
@@ -68,16 +67,16 @@ public class NameDetailsViewComposite extends Composite {
 //       NameDetailsConfigurator config = PreferencesUtil.setPreferredNameDetailsConfiguration(local)
 
        final Button allowLocalPreference = new Button(this, SWT.CHECK);
-       boolean isUseLocalPreference = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.ALLOW_OVERRIDE_NAME_DETAILS);
-       allowLocalPreference.setText(Messages.DatabasePreferencesPage_UseLocalPreferences);
-       allowLocalPreference.setSelection(isUseLocalPreference);
-       allowLocalPreference.addSelectionListener(new SelectionAdapter(){
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                boolean isUseLocalPreference = allowLocalPreference.getSelection();
-                PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.ALLOW_OVERRIDE_NAME_DETAILS, isUseLocalPreference);
-             }
-        });
+//       boolean isUseLocalPreference = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.ALLOW_OVERRIDE_NAME_DETAILS);
+//       allowLocalPreference.setText(Messages.DatabasePreferencesPage_UseLocalPreferences);
+//       allowLocalPreference.setSelection(isUseLocalPreference);
+//       allowLocalPreference.addSelectionListener(new SelectionAdapter(){
+//            @Override
+//            public void widgetSelected(SelectionEvent e) {
+//                boolean isUseLocalPreference = allowLocalPreference.getSelection();
+//                PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.ALLOW_OVERRIDE_NAME_DETAILS, isUseLocalPreference);
+//             }
+//        });
 
 
        isSimpleDetailsViewActivated= config.isSimpleDetailsViewActivated();
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages.properties b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages.properties
index 37e4a3a61..922d315b8 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages.properties
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages.properties
@@ -363,12 +363,12 @@ AbcdImportPreference_allow_override=Allow override
 AbcdImportPreference_allow_override_tooltip=It is allowed to change this preference locally.
 
 AbcdImportProvider_description=Configure the default list of biocase provider for the specimen search
-AvailableAreaVocabulariesPage_PAGE_DESCRIPTION=In order to see or modify the %s of taxa,\nyou have to select the vocabularies to select the available areas from.
+AvailableAreaVocabulariesPage_PAGE_DESCRIPTION=Select vocabularies to select the available areas from.
 AvailableAreaVocabulariesPage_PAGE_TITLE=Select Vocabularies for %s
 AvailableDistributionPage_CHECK_MESSAGE=Please check at least one item
 AvailableDistributionPage_PAGE_DESCRIPTION=In order to see and modify distribution status of taxa\nyou have to select the areas which you like to see/modify.
 AvailableDistributionPage_PAGE_TITLE=Select areas for Distribution Editor
-AvailableDistributionStatusPage_PAGE_DESCRIPTION=To modify the distribution status for taxa in a given area\nyou may preselect the available status list.
+AvailableDistributionStatusPage_PAGE_DESCRIPTION=Choose available status in distribution editor.\nIf no status is selected all status are available.
 AvailableDistributionStatusPage_PAGE_TITLE=Select Distribution Status
 AvailableDistributionStatusWizard_PAGE_TITLE=Available Distribution Status
 AvailableDistributionStatusWizard_WINDOW_TITLE=Distribution Status Selection
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages_de.properties b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages_de.properties
index 90bdd70c1..0c6cdfc04 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages_de.properties
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages_de.properties
@@ -364,12 +364,12 @@ AbcdImportPreference_allow_override=Erlaube 
 AbcdImportPreference_allow_override_tooltip=Es dürfen lokale Änderungen an den Präferenzen vorgenommen werden.
 
 AbcdImportProvider_description=Konfiguration einer Liste von Biocase Providern für die Specimen Suche
-AvailableAreaVocabulariesPage_PAGE_DESCRIPTION=Um %s von Taxa anzuzeigen oder zu bearbeiten,\nmuss das Vokabular ausgewählt werden, von dem die Gebiete ausgewählt werden sollen.
+AvailableAreaVocabulariesPage_PAGE_DESCRIPTION=Auswahl der Vokabulare, aus denen die Gebiete für %s ausgewählt werden sollen.
 AvailableAreaVocabulariesPage_PAGE_TITLE=Vokabular für %s auswählen
 AvailableDistributionPage_CHECK_MESSAGE=Bitte wählen Sie mindestens einen Eintrag aus
 AvailableDistributionPage_PAGE_DESCRIPTION=Um den Verbreitungsstatus von Taxa anzuzeigen und zu bearbeiten,\n muss das Gebiet ausgewählt werden, dass angezeigt/bearbeitet werden soll.
 AvailableDistributionPage_PAGE_TITLE=Auswahl der zur Verf\u00FCgung stehenden Gebiete für den Verbreitungs-Editor
-AvailableDistributionStatusPage_PAGE_DESCRIPTION=Um den Verbreitungsstatus für Taxa in einem bestimmten Gebiet zu bearbeiten,\nkönnen Sie die Liste der verfügbare Status auswählen.
+AvailableDistributionStatusPage_PAGE_DESCRIPTION=Auswahl der im Verbreitungseditor zu Verf\u00FCgung stehenden Status.\nWenn kein Status ausgewählt ist, werden alle Status angezeigt.
 AvailableDistributionStatusPage_PAGE_TITLE=Verbreitungsstatus auswählen
 AvailableDistributionStatusWizard_PAGE_TITLE=Verfügbare Verbreitungsstatus
 AvailableDistributionStatusWizard_WINDOW_TITLE=Verbreitungsstatus auswählen
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java
index a7e67e5f1..25a7ee6a4 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java
@@ -1400,7 +1400,7 @@ public class PreferencesUtil implements IPreferenceKeys {
                 return null;
             }
 
-            setBooleanValue(ALLOW_OVERRIDE_NAME_DETAILS, preference.isAllowOverride());
+        //    setBooleanValue(ALLOW_OVERRIDE_NAME_DETAILS, preference.isAllowOverride());
             value = preference.getValue();
             config.setAllowOverride(preference.isAllowOverride());
             //the preference value is build like this:
@@ -1855,11 +1855,11 @@ public static void updateDBPreferences() {
 
     //Name Details
     NameDetailsConfigurator config = getPreferredNameDetailsConfiguration(false);
-    if (config != null ){
-        if (!getBooleanValue(OVERRIDE_NAME_DETAILS) ||  !getBooleanValue(ALLOW_OVERRIDE_NAME_DETAILS)){
-            setPreferredNameDetailsConfiguration(config, false);
-        }
-    }
+//    if (config != null ){
+//        if (!getBooleanValue(OVERRIDE_NAME_DETAILS) ||  !getBooleanValue(ALLOW_OVERRIDE_NAME_DETAILS)){
+//            setPreferredNameDetailsConfiguration(config, false);
+//        }
+//    }
 
 
 
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/CommonNameNamedAreaSelectionDialog.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/CommonNameNamedAreaSelectionDialog.java
index edd90b8c9..adfefd356 100755
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/CommonNameNamedAreaSelectionDialog.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/CommonNameNamedAreaSelectionDialog.java
@@ -22,7 +22,6 @@ import eu.etaxonomy.cdm.model.location.NamedArea;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
 import eu.etaxonomy.taxeditor.preference.CdmPreferenceCache;
-import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -49,7 +48,7 @@ public class CommonNameNamedAreaSelectionDialog extends NamedAreaSelectionDialog
     }
 
     private static UUID[] createVocabularyUuidList() {
-        String preselectedVocString = PreferencesUtil.getStringValue(IPreferenceKeys.COMMON_NAME_AREA_VOCABULARIES);
+        String preselectedVocString = PreferencesUtil.getStringValue(PreferencePredicate.CommonNameAreaVocabularies.getKey());
         if (StringUtils.isBlank(preselectedVocString)){
             return null;
         }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NamedAreaSelectionDialog.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NamedAreaSelectionDialog.java
index e691294e4..ab9d78106 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NamedAreaSelectionDialog.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NamedAreaSelectionDialog.java
@@ -13,7 +13,6 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.UUID;
 
-import org.apache.commons.lang.StringUtils;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.dialogs.Dialog;
@@ -30,8 +29,6 @@ import eu.etaxonomy.cdm.model.common.DefinedTermBase;
 import eu.etaxonomy.cdm.model.common.TermType;
 import eu.etaxonomy.cdm.model.common.TermVocabulary;
 import eu.etaxonomy.cdm.model.location.NamedArea;
-import eu.etaxonomy.cdm.model.metadata.CdmPreference;
-import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
 import eu.etaxonomy.taxeditor.model.ImageResources;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
@@ -102,19 +99,16 @@ public class NamedAreaSelectionDialog extends
 
 		selectedVocabularies = new ArrayList<TermVocabulary>();
 		this.preferenceID = preferenceId;
-		if (preselectedVocabularyUuids == null || preselectedVocabularyUuids.length == 0){
-		    preselectedVocabularyUuids = createVocabularyUuidList();
-		}
-		if (preselectedVocabularyUuids != null){
+
+		if (preselectedVocabularyUuids != null && preselectedVocabularyUuids.length > 0){
     		for(int i=0;i<preselectedVocabularyUuids.length;i++){
     			TermVocabulary preselectedVocabulary = CdmStore.getService(IVocabularyService.class).find(preselectedVocabularyUuids[i]);
     			selectedVocabularies.add(preselectedVocabulary);
     		}
+		}else{
+		    selectedVocabularies = createSelectedVocabularies();
 		}
 
-
-		selectedVocabularies = createSelectedVocabularies();
-
 	}
 
     protected List<TermVocabulary> createSelectedVocabularies() {
@@ -128,20 +122,20 @@ public class NamedAreaSelectionDialog extends
         return tempSelectedVocabularies;
     }
 
-    private static UUID[] createVocabularyUuidList() {
-        String preselectedVocString = PreferencesUtil.getStringValue(PreferencePredicate.AvailableDistributionAreaVocabularies.getKey());
-        if (StringUtils.isBlank(preselectedVocString)){
-            return null;
-        }
-        String[] preselectedVocArray = preselectedVocString.split(";");
-        UUID[] uuidList = new UUID[preselectedVocArray.length];
-        int i = 0;
-        for (String uuidString: preselectedVocArray){
-            uuidList[i]= UUID.fromString(uuidString);
-            i++;
-        }
-        return uuidList;
-    }
+//    private static UUID[] createVocabularyUuidList() {
+//        String preselectedVocString = PreferencesUtil.getStringValue(PreferencePredicate.AvailableDistributionAreaVocabularies.getKey());
+//        if (StringUtils.isBlank(preselectedVocString)){
+//            return null;
+//        }
+//        String[] preselectedVocArray = preselectedVocString.split(";");
+//        UUID[] uuidList = new UUID[preselectedVocArray.length];
+//        int i = 0;
+//        for (String uuidString: preselectedVocArray){
+//            uuidList[i]= UUID.fromString(uuidString);
+//            i++;
+//        }
+//        return uuidList;
+//    }
 
 
 	private String getPrefKey(TermVocabulary vocabulary){
@@ -169,17 +163,17 @@ public class NamedAreaSelectionDialog extends
 	private List<TermVocabulary> getAvailableVocabularies(){
 	    vocabularies = new ArrayList();
 	    CdmPreferenceCache cache = CdmPreferenceCache.instance();
-        CdmPreference pref = cache.get(PreferencePredicate.AvailableDistributionAreaVocabularies.getKey());
-	    if (pref != null && !pref.isAllowOverride()){
-            UUID[] preselectedVocabularyUuids = createVocabularyUuidList();
-
-            for(int i=0;i<preselectedVocabularyUuids.length;i++){
-                TermVocabulary preselectedVocabulary = CdmStore.getService(IVocabularyService.class).find(preselectedVocabularyUuids[i]);
-                vocabularies.add(preselectedVocabulary);
-            }
-        }else{
+//        CdmPreference pref = cache.get(PreferencePredicate.AvailableDistributionAreaVocabularies.getKey());
+//	    if (pref != null && !pref.isAllowOverride()){
+//            UUID[] preselectedVocabularyUuids = createVocabularyUuidList();
+//
+//            for(int i=0;i<preselectedVocabularyUuids.length;i++){
+//                TermVocabulary preselectedVocabulary = CdmStore.getService(IVocabularyService.class).find(preselectedVocabularyUuids[i]);
+//                vocabularies.add(preselectedVocabulary);
+//            }
+//        }else{
             vocabularies = CdmStore.getService(IVocabularyService.class).listByTermType(TermType.NamedArea, true, null, null, null, null);
-        }
+//        }
 		//List<TermVocabulary> vocabularies = CdmStore.getService(IVocabularyService.class).listByTermType(TermType.NamedArea, true, null, null, null, null);
 		return vocabularies;
 	}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/details/DetailsViewerE4.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/details/DetailsViewerE4.java
index dc1e83d34..c1bcb4d45 100755
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/details/DetailsViewerE4.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/details/DetailsViewerE4.java
@@ -423,7 +423,7 @@ public class DetailsViewerE4 extends AbstractCdmDataViewerE4 {
     }
 
     private void createTaxonSections(RootElement parent) {
-        NameDetailsConfigurator config = PreferencesUtil.getPreferredNameDetailsConfiguration(true);
+        NameDetailsConfigurator config = PreferencesUtil.getPreferredNameDetailsConfiguration();
         ParsingMessagesSection parsingMessagesSection = formFactory.createParsingMessagesSection(getConversationHolder(), parent, this,
                 getSectionStyle(ParsingMessagesSection.class, true));
         if (!config.isSimpleDetailsViewActivated()){
