commit dd2e9b758ce6b222a712bfd71521fd30d4d70f7c
Author: Katja Luther <k.luther@bgbm.org>
Date:   Mon Feb 11 14:22:32 2019 +0100

    ref #7849: default values in local preferences

diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/ChecklistEditorGeneralAdminPreference.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/ChecklistEditorGeneralAdminPreference.java
index c08249d6f..5867e5d99 100755
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/ChecklistEditorGeneralAdminPreference.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/ChecklistEditorGeneralAdminPreference.java
@@ -29,8 +29,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 public class ChecklistEditorGeneralAdminPreference extends ChecklistEditorGeneralPreference implements IE4AdminPreferencePage {
 
     Composite parent;
-    CdmPreference areaVocPref = null;
-    CdmPreference statusPref = null;
+
 
     @Override
     protected Control createContents(Composite parent) {
@@ -151,97 +150,6 @@ public class ChecklistEditorGeneralAdminPreference extends ChecklistEditorGenera
         setValid(false);
     }
 
-    @Override
-    protected void performDefaults() {
-        isEditorActivated = (Boolean)PreferencePredicate.DistributionEditorActivated.getDefaultValue();
-        activateCheckButton.setSelection(isEditorActivated);
-
-        displayArea = ((TermDisplayEnum)PreferencePredicate.DisplayOfAreasInDistributionEditor.getDefaultValue()).getKey();
-        TermDisplayEnum areaDisplay;
-        try{
-            if (displayArea != null){
-                areaDisplay  = TermDisplayEnum.byKey(displayArea);
-            }else{
-                areaDisplay = TermDisplayEnum.Title;
-            }
-        }catch(IllegalArgumentException e){
-            areaDisplay = TermDisplayEnum.Title;
-        }
-        int index = 0;
-        for (String itemLabel : areaDisplaySelectionCombo.getItems()){
-            if (itemLabel.equalsIgnoreCase(areaDisplay.getLabel())){
-                areaDisplaySelectionCombo.select(index);
-                break;
-            }
-            index++;
-        }
-
-        displayStatus = ((TermDisplayEnum)PreferencePredicate.DisplayOfStatus.getDefaultValue()).getKey();
-        TermDisplayEnum statusDisplay;
-        try{
-            if (displayStatus != null){
-                statusDisplay  = TermDisplayEnum.byKey(displayStatus);
-            }else{
-                statusDisplay = TermDisplayEnum.Title;
-            }
-        }catch(IllegalArgumentException e){
-            statusDisplay = TermDisplayEnum.Title;
-        }
-        index = 0;
-        for (String itemLabel : statusDisplaySelectionCombo.getItems()){
-            if (itemLabel.equalsIgnoreCase(statusDisplay.getLabel())){
-                statusDisplaySelectionCombo.select(index);
-                break;
-            }
-            index++;
-        }
-
-
-
-        orderAreas = ((TermOrder)PreferencePredicate.AreasSortedInDistributionEditor.getDefaultValue()).getKey();
-        index = 0;
-        if (PreferencesUtil.getStringValue(PreferencePredicate.DistributionEditorActivated.getKey()) != null){
-            TermOrder areaOrder;
-            try{
-                if (orderAreas != null){
-                    areaOrder  = TermOrder.valueOf(orderAreas);
-                }else{
-                    areaOrder = TermOrder.IdInVoc;
-                }
-            }catch(IllegalArgumentException e){
-                areaOrder = TermOrder.IdInVoc;
-            }
-            for (String itemLabel : areaOrderSelectionCombo.getItems()){
-                if (itemLabel.equalsIgnoreCase(areaOrder.getLabel())){
-                    areaOrderSelectionCombo.select(index);
-                    break;
-                }
-                index++;
-            }
-        }
-
-
-        isShowRank = Boolean.valueOf(PreferencePredicate.ShowRankInDistributionEditor.getDefaultValue().toString());
-        activateRankButton.setSelection(isShowRank);
 
-        ownDescriptionForDistributionEditor = Boolean.valueOf(PreferencePredicate.OwnDescriptionForDistributionEditor.getDefaultValue().toString());
-
-        allowOverrideActivated = true;
-        allowOverrideActivatedButton.setSelection(allowOverrideActivated);
-        allowOverrideAreaDisplay = true;
-        allowOverrideAreaDisplayButton.setSelection(allowOverrideAreaDisplay);
-        allowOverrideStatusDisplay = true;
-        allowOverrideStatusDisplayButton.setSelection(allowOverrideStatusDisplay);
-        allowOverrideOrderAreas = true;
-        allowOverrideOrderAreasButton.setSelection(allowOverrideOrderAreas);
-        allowOverrideRank = true;
-        allowOverrideRankButton.setSelection(allowOverrideRank);
-        allowOverrideOwnDescriptionForDistributionEditor = true;
-        createContents(parent);
-
-        this.statusPref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.AvailableDistributionStatus, null);
-        this.areaVocPref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.AvailableDistributionAreaVocabularies, null);
-        super.performDefaults();
-    }
 
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/NameDetailsViewAdminConfiguration.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/NameDetailsViewAdminConfiguration.java
index 5116493d8..10e986a3d 100755
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/NameDetailsViewAdminConfiguration.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/NameDetailsViewAdminConfiguration.java
@@ -90,30 +90,7 @@ public class NameDetailsViewAdminConfiguration extends NameDetailsViewConfigurat
 
     }
 
