Merge branch 'release/5.42.0'
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / preference / NameDetailsViewConfiguration.java
index fc7fd842d15fc69c17f3e3ec8f2aa5ad94873a48..907e072407947c248829149cc5f681ed1ff9a247 100644 (file)
@@ -10,7 +10,6 @@ import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Label;
@@ -23,15 +22,6 @@ import eu.etaxonomy.taxeditor.preference.menu.CdmPreferencePage;
 
 public class NameDetailsViewConfiguration extends CdmPreferencePage implements SelectionListener{
 
-    /**
-     *
-     */
-    private static final String DISABLE = "Disable";
-    /**
-     *
-     */
-    private static final String ENABLE = "Enable";
-    protected Boolean isSimpleDetailsViewActivated;
        boolean isUseLocalSettings;
        protected NameDetailsConfigurator nameDetailsConfig;
     Composite localSettings ;
@@ -51,6 +41,7 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
     protected boolean isShowNomenclaturalStatusRuleConsideredCodeEdition;
     protected boolean isShowNomenclaturalRef;
     protected boolean isShowAuthorship;
+    protected boolean isShowInAuthors;
     protected boolean isShowAuthorCache;
     protected boolean isShowEpithets;
     protected boolean isShowRank;
@@ -66,7 +57,7 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
     private Button showSecDetail;
     private Button secEnabled;
 
-    protected Combo activateCheckButton;
+  //  protected Combo activateCheckButton;
     protected Button allowLocalPreference;
     protected Button showTaxon;
     protected Button showLsid;
@@ -77,6 +68,7 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
     protected Button showEpithets;
     protected Button showAuthorCache;
     protected Button showAuthorship;
+    protected Button showInAuthors;
     protected Button showNomenclaturalRef;
     protected Button showNomenclaturalStatus;
     protected Button showNomenclaturalStatusRuleConsidered;
@@ -100,10 +92,6 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
             description.setText(Messages.NameDetailsViewConfiguration_description);
 
             Composite title  = createComposite(parent);
-//            nameDetailsConfig = PreferencesUtil.getPreferredNameDetailsConfiguration(!isAdminPreference);
-//
-
-            activateCheckButton = createBooleanCombo(title, ENABLE, DISABLE, PreferencePredicate.NameDetailsView, Messages.NameDetailsViewConfiguration_activateSimpleDetailsView, isAdminPreference);
             if (isAdminPreference){
                 allowLocalPreference = createAllowOverrideButton(title);
 
@@ -117,45 +105,13 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
 
             }
             dbSettings = new Composite(parent, SWT.NONE);
-
-//            activateCheckButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, true, 1, 1));
-//            activateCheckButton.setText(Messages.NameDetailsViewConfiguration_activateSimpleDetailsView);
-            if (nameDetailsConfig != null){
-                isSimpleDetailsViewActivated = nameDetailsConfig.isSimpleDetailsViewActivated();
-            }
-            if (nameDetailsConfig == null){
-              nameDetailsConfig = new NameDetailsConfigurator(false);
-            }
-            activateCheckButton.addSelectionListener(this);
-//            new SelectionAdapter(){
-//                @Override
-//                public void widgetSelected(SelectionEvent e) {
-//                    setApply(true);
-//                    isSimpleDetailsViewActivated = activateCheckButton.getSelectionIndex() == 0? true:false;
-//                    nameDetailsConfig.setSimpleDetailsViewActivated(isSimpleDetailsViewActivated);
-//                    dbSettings.setEnabled(isSimpleDetailsViewActivated);
-//                    PreferencesUtil.recursiveSetEnabled(dbSettings, isSimpleDetailsViewActivated);
-//                    if (isSimpleDetailsViewActivated){
-//                        showSecDetail.setEnabled(isShowTaxon);
-//                        secEnabled.setEnabled(isShowTaxon);
-//                    }
-//
-//                 }
-//             });
-
-
             dbSettings.setLayout(new GridLayout());
-            if (isSimpleDetailsViewActivated != null){
-                dbSettings.setEnabled(isSimpleDetailsViewActivated);
-            }else{
-                dbSettings.setEnabled(false);
-            }
-
 
             Label separator= new Label(dbSettings, SWT.HORIZONTAL | SWT.SEPARATOR);
             separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
             showTaxon = new Button(dbSettings, SWT.CHECK);
             showTaxon.setText(Messages.NameDetailsViewComposite_Show_Taxon);
+            showTaxon.addSelectionListener(this);
             isShowTaxon = nameDetailsConfig.isTaxonSectionActivated();
 
             showTaxon.addSelectionListener(new SelectionAdapter(){
@@ -164,11 +120,8 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
                      setApply(true);
                      isShowTaxon = showTaxon.getSelection();
                      nameDetailsConfig.setTaxonSectionActivated(isShowTaxon);
-                     if (isSimpleDetailsViewActivated!= null? isSimpleDetailsViewActivated:false){
-                         showSecDetail.setEnabled(isShowTaxon);
-                         secEnabled.setEnabled(isShowTaxon);
-                     }
-
+                     showSecDetail.setEnabled(isShowTaxon);
+                     secEnabled.setEnabled(isShowTaxon);
                   }
              });
 