-    @Override
-    protected void performDefaults() {
-        nameDetailsConfig = new NameDetailsConfigurator(false);
-        isShowAppendedPhrase = nameDetailsConfig.isAppendedPhraseActivated();
-        isShowEpithets = nameDetailsConfig.isAtomisedEpithetsActivated();
-        isShowAuthorship = nameDetailsConfig.isAuthorshipSectionActivated();
-        isShowAuthorCache = nameDetailsConfig.isAuthorCacheActivated();
-        isShowLSID = nameDetailsConfig.isLSIDActivated();
-        isShowNameApprobiation = nameDetailsConfig.isNameApprobiationActivated();
-        isShowNameCache = nameDetailsConfig.isNameCacheActivated();
-        isShowNameRelationship = nameDetailsConfig.isNameRelationsSectionActivated();
-        isShowNomenclaturalCode = nameDetailsConfig.isNomenclaturalCodeActived();
-        isShowNomenclaturalStatus = nameDetailsConfig.isNomenclaturalStatusSectionActivated();
-        isShowNomenclaturalRef = nameDetailsConfig.isNomenclaturalReferenceSectionActivated();
-        isShowProtologue = nameDetailsConfig.isProtologueActivated();
-        isShowRank = nameDetailsConfig.isRankActivated();
-        isShowTaxon = nameDetailsConfig.isTaxonSectionActivated();
-        isSecDetailsActivated = nameDetailsConfig.isSecDetailsActivated();
-        isSecEnabled = nameDetailsConfig.isSecEnabled();
-        isShowTypeDesignation = nameDetailsConfig.isTypeDesignationSectionActivated();
-        isShowHybrid = nameDetailsConfig.isHybridActivated();
-        this.setButtonSelections();
-        super.performDefaults();
-    }
+
 
 
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/PublishFlagPreference.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/PublishFlagPreference.java
index 36abe1e90..7eda2bcde 100755
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/PublishFlagPreference.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/PublishFlagPreference.java
@@ -73,21 +73,7 @@ public class PublishFlagPreference extends PublishFlagLocalPreference implements
         publishBehaviour = PublishEnum.valueOf(pref.getValue());
     }
 
-    @Override
-    protected void performDefaults() {
-        publishBehaviour = (PublishEnum)PreferencePredicate.DefaultBehaviourForPublishFlag.getDefaultValue();
-        allowOverride = true;
-        int index = 0;
-        for (String itemLabel : publishFlagBehaviour.getItems()){
-            if (itemLabel.equalsIgnoreCase(publishBehaviour.getLabel())){
-                publishFlagBehaviour.select(index);
-                break;
-            }
-            index++;
-        }
 
-        super.performDefaults();
-    }
 
 
 
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/SpecimenAdminPreferences.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/SpecimenAdminPreferences.java
index 8bf2b3f44..4310b5c0b 100755
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/SpecimenAdminPreferences.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/SpecimenAdminPreferences.java
@@ -134,39 +134,4 @@ public class SpecimenAdminPreferences extends SpecimenOrObservationPreferences i
         return true;
     }
 
-    @Override
-    protected void performDefaults() {
-        isShowSpecimenRelatedIssues = (Boolean)PreferencePredicate.ShowSpecimen.getDefaultValue();
-        showSpecimenButton.setSelection(isShowSpecimenRelatedIssues);
-
-        allowOverrideShowSpecimenRelatedIssues = true;
-        allowOverrideIsShowSpecimenRelatedIssuesButton.setSelection(allowOverrideShowSpecimenRelatedIssues);
-
-        isShowCollectingAreaInGeneralSection = (Boolean)PreferencePredicate.ShowCollectingAreasInGeneralSection.getDefaultValue();
-        showCollectingAreaInGeneralSectionButton.setSelection(isShowCollectingAreaInGeneralSection);
-
-        allowOverrideShowCollectingAreaInGeneralSection = true;
-        allowOverrideShowCollectingAreaButton.setSelection(allowOverrideShowCollectingAreaInGeneralSection);
-
-        isDeterminationOnlyForFieldUnits = (Boolean) PreferencePredicate.DeterminationOnlyForFieldUnits.getDefaultValue();
-        determinationOnlyForFieldUnitsButton.setSelection(isDeterminationOnlyForFieldUnits);
-
-        allowOverrideDeterminationOnlyForFieldUnits = true;
-        allowOverridesDeterminationOnlyForFieldUnitsButton.setSelection(allowOverrideDeterminationOnlyForFieldUnits);
-
-        isShowTaxonAssociation = (Boolean) PreferencePredicate.ShowTaxonAssociations.getDefaultValue();
-        showTaxonAssociationButton.setSelection(isShowTaxonAssociation);
-
-        allowOverrideShowTaxonAssociation = true;
-        allowOverrideIsShowTaxonAssociationButton.setSelection(allowOverrideShowTaxonAssociation);
-
-        isShowLifeForm = (Boolean) PreferencePredicate.ShowLifeForm.getDefaultValue();
-        showLifeFormButton.setSelection(isShowLifeForm);
-
-        allowOverrideShowLifeForm = true;
-        allowOverrideShowLifeFormButton.setSelection(allowOverrideShowLifeForm);
-
-        super.performDefaults();
-    }
-
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/ChecklistEditorGeneralPreference.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/ChecklistEditorGeneralPreference.java
index 8b2b918b9..46d67a18a 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/ChecklistEditorGeneralPreference.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/ChecklistEditorGeneralPreference.java
@@ -26,6 +26,7 @@ import org.eclipse.swt.widgets.Listener;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference;
 import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
 import eu.etaxonomy.cdm.model.metadata.TermDisplayEnum;
+import eu.etaxonomy.cdm.model.metadata.TermOrder;
 import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.preference.menu.CdmPreferencePage;
 import eu.etaxonomy.taxeditor.ui.element.CommandHandlerButton;
@@ -81,6 +82,9 @@ public class ChecklistEditorGeneralPreference extends CdmPreferencePage implemen
     protected Button activateRankButton;
     protected Button allowOverrideRankButton;
 
+    protected CdmPreference areaVocPref = null;
+    protected CdmPreference statusPref = null;
+
     @Override
     protected Control createContents(Composite parent) {
         getValues();
@@ -500,7 +504,14 @@ public class ChecklistEditorGeneralPreference extends CdmPreferencePage implemen
             PreferencesUtil.setOwnDescriptionForChecklistEditor(ownDescriptionForDistributionEditor);
             PreferencesUtil.setBooleanValue(PreferencesUtil.prefOverrideKey(PreferencePredicate.OwnDescriptionForDistributionEditor.getKey()), overrideOwnDescriptionForDistributionEditor);
 
-
+            if (statusPref != null){
+                PreferencesUtil.setStringValue(PreferencePredicate.AvailableDistributionStatus.getKey(), statusPref.getValue());
+                PreferencesUtil.setBooleanValue(PreferencesUtil.prefOverrideKey(PreferencePredicate.AvailableDistributionStatus.getKey()), true);
+            }
+            if (areaVocPref != null){
+                PreferencesUtil.setStringValue(PreferencePredicate.AvailableDistributionAreaVocabularies.getKey(), areaVocPref.getValue());
+                PreferencesUtil.setBooleanValue(PreferencesUtil.prefOverrideKey(PreferencePredicate.AvailableDistributionAreaVocabularies.getKey()), true);
+            }
 
 
         }
@@ -625,7 +636,7 @@ public class ChecklistEditorGeneralPreference extends CdmPreferencePage implemen
                 if (pref.getValue() != null){
                     orderAreas = pref.getValue().toString();
                 }else{
-                    orderAreas = PreferencePredicate.AreasSortedInDistributionEditor.getDefaultValue().toString();
+                    orderAreas = ((TermOrder)PreferencePredicate.AreasSortedInDistributionEditor.getDefaultValue()).getKey();
                 }
             }
         }else{
@@ -672,5 +683,103 @@ public class ChecklistEditorGeneralPreference extends CdmPreferencePage implemen
 
     }
 
+    @Override
+    protected void performDefaults() {
+        isEditorActivated = (Boolean)PreferencePredicate.DistributionEditorActivated.getDefaultValue();
+        activateCheckButton.setSelection(isEditorActivated);
+
+        displayArea = ((TermDisplayEnum)PreferencePredicate.DisplayOfAreasInDistributionEditor.getDefaultValue()).getKey();
+        TermDisplayEnum areaDisplay;
+        try{
+            if (displayArea != null){
+                areaDisplay  = TermDisplayEnum.byKey(displayArea);
+            }else{
+                areaDisplay = TermDisplayEnum.Title;
+            }
+        }catch(IllegalArgumentException e){
+            areaDisplay = TermDisplayEnum.Title;
+        }
+        int index = 0;
+        for (String itemLabel : areaDisplaySelectionCombo.getItems()){
+            if (itemLabel.equalsIgnoreCase(areaDisplay.getLabel())){
+                areaDisplaySelectionCombo.select(index);
+                break;
+            }
+            index++;
+        }
+
+        displayStatus = ((TermDisplayEnum)PreferencePredicate.DisplayOfStatus.getDefaultValue()).getKey();
+        TermDisplayEnum statusDisplay;
+        try{
+            if (displayStatus != null){
+                statusDisplay  = TermDisplayEnum.byKey(displayStatus);
+            }else{
+                statusDisplay = TermDisplayEnum.Title;
+            }
+        }catch(IllegalArgumentException e){
+            statusDisplay = TermDisplayEnum.Title;
+        }
+        index = 0;
+        for (String itemLabel : statusDisplaySelectionCombo.getItems()){
+            if (itemLabel.equalsIgnoreCase(statusDisplay.getLabel())){
+                statusDisplaySelectionCombo.select(index);
+                break;
+            }
+            index++;
+        }
+
+
+
+        orderAreas = ((TermOrder)PreferencePredicate.AreasSortedInDistributionEditor.getDefaultValue()).getKey();
+        index = 0;
+        if (PreferencesUtil.getStringValue(PreferencePredicate.DistributionEditorActivated.getKey()) != null){
+            TermOrder areaOrder;
+            try{
+                if (orderAreas != null){
+                    areaOrder  = TermOrder.valueOf(orderAreas);
+                }else{
+                    areaOrder = TermOrder.IdInVoc;
+                }
+            }catch(IllegalArgumentException e){
+                areaOrder = TermOrder.IdInVoc;
+            }
+            for (String itemLabel : areaOrderSelectionCombo.getItems()){
+                if (itemLabel.equalsIgnoreCase(areaOrder.getLabel())){
+                    areaOrderSelectionCombo.select(index);
+                    break;
+                }
+                index++;
+            }
+        }
+
+
+        isShowRank = Boolean.valueOf(PreferencePredicate.ShowRankInDistributionEditor.getDefaultValue().toString());
+        activateRankButton.setSelection(isShowRank);
+
+        ownDescriptionForDistributionEditor = Boolean.valueOf(PreferencePredicate.OwnDescriptionForDistributionEditor.getDefaultValue().toString());
+
+        allowOverrideActivated = true;
+        allowOverrideActivatedButton.setSelection(allowOverrideActivated);
+        overrideActivated = true;
+        allowOverrideAreaDisplay = true;
+        overrideAreaDisplay = true;
+        allowOverrideAreaDisplayButton.setSelection(allowOverrideAreaDisplay);
+        allowOverrideStatusDisplay = true;
+        overrideStatusDisplay = true;
+        allowOverrideStatusDisplayButton.setSelection(allowOverrideStatusDisplay);
+        allowOverrideOrderAreas = true;
+        overrideOrderAreas = true;
+        allowOverrideOrderAreasButton.setSelection(allowOverrideOrderAreas);
+        allowOverrideRank = true;
+        overrideRank = true;
+        allowOverrideRankButton.setSelection(allowOverrideRank);
+        allowOverrideOwnDescriptionForDistributionEditor = true;
+        overrideOwnDescriptionForDistributionEditor = true;
+
+        this.statusPref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.AvailableDistributionStatus, null);
+        this.areaVocPref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.AvailableDistributionAreaVocabularies, null);
+        super.performDefaults();
+    }
+
 
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/CommonNameVocabularySelection.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/CommonNameVocabularySelection.java
index 604c515e0..6809bbc5d 100755
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/CommonNameVocabularySelection.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/CommonNameVocabularySelection.java
@@ -114,6 +114,12 @@ public class CommonNameVocabularySelection extends CdmPreferencePage implements
         }
     }
 
+    @Override
+    protected void performDefaults() {
+
+        super.performDefaults();
+    }
+
 
 
 
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/ExternalServicesPreferences.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/ExternalServicesPreferences.java
index 1bb65ccf9..8697ae817 100755
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/ExternalServicesPreferences.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/ExternalServicesPreferences.java
@@ -102,5 +102,14 @@ public class ExternalServicesPreferences extends CdmPreferencePage {
 
     }
 
+    @Override
+    protected void performDefaults() {
+        openUrl.presentsDefaultValue();
+        maxHeight.presentsDefaultValue();
+        maxWidth.presentsDefaultValue();
+        mapService.presentsDefaultValue();
+        super.performDefaults();
+    }
+
 
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/MediaPreferences.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/MediaPreferences.java
index addb9d523..7b09db431 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/MediaPreferences.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/MediaPreferences.java
@@ -52,6 +52,13 @@ public class MediaPreferences extends CdmPreferencePage {
 
     }
 
+    @Override
+    protected void performDefaults() {
+        advanced.presentsDefaultValue();
+        preview.presentsDefaultValue();
+        super.performDefaults();
+    }
+
 
 
 
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/OrderPreferences.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/OrderPreferences.java
index 06d730c23..adf8377c2 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/OrderPreferences.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/OrderPreferences.java
@@ -24,6 +24,7 @@ public class OrderPreferences extends CdmPreferencePage implements SelectionList
 	    boolean isRestoreTaxonNavigator;
 	    boolean isSelectionChanged = false;
 	    boolean isStrictlyAlphabeticallyOrdered;
+	    Button activateRestoreNavigatorButton;
 
 	    @Override
 	    protected Control createContents(Composite parent) {
@@ -33,7 +34,7 @@ public class OrderPreferences extends CdmPreferencePage implements SelectionList
             Composite secondComposite = new Composite(parent, SWT.NULL);
             secondComposite.setLayout(new GridLayout());
 
-            final Button activateRestoreNavigatorButton = new Button(secondComposite, SWT.CHECK | SWT.LEFT);
+            activateRestoreNavigatorButton = new Button(secondComposite, SWT.CHECK | SWT.LEFT);
             activateRestoreNavigatorButton.setText(Messages.OrderPreferences_Restore);
             activateRestoreNavigatorButton.setSelection(isRestoreTaxonNavigator);
             activateRestoreNavigatorButton.addSelectionListener(new SelectionAdapter(){
@@ -125,5 +126,21 @@ public class OrderPreferences extends CdmPreferencePage implements SelectionList
 
         }
 
+        @Override
+        protected void performDefaults() {
+            activateRestoreNavigatorButton.setSelection(false);
+            isRestoreTaxonNavigator = false;
+            orderActivated = NavigatorOrderEnum.RankAndNameOrder;
+            int index = 0;
+            for (String itemLabel : orderSelectionCombo.getItems()){
+                if (itemLabel.equalsIgnoreCase(orderActivated.getLabel())){
+                    orderSelectionCombo.select(index);
+                    break;
+                }
+                index++;
+            }
+            super.performDefaults();
+        }
+
 
 }
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 a41c70a2e..a96a2b2bd 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
@@ -846,6 +846,10 @@ public class PreferencesUtil implements IPreferenceKeys {
 		getPreferenceStore().setDefault(createPreferenceString(SORT_NODES), NavigatorOrderEnum.RankAndNameOrder.getKey());
 
 		getPreferenceStore().setDefault(createPreferenceString(SORT_TAXA_BY_RANK_AND_NAME), true);
+
+		getPreferenceStore().setDefault(createPreferenceString(SHOW_ADVANCED_MEDIA_SECTION), false);
+
+        getPreferenceStore().setDefault(createPreferenceString(SHOW_MEDIA_PREVIEW), false);
 		//override db preferences
 		getPreferenceStore().setDefault(createPreferenceString(prefOverrideKey(PreferencePredicate.AbcdImportConfig.getKey())), false);
 		getPreferenceStore().setDefault(createPreferenceString(prefOverrideKey(PreferencePredicate.ShowSpecimen.getKey())), true);
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PublishFlagLocalPreference.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PublishFlagLocalPreference.java
index 3749cde62..995571d16 100755
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PublishFlagLocalPreference.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PublishFlagLocalPreference.java
@@ -35,6 +35,7 @@ public class PublishFlagLocalPreference extends CdmPreferencePage {
 
     protected Combo publishFlagBehaviour;
     protected CdmPreference pref = null;
+    Button allowOverrideButton;
 
     protected boolean allowOverride;
 
@@ -87,7 +88,7 @@ public class PublishFlagLocalPreference extends CdmPreferencePage {
 
             }
         });
-        Button allowOverrideButton = createAllowOverrideButton(composite);
+        allowOverrideButton = createAllowOverrideButton(composite);
         allowOverrideButton.setText(Messages.GeneralPreference_override);
         allowOverrideButton.setSelection(allowOverride);
         allowOverrideButton.addSelectionListener(new SelectionAdapter(){
@@ -140,5 +141,21 @@ public class PublishFlagLocalPreference extends CdmPreferencePage {
         }
     }
 
+    @Override
+    protected void performDefaults() {
+        publishBehaviour = (PublishEnum)PreferencePredicate.DefaultBehaviourForPublishFlag.getDefaultValue();
+        allowOverride = true;
+        int index = 0;
+        for (String itemLabel : publishFlagBehaviour.getItems()){
+            if (itemLabel.equalsIgnoreCase(publishBehaviour.getLabel())){
+                publishFlagBehaviour.select(index);
+                break;
+            }
+            index++;
+        }
+
+        super.performDefaults();
+    }
+
 
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/SpecimenOrObservationPreferences.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/SpecimenOrObservationPreferences.java
index d140767a8..e7fa8a777 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/SpecimenOrObservationPreferences.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/SpecimenOrObservationPreferences.java
@@ -372,4 +372,41 @@ public class SpecimenOrObservationPreferences extends CdmPreferencePage {
     }
 
 
+
+    @Override
+    protected void performDefaults() {
+        isShowSpecimenRelatedIssues = (Boolean)PreferencePredicate.ShowSpecimen.getDefaultValue();
+        showSpecimenButton.setSelection(isShowSpecimenRelatedIssues);
+
+        allowOverrideShowSpecimenRelatedIssues = true;
+        allowOverrideIsShowSpecimenRelatedIssuesButton.setSelection(allowOverrideShowSpecimenRelatedIssues);
+
+        isShowCollectingAreaInGeneralSection = (Boolean)PreferencePredicate.ShowCollectingAreasInGeneralSection.getDefaultValue();
+        showCollectingAreaInGeneralSectionButton.setSelection(isShowCollectingAreaInGeneralSection);
+
+        allowOverrideShowCollectingAreaInGeneralSection = true;
+        allowOverrideShowCollectingAreaButton.setSelection(allowOverrideShowCollectingAreaInGeneralSection);
+
+        isDeterminationOnlyForFieldUnits = (Boolean) PreferencePredicate.DeterminationOnlyForFieldUnits.getDefaultValue();
+        determinationOnlyForFieldUnitsButton.setSelection(isDeterminationOnlyForFieldUnits);
+
+        allowOverrideDeterminationOnlyForFieldUnits = true;
+        allowOverridesDeterminationOnlyForFieldUnitsButton.setSelection(allowOverrideDeterminationOnlyForFieldUnits);
+
+        isShowTaxonAssociation = (Boolean) PreferencePredicate.ShowTaxonAssociations.getDefaultValue();
+        showTaxonAssociationButton.setSelection(isShowTaxonAssociation);
+
+        allowOverrideShowTaxonAssociation = true;
+        allowOverrideIsShowTaxonAssociationButton.setSelection(allowOverrideShowTaxonAssociation);
+
+        isShowLifeForm = (Boolean) PreferencePredicate.ShowLifeForm.getDefaultValue();
+        showLifeFormButton.setSelection(isShowLifeForm);
+
+        allowOverrideShowLifeForm = true;
+        allowOverrideShowLifeFormButton.setSelection(allowOverrideShowLifeForm);
+
+        super.performDefaults();
+    }
+
+
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AbstractAdminTermSelectionWizardPage.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AbstractAdminTermSelectionWizardPage.java
index e55582ccb..2e99dc43c 100755
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AbstractAdminTermSelectionWizardPage.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AbstractAdminTermSelectionWizardPage.java
@@ -16,6 +16,7 @@ import org.eclipse.swt.widgets.Composite;
 
 import eu.etaxonomy.cdm.model.common.TermType;
 import eu.etaxonomy.cdm.model.metadata.CdmPreference;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
 
 /**
@@ -33,8 +34,12 @@ public abstract class AbstractAdminTermSelectionWizardPage extends AbstractTermS
     protected AbstractAdminTermSelectionWizardPage(String pageName, TermType type, CdmPreference pref) {
         super(pageName, type);
         this.pref = pref;
+        if (localPref){
+            this.override = PreferencesUtil.getBooleanValue(PreferencesUtil.createOverridePreferenceString(pref.getPredicate()));
+        }else{
+            this.override = pref != null? this.pref.isAllowOverride(): true;
+        }
 
-        this.override = pref != null? this.pref.isAllowOverride(): true;
     }
 
     CdmPreference pref;
@@ -48,15 +53,19 @@ public abstract class AbstractAdminTermSelectionWizardPage extends AbstractTermS
         final Button activateCheckButton = new Button(parent, SWT.CHECK);
        if (localPref){
            activateCheckButton.setText("Override");
+           activateCheckButton.setSelection(override);
        }else{
            activateCheckButton.setText("Allow Override");
+           activateCheckButton.setSelection(pref.isAllowOverride());
        }
-       activateCheckButton.setSelection(pref.isAllowOverride());
+
+
 
         activateCheckButton.addSelectionListener(new SelectionAdapter(){
                 @Override
                 public void widgetSelected(SelectionEvent e) {
                     pref.setAllowOverride(activateCheckButton.getSelection());
+                    override = activateCheckButton.getSelection();
 
                 }
             });
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AbstractTermSelectionWizardPage.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AbstractTermSelectionWizardPage.java
index e74143834..bf3e7b76c 100755
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AbstractTermSelectionWizardPage.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AbstractTermSelectionWizardPage.java
@@ -53,6 +53,7 @@ public abstract class AbstractTermSelectionWizardPage extends WizardPage {
         // TODO check if configuration exists
        // CdmStore.getCurrentSessionManager().bindNullSession();
         this.type = type;
+
     }
 
     @Override
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableAreaVocabulariesPage.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableAreaVocabulariesPage.java
index ebc2a18e3..eb6a6a069 100755
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableAreaVocabulariesPage.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableAreaVocabulariesPage.java
@@ -68,6 +68,7 @@ public class AvailableAreaVocabulariesPage  extends AbstractAdminTermSelectionWi
             if (StringUtils.isBlank(vocString) && pref != null){
                 vocString = pref.getValue();
             }
+            this.override = PreferencesUtil.getBooleanValue(PreferencesUtil.createOverridePreferenceString(pref.getPredicate()));
         }else if (pref != null){
             vocString = pref.getValue();
         }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionStatusPage.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionStatusPage.java
index 1a79af685..5bc002caa 100755
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionStatusPage.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionStatusPage.java
@@ -44,7 +44,8 @@ public class AvailableDistributionStatusPage extends AbstractAdminTermSelectionW
         setTitle(Messages.AvailableDistributionStatusPage_PAGE_TITLE);
         setDescription(Messages.AvailableDistributionStatusPage_PAGE_DESCRIPTION);
         //if (!localPref){
-            createAllowOverrideButton(parent);
+        override = PreferencesUtil.getBooleanValue(PreferencesUtil.createOverridePreferenceString(PreferencePredicate.AvailableDistributionStatus.getKey()));
+        createAllowOverrideButton(parent);
         //}
         super.createControl(parent);
 
@@ -58,6 +59,7 @@ public class AvailableDistributionStatusPage extends AbstractAdminTermSelectionW
            if (StringUtils.isBlank(checkedValues) && pref != null){
                checkedValues = pref.getValue();
            }
+
         }else {
             checkedValues = pref.getValue();
         }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionStatusWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionStatusWizard.java
index f621419ff..009f6d7b0 100755
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionStatusWizard.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionStatusWizard.java
@@ -100,7 +100,7 @@ public class AvailableDistributionStatusWizard extends Wizard implements IConver
         String saveCheckedElements = StringUtils.join(listUIIDChecked, ";"); //$NON-NLS-1$
 
         PreferencesUtil.setStringValue(PreferencePredicate.AvailableDistributionStatus.getKey(), saveCheckedElements);
-        PreferencesUtil.setBooleanValue(PreferencesUtil.createOverridePreferenceString(PreferencePredicate.AvailableDistributionStatus.getKey()), true);
+        PreferencesUtil.setBooleanValue(PreferencesUtil.createOverridePreferenceString(PreferencePredicate.AvailableDistributionStatus.getKey()), aPage.override);
         PreferencesUtil.firePreferencesChanged(this.getClass());
         return true;
     }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableVocabularyWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableVocabularyWizard.java
index c82d70ec1..6aae721f4 100755
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableVocabularyWizard.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableVocabularyWizard.java
@@ -97,13 +97,16 @@ public class AvailableVocabularyWizard extends Wizard implements IConversationEn
             predicate = pref.getPredicate();
         }
 
-//        if (!localPref){
+        if (!localPref){
             CdmPreference savePref = CdmPreference.NewInstance(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.getByKey(predicate), saveCheckedElements);
             savePref.setAllowOverride(pref.isAllowOverride());
             PreferencesUtil.setPreferenceToDB(savePref);
 
             PreferencesUtil.updateDBPreferences();
-
+        }else{
+            PreferencesUtil.setStringValue(predicate, saveCheckedElements);
+            PreferencesUtil.setBooleanValue(PreferencesUtil.createOverridePreferenceString(predicate), this.aPage.override);
+        }
         return true;
     }
 