@@ -177,13 +130,13 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
             GridLayoutFactory.fillDefaults().applyTo(taxonComp);
 
             GridData data = new GridData();
-            data.horizontalIndent = 7;
+            data.horizontalIndent = 10;
             data.horizontalAlignment = SWT.FILL;
             taxonComp.setLayoutData(data);
             GridLayoutFactory.fillDefaults().applyTo(taxonComp);
             secEnabled = new Button(taxonComp, SWT.CHECK);
             secEnabled.setText(Messages.NameDetailsViewComposite_SecEnabled);
-
+            secEnabled.addSelectionListener(this);
             isSecEnabled = nameDetailsConfig.isSecEnabled();
 
             secEnabled.addSelectionListener(new SelectionAdapter(){
@@ -196,7 +149,7 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
              });
             showSecDetail = new Button(taxonComp, SWT.CHECK);
             showSecDetail.setText(Messages.NameDetailsViewComposite_Show_SecDetail);
-
+            showSecDetail.addSelectionListener(this);
             isSecDetailsActivated = nameDetailsConfig.isSecDetailsActivated();
 
             showSecDetail.addSelectionListener(new SelectionAdapter(){
@@ -211,7 +164,7 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
             showLsid = new Button(dbSettings, SWT.CHECK);
             showLsid.setText(Messages.NameDetailsViewComposite_Show_LSID);
             isShowLSID = nameDetailsConfig.isLSIDActivated();
-
+            showLsid.addSelectionListener(this);
             showLsid.addSelectionListener(new SelectionAdapter(){
                  @Override
                  public void widgetSelected(SelectionEvent e) {
@@ -224,7 +177,7 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
             showNomenclaturalCode = new Button(dbSettings, SWT.CHECK);
             showNomenclaturalCode.setText(Messages.NameDetailsViewComposite_Show_NomenclaturalCode);
             isShowNomenclaturalCode = nameDetailsConfig.isNomenclaturalCodeActived();
-
+            showNomenclaturalCode.addSelectionListener(this);
             showNomenclaturalCode.addSelectionListener(new SelectionAdapter(){
                  @Override
                  public void widgetSelected(SelectionEvent e) {
@@ -237,7 +190,7 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
             showNameCache = new Button(dbSettings, SWT.CHECK);
             showNameCache.setText(Messages.NameDetailsViewComposite_Show_NameCache);
             isShowNameCache = nameDetailsConfig.isNameCacheActivated();
-
+            showNameCache.addSelectionListener(this);
             showNameCache.addSelectionListener(new SelectionAdapter(){
                  @Override
                  public void widgetSelected(SelectionEvent e) {
@@ -249,7 +202,7 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
             showAppendedPhrase = new Button(dbSettings, SWT.CHECK);
             isShowAppendedPhrase= nameDetailsConfig.isAppendedPhraseActivated();
             showAppendedPhrase.setText(Messages.NameDetailsViewComposite_Show_AppendedPhrase);
-
+            showAppendedPhrase.addSelectionListener(this);
             showAppendedPhrase.addSelectionListener(new SelectionAdapter(){
                  @Override
                  public void widgetSelected(SelectionEvent e) {
@@ -262,7 +215,7 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
             showRank = new Button(dbSettings, SWT.CHECK);
             isShowRank = nameDetailsConfig.isRankActivated();
             showRank.setText(Messages.NameDetailsViewComposite_Show_Rank);
-
+            showRank.addSelectionListener(this);
             showRank.addSelectionListener(new SelectionAdapter(){
                  @Override
                  public void widgetSelected(SelectionEvent e) {
@@ -274,7 +227,7 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
             showEpithets = new Button(dbSettings, SWT.CHECK);
             isShowEpithets = nameDetailsConfig.isAtomisedEpithetsActivated();
             showEpithets.setText(Messages.NameDetailsViewComposite_Show_AtomisedEpithets);
-
+            showEpithets.addSelectionListener(this);
             showEpithets.addSelectionListener(new SelectionAdapter(){
                  @Override
                  public void widgetSelected(SelectionEvent e) {
@@ -287,7 +240,7 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
             showAuthorCache = new Button(dbSettings, SWT.CHECK);
             isShowAuthorCache = nameDetailsConfig.isAuthorCacheActivated();
             showAuthorCache.setText(Messages.NameDetailsViewComposite_Show_AuthorCache);
-
+            showAuthorCache.addSelectionListener(this);
             showAuthorCache.addSelectionListener(new SelectionAdapter(){
                  @Override
                  public void widgetSelected(SelectionEvent e) {
@@ -300,20 +253,36 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
             showAuthorship = new Button(dbSettings, SWT.CHECK);
             isShowAuthorship = nameDetailsConfig.isAuthorshipSectionActivated();
             showAuthorship.setText(Messages.NameDetailsViewComposite_Show_Author);
-
+            showAuthorship.addSelectionListener(this);
             showAuthorship.addSelectionListener(new SelectionAdapter(){
                  @Override
                  public void widgetSelected(SelectionEvent e) {
                      setApply(true);
                      isShowAuthorship = showAuthorship.getSelection();
                      nameDetailsConfig.setAuthorshipSectionActivated(isShowAuthorship);
+                     showInAuthors.setEnabled(isShowAuthorship);
+                  }
+             });
+
+            showInAuthors = new Button(dbSettings, SWT.CHECK);
+            isShowInAuthors = nameDetailsConfig.isInAuthorshipActivated();
+            showInAuthors.setText(Messages.NameDetailsViewComposite_Show_In_Author);
+            showInAuthors.setSelection(isShowInAuthors);
+            showInAuthors.addSelectionListener(this);
+            showInAuthors.addSelectionListener(new SelectionAdapter(){
+                 @Override
+                 public void widgetSelected(SelectionEvent e) {
+                     setApply(true);
+                     isShowInAuthors = showInAuthors.getSelection();
+                     nameDetailsConfig.setInAuthorshipActivated(isShowInAuthors);
                   }
              });
+            showInAuthors.setEnabled(isShowAuthorship);
 
             showNomenclaturalRef = new Button(dbSettings, SWT.CHECK);
             isShowNomenclaturalRef = nameDetailsConfig.isNomenclaturalReferenceSectionActivated();
             showNomenclaturalRef.setText(Messages.NameDetailsViewComposite_Show_NomenclaturalReference);
-
+            showNomenclaturalRef.addSelectionListener(this);
             showNomenclaturalRef.addSelectionListener(new SelectionAdapter(){
                  @Override
                  public void widgetSelected(SelectionEvent e) {
@@ -326,19 +295,24 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
             showNomenclaturalStatus = new Button(dbSettings, SWT.CHECK);
             isShowNomenclaturalStatus = nameDetailsConfig.isNomenclaturalStatusSectionActivated();
             showNomenclaturalStatus.setText(Messages.NameDetailsViewComposite_Show_NomenclaturalStatus);
-
+            showNomenclaturalStatus.addSelectionListener(this);
             showNomenclaturalStatus.addSelectionListener(new SelectionAdapter(){
                  @Override
                  public void widgetSelected(SelectionEvent e) {
                      setApply(true);
                      isShowNomenclaturalStatus = showNomenclaturalStatus.getSelection();
                      nameDetailsConfig.setNomenclaturalStatusSectionActivated(isShowNomenclaturalStatus);
-                     if (isSimpleDetailsViewActivated!= null? isSimpleDetailsViewActivated:false){
-                         showNomenclaturalStatusRuleConsidered.setEnabled(isShowNomenclaturalStatus);
+
+                     showNomenclaturalStatusRuleConsidered.setEnabled(isShowNomenclaturalStatus);
+                     if (isShowNomenclaturalStatus){
+                         showNomenclaturalStatusRuleConsideredCodeEdition.setEnabled(isShowNomenclaturalStatusRuleConsidered);
+                     }else{
                          showNomenclaturalStatusRuleConsideredCodeEdition.setEnabled(isShowNomenclaturalStatus);
                      }
                   }
              });
+
+
             Composite nomenlaturalStatusComp = new Composite(dbSettings, SWT.NULL);
 
             GridLayoutFactory.fillDefaults().applyTo(nomenlaturalStatusComp);
@@ -348,20 +322,21 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
             showNomenclaturalStatusRuleConsidered = new Button(nomenlaturalStatusComp, SWT.CHECK);
             isShowNomenclaturalStatusRuleConsidered = nameDetailsConfig.isNomenclaturalStatusRuleConsideredActivated();
             showNomenclaturalStatusRuleConsidered.setText(Messages.NameDetailsViewComposite_Show_NomenclaturalStatus_RuleConsidered);
-
+            showNomenclaturalStatusRuleConsidered.addSelectionListener(this);
             showNomenclaturalStatusRuleConsidered.addSelectionListener(new SelectionAdapter(){
                  @Override
                  public void widgetSelected(SelectionEvent e) {
                      setApply(true);
                      isShowNomenclaturalStatusRuleConsidered = showNomenclaturalStatusRuleConsidered.getSelection();
                      nameDetailsConfig.setNomenclaturalStatusRuleConsideredActivated(isShowNomenclaturalStatusRuleConsidered);
-                  }
+                     showNomenclaturalStatusRuleConsideredCodeEdition.setEnabled(isShowNomenclaturalStatusRuleConsidered);
+                 }
              });
 
             showNomenclaturalStatusRuleConsideredCodeEdition = new Button(nomenlaturalStatusComp, SWT.CHECK);
             isShowNomenclaturalStatusRuleConsideredCodeEdition = nameDetailsConfig.isNomenclaturalStatusRuleConsideredCodeEditionActivated();
             showNomenclaturalStatusRuleConsideredCodeEdition.setText(Messages.NameDetailsViewComposite_Show_NomenclaturalStatus_RuleConsideredCodeEdition);
-
+            showNomenclaturalStatusRuleConsideredCodeEdition.addSelectionListener(this);
             showNomenclaturalStatusRuleConsideredCodeEdition.addSelectionListener(new SelectionAdapter(){
                  @Override
                  public void widgetSelected(SelectionEvent e) {
@@ -374,7 +349,7 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
             showProtologue = new Button(dbSettings, SWT.CHECK);
             isShowProtologue = nameDetailsConfig.isProtologueActivated();
             showProtologue.setText(Messages.NameDetailsViewComposite_Show_Protologue);
-
+            showProtologue.addSelectionListener(this);
             showProtologue.addSelectionListener(new SelectionAdapter(){
                  @Override
                  public void widgetSelected(SelectionEvent e) {
@@ -387,7 +362,7 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
             showTypeDesignation = new Button(dbSettings, SWT.CHECK);
             isShowTypeDesignation = nameDetailsConfig.isTypeDesignationSectionActivated();
             showTypeDesignation.setText(Messages.NameDetailsViewComposite_Show_TypeDesignation);
-
+            showTypeDesignation.addSelectionListener(this);
             showTypeDesignation.addSelectionListener(new SelectionAdapter(){
                  @Override
                  public void widgetSelected(SelectionEvent e) {
@@ -401,17 +376,20 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
             showNameRelationship = new Button(dbSettings, SWT.CHECK);
             isShowNameRelationship = nameDetailsConfig.isNameRelationsSectionActivated();
             showNameRelationship.setText(Messages.NameDetailsViewComposite_Show_Namerelationships);
-
+            showNameRelationship.addSelectionListener(this);
             showNameRelationship.addSelectionListener(new SelectionAdapter(){
                  @Override
                  public void widgetSelected(SelectionEvent e) {
                      setApply(true);
                      isShowNameRelationship = showNameRelationship.getSelection();
                      nameDetailsConfig.setNameRelationsSectionActivated(isShowNameRelationship);
-                     if (isSimpleDetailsViewActivated!= null? isSimpleDetailsViewActivated:false){
-                         showNameRelationshipRuleConsidered.setEnabled(isShowNameRelationship);
+                     showNameRelationshipRuleConsidered.setEnabled(isShowNameRelationship);
+                     if (isShowNameRelationship){
+                         showNameRelationshipRuleConsideredCodeEdition.setEnabled(isShowNameRelationshipRuleConsidered);
+                     }else {
                          showNameRelationshipRuleConsideredCodeEdition.setEnabled(isShowNameRelationship);
                      }
+
                   }
              });
 
@@ -422,20 +400,22 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
             showNameRelationshipRuleConsidered = new Button(nameRelationComp, SWT.CHECK);
             isShowNameRelationshipRuleConsidered = nameDetailsConfig.isNameRelationsRuleConsideredActivated();
             showNameRelationshipRuleConsidered.setText(Messages.NameDetailsViewComposite_Show_Namerelationships_RuleConsidered);
-
+            showNameRelationshipRuleConsidered.addSelectionListener(this);
             showNameRelationshipRuleConsidered.addSelectionListener(new SelectionAdapter(){
                  @Override
                  public void widgetSelected(SelectionEvent e) {
                      setApply(true);
                      isShowNameRelationshipRuleConsidered = showNameRelationshipRuleConsidered.getSelection();
                      nameDetailsConfig.setNameRelationsRuleConsideredActivated(isShowNameRelationshipRuleConsidered);
+                     showNameRelationshipRuleConsideredCodeEdition.setEnabled(isShowNameRelationshipRuleConsidered);
+
                   }
              });
 
             showNameRelationshipRuleConsideredCodeEdition = new Button(nameRelationComp, SWT.CHECK);
             isShowNameRelationshipRuleConsideredCodeEdition = nameDetailsConfig.isNameRelationsRuleConsideredCodeEditionActivated();
             showNameRelationshipRuleConsideredCodeEdition.setText(Messages.NameDetailsViewComposite_Show_Namerelationships_RuleConsideredCodeEdition);
-
+            showNameRelationshipRuleConsideredCodeEdition.addSelectionListener(this);
             showNameRelationshipRuleConsideredCodeEdition.addSelectionListener(new SelectionAdapter(){
                  @Override
                  public void widgetSelected(SelectionEvent e) {
@@ -448,7 +428,7 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
             showHybrid = new Button(dbSettings, SWT.CHECK);
             isShowHybrid = nameDetailsConfig.isHybridActivated();
             showHybrid.setText(Messages.NameDetailsViewComposite_Show_Hybrid);
-
+            showHybrid.addSelectionListener(this);
             showHybrid.addSelectionListener(new SelectionAdapter(){
                  @Override
                  public void widgetSelected(SelectionEvent e) {
@@ -460,6 +440,7 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
             showNameApprobiation = new Button(dbSettings, SWT.CHECK);
             isShowNameApprobiation = nameDetailsConfig.isNameApprobiationActivated();
             showNameApprobiation.setText(Messages.NameDetailsViewComposite_Show_NameApprobiation);
+            showNameApprobiation.addSelectionListener(this);
             showNameApprobiation.addSelectionListener(new SelectionAdapter(){
                  @Override
                  public void widgetSelected(SelectionEvent e) {
@@ -468,14 +449,9 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
                      nameDetailsConfig.setNameApprobiationActivated(isShowNameApprobiation);
                   }
              });
-            PreferencesUtil.recursiveSetEnabled(dbSettings, isSimpleDetailsViewActivated!= null? (isSimpleDetailsViewActivated && isOverride):false);
-            if (isSimpleDetailsViewActivated!= null? isSimpleDetailsViewActivated:false){
-                showSecDetail.setEnabled(isShowTaxon);
-                secEnabled.setEnabled(isShowTaxon);
-            }else{
-                showSecDetail.setEnabled(false);
-                secEnabled.setEnabled(false);
-            }
+            showSecDetail.setEnabled(isShowTaxon);
+            secEnabled.setEnabled(isShowTaxon);
+
             setButtonSelections();
 
         }else{
@@ -519,24 +495,20 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
 
             }
             isOverride = PreferencesUtil.getBooleanValue(PreferencesUtil.prefOverrideKey(PreferencePredicate.NameDetailsView.getKey()), true) != null? PreferencesUtil.getBooleanValue(PreferencesUtil.prefOverrideKey(PreferencePredicate.NameDetailsView.getKey()), true): false;
-            nameDetailsConfig = PreferencesUtil.getPreferredNameDetailsConfiguration(true);
+            if (isOverride){
+                nameDetailsConfig = PreferencesUtil.getPreferredNameDetailsConfiguration(true);
+            }else{
+                nameDetailsConfig = PreferencesUtil.getPreferredNameDetailsConfiguration(false);
+            }
+            if (nameDetailsConfig == null){
+                nameDetailsConfig = new NameDetailsConfigurator();
+            }
         }
     }
 
     protected void setButtonSelections(){
-
-        int index = 0;
-        if (isSimpleDetailsViewActivated != null && (isOverride || isAdminPreference)){
-            if (isSimpleDetailsViewActivated){
-                index = 1;
-            }else{
-                index = 2;
-            }
-        }
-        activateCheckButton.select(index);
         if (isAdminPreference){
             allowLocalPreference.setSelection(isAllowOverride);
-//            allowLocalPreference.setEnabled(isSimpleDetailsViewActivated != null);
         }
         showTaxon.setSelection(isShowTaxon);
         showLsid.setSelection(isShowLSID);
@@ -547,15 +519,30 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
         showEpithets.setSelection(isShowEpithets);
         showAuthorCache.setSelection(isShowAuthorCache);
         showAuthorship.setSelection(isShowAuthorship);
+        showInAuthors.setSelection(isShowInAuthors);
         showNomenclaturalRef.setSelection(isShowNomenclaturalRef);
         showNomenclaturalStatus.setSelection(isShowNomenclaturalStatus);
+
         showNomenclaturalStatusRuleConsidered.setSelection(isShowNomenclaturalStatusRuleConsidered);
+        showNomenclaturalStatusRuleConsidered.setEnabled(isShowNomenclaturalStatus);
         showNomenclaturalStatusRuleConsideredCodeEdition.setSelection(isShowNomenclaturalStatusRuleConsideredCodeEdition);
+        if (isShowNomenclaturalStatus){
+            showNomenclaturalStatusRuleConsideredCodeEdition.setEnabled(isShowNomenclaturalStatusRuleConsidered);
+        }else{
+            showNomenclaturalStatusRuleConsideredCodeEdition.setEnabled(isShowNomenclaturalStatus);
+        }
+
         showProtologue.setSelection(isShowProtologue);
         showTypeDesignation.setSelection(isShowTypeDesignation);
         showNameRelationship.setSelection(isShowNameRelationship);
         showNameRelationshipRuleConsidered.setSelection(isShowNameRelationshipRuleConsidered);
         showNameRelationshipRuleConsideredCodeEdition.setSelection(isShowNameRelationshipRuleConsideredCodeEdition);
+        showNameRelationshipRuleConsidered.setEnabled(isShowNameRelationship);
+        if (isShowNameRelationship){
+            showNameRelationshipRuleConsideredCodeEdition.setEnabled(isShowNameRelationshipRuleConsidered);
+        }else{
+            showNameRelationshipRuleConsideredCodeEdition.setEnabled(isShowNameRelationship);
+        }
         showHybrid.setSelection(isShowHybrid);
         showNameApprobiation.setSelection(isShowNameApprobiation);
         secEnabled.setSelection(isSecEnabled);
@@ -567,10 +554,16 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
 
     @Override
     protected void performDefaults() {
-        nameDetailsConfig = new NameDetailsConfigurator(false);
+        if (isAdminPreference){
+            nameDetailsConfig = new NameDetailsConfigurator();
+        }else{
+            nameDetailsConfig = PreferencesUtil.getPreferredNameDetailsConfiguration(false);
+        }
+
         isShowAppendedPhrase = nameDetailsConfig.isAppendedPhraseActivated();
         isShowEpithets = nameDetailsConfig.isAtomisedEpithetsActivated();
         isShowAuthorship = nameDetailsConfig.isAuthorshipSectionActivated();
+        isShowInAuthors = nameDetailsConfig.isInAuthorshipActivated();
         isShowAuthorCache = nameDetailsConfig.isAuthorCacheActivated();
         isShowLSID = nameDetailsConfig.isLSIDActivated();
         isShowNameApprobiation = nameDetailsConfig.isNameApprobiationActivated();
@@ -590,59 +583,30 @@ public class NameDetailsViewConfiguration extends CdmPreferencePage implements S
         isSecEnabled = nameDetailsConfig.isSecEnabled();
         isShowTypeDesignation = nameDetailsConfig.isTypeDesignationSectionActivated();
         isShowHybrid = nameDetailsConfig.isHybridActivated();
-        isSimpleDetailsViewActivated = null;
+//        isSimpleDetailsViewActivated = null;
         isAllowOverride = true;
+        isOverride = false;
         this.setButtonSelections();
-        PreferencesUtil.recursiveSetEnabled(dbSettings, isSimpleDetailsViewActivated!= null? isSimpleDetailsViewActivated:false);
+//        PreferencesUtil.recursiveSetEnabled(dbSettings, isSimpleDetailsViewActivated!= null? isSimpleDetailsViewActivated:false);
        // activateCheckButton.select(0);
         setApply(true);
         super.performDefaults();
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void widgetSelected(SelectionEvent e) {
-        setApply(true);
-        if (e.getSource().equals(activateCheckButton)){
-            String text = activateCheckButton.getText();
-            if(text.startsWith(Messages.Preference_Use_Default)){
-                isSimpleDetailsViewActivated = null;
-                if (!isAdminPreference){
-                    isOverride = false;
-                }
-                PreferencesUtil.recursiveSetEnabled(dbSettings, isSimpleDetailsViewActivated!= null? (isSimpleDetailsViewActivated && isOverride):false);
-                return;
-            }
+        if (e.getSource() != getApplyButton() || e.getSource() != getDefaultsButton()){
             isOverride = true;
-            if (text.equals(ENABLE)){
-                isSimpleDetailsViewActivated = true;
-
-            }else{
-                isSimpleDetailsViewActivated = false;
-            }
-            nameDetailsConfig.setSimpleDetailsViewActivated(isSimpleDetailsViewActivated);
-            dbSettings.setEnabled(isSimpleDetailsViewActivated);
-            PreferencesUtil.recursiveSetEnabled(dbSettings, isSimpleDetailsViewActivated);
-            if (isSimpleDetailsViewActivated){
-              showSecDetail.setEnabled(isShowTaxon);
-              secEnabled.setEnabled(isShowTaxon);
-            }
-            setButtonSelections();
-            setApply(true);
         }
 
-
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public void widgetDefaultSelected(SelectionEvent e) {
         // TODO Auto-generated method stub
 
     }
 
+
+
 }