commit fa39cfe40565b63e41c04efa3088c0663f787cf8
Author: Katja Luther <k.luther@bgbm.org>
Date:   Mon Dec 19 16:16:46 2016 +0100

    more changes for configurable name details view

diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/IPreferenceKeys.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/IPreferenceKeys.java
index 1f92bf6c3..25ad03df7 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/IPreferenceKeys.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/IPreferenceKeys.java
@@ -173,7 +173,7 @@ public interface IPreferenceKeys {
     public static final String SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP = "eu.etaxonomy.taxeditor.name.showNameNameRelationship";
 	public static final String SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE = "eu.etaxonomy.taxeditor.name.showNameAppendedPhrase";
 	public static final String SHOW_NAME_DETAILS_SECTION_CACHE = "eu.etaxonomy.taxeditor.name.showNameCache";
-
+    public static final String SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE = "eu.etaxonomy.taxeditor.name.showAuthorCache";
     public static final String PROMPT_FOR_OPEN_SPECIMEN_IN_EDITOR = "eu.etaxonomy.taxeditor.specimen.promptForOpenSpecimenInEditor";
 
     // TODO RL
@@ -187,6 +187,8 @@ public interface IPreferenceKeys {
      * Key for the saved P2 repositories
      */
     public static final String P2_REPOSITORY_LIST = "eu.etaxonomy.taxeditor.p2.repositories";
+    public static final String ALLOW_OVERRIDE_NAMEDETAILS = "eu.etaxonomy.taxeditor.details.allow_override";
+
 
 
 
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/AuthorshipDetailElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/AuthorshipDetailElement.java
index 044268570..be4133108 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/AuthorshipDetailElement.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/AuthorshipDetailElement.java
@@ -67,7 +67,7 @@ public class AuthorshipDetailElement extends
 	@Override
 	protected void createControls(ICdmFormElement formElement,
 			NonViralName entity, int style) {
-	    if (isAdvancedView){
+	    if (isAdvancedView || PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE)){
 	        toggleable_cache = formFactory.createToggleableTextField(this,
 				"Authorship Cache", entity.getAuthorshipCache(),
 				entity.isProtectedAuthorshipCache(), style);
@@ -78,42 +78,43 @@ public class AuthorshipDetailElement extends
 	    }
 	    NomenclaturalCode code = entity.getNomenclaturalCode();
 
-        selectionCombinationAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class,
-				getConversationHolder(),
-				formElement, "Author",
-				entity.getCombinationAuthorship(),
-				EntitySelectionElement.ALL, style);
-		addElement(selectionCombinationAuthor);
-		selectionExCombinationAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class,
-				getConversationHolder(),
-				formElement, "Ex Author",
-				entity.getExCombinationAuthorship(),
-				EntitySelectionElement.ALL, style);
-		addElement(selectionExCombinationAuthor);
-		if (code != null){
-            if (code.equals(NomenclaturalCode.ICZN)){
-                text_publicationYear = formFactory.createNumberTextWithLabelElement(formElement, "Publication Year", ((ZoologicalName)entity).getPublicationYear(), style);
-
-            }
-         }
-		selectionBasionymAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class, getConversationHolder(),
-                formElement, "Basionym Author", entity.getBasionymAuthorship(),
-                EntitySelectionElement.ALL, style);
-		addElement(selectionBasionymAuthor);
-		selectionExBasionymAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class, getConversationHolder(),
-		        formElement, "Ex Basionym Author",entity.getExBasionymAuthorship(),
-		        EntitySelectionElement.ALL, style);
-
-		addElement(selectionExBasionymAuthor);
-		 if (code != null){
-	            if (code.equals(NomenclaturalCode.ICZN)){
-
-	                text_originalPublicationYear = formFactory.createNumberTextWithLabelElement(formElement, "Orig. Publication Year", ((ZoologicalName)entity).getOriginalPublicationYear(), style);
-
-	            }
-	         }
-
+	    if (isAdvancedView || PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP)){
+            selectionCombinationAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class,
+    				getConversationHolder(),
+    				formElement, "Author",
+    				entity.getCombinationAuthorship(),
+    				EntitySelectionElement.ALL, style);
+    		addElement(selectionCombinationAuthor);
+    		selectionExCombinationAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class,
+    				getConversationHolder(),
+    				formElement, "Ex Author",
+    				entity.getExCombinationAuthorship(),
+    				EntitySelectionElement.ALL, style);
+    		addElement(selectionExCombinationAuthor);
+    		if (code != null){
+                if (code.equals(NomenclaturalCode.ICZN)){
+                    text_publicationYear = formFactory.createNumberTextWithLabelElement(formElement, "Publication Year", ((ZoologicalName)entity).getPublicationYear(), style);
+
+                }
+             }
+    		selectionBasionymAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class, getConversationHolder(),
+                    formElement, "Basionym Author", entity.getBasionymAuthorship(),
+                    EntitySelectionElement.ALL, style);
+    		addElement(selectionBasionymAuthor);
+    		selectionExBasionymAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class, getConversationHolder(),
+    		        formElement, "Ex Basionym Author",entity.getExBasionymAuthorship(),
+    		        EntitySelectionElement.ALL, style);
+
+    		addElement(selectionExBasionymAuthor);
+    		 if (code != null){
+    	            if (code.equals(NomenclaturalCode.ICZN)){
+
+    	                text_originalPublicationYear = formFactory.createNumberTextWithLabelElement(formElement, "Orig. Publication Year", ((ZoologicalName)entity).getOriginalPublicationYear(), style);
+
+    	            }
+    	         }
 
+	    }
 
 	}
 
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameDetailElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameDetailElement.java
index ca153c81f..9387c20db 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameDetailElement.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameDetailElement.java
@@ -80,27 +80,33 @@ public class NameDetailElement extends AbstractIdentifiableEntityDetailElement<N
 
 	    if (isAdvancedView){
 	    	toggleable_cache = formFactory.createToggleableTextField(this, "Name Cache", nonViralName.getNameCache(), nonViralName.isProtectedNameCache(), style);
+	    	combo_rank = formFactory.createDefinedTermComboElement(TermType.Rank, this, "Rank", nonViralName.getRank(), style);
+	    	createGenusOrUninomialControls(this, nonViralName, style);
+            createInfragenerericEpithetControls(this, nonViralName, style);
+            createSpecificEpithetControls(this, nonViralName, style);
+            createInfraSpecificEpithetControls(this, nonViralName, style);
+            createSpecificNameParts(this, nonViralName, style);
+            text_appendedPhrase = formFactory.createTextWithLabelElement(formElement, "Appended Phrase", nonViralName.getAppendedPhrase(), style);
 	    }else{
 	    	if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAMECACHE)){
 	    		toggleable_cache = formFactory.createToggleableTextField(this, "Name Cache", nonViralName.getNameCache(), nonViralName.isProtectedNameCache(), style);
         	}
+
+    	    if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_RANK)){
+    	        combo_rank = formFactory.createDefinedTermComboElement(TermType.Rank, this, "Rank", nonViralName.getRank(), style);
+    	    }
+
+    		if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS)){
+    			createGenusOrUninomialControls(this, nonViralName, style);
+    			createInfragenerericEpithetControls(this, nonViralName, style);
+    			createSpecificEpithetControls(this, nonViralName, style);
+    			createInfraSpecificEpithetControls(this, nonViralName, style);
+    			createSpecificNameParts(this, nonViralName, style);
+    		}
+    		if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE)){
+    				text_appendedPhrase = formFactory.createTextWithLabelElement(formElement, "Appended Phrase", nonViralName.getAppendedPhrase(), style);
+           	}
 	    }
-		combo_rank = formFactory.createDefinedTermComboElement(TermType.Rank, this, "Rank", nonViralName.getRank(), style);
-		if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS)){
-			createGenusOrUninomialControls(this, nonViralName, style);
-			createInfragenerericEpithetControls(this, nonViralName, style);
-			createSpecificEpithetControls(this, nonViralName, style);
-			createInfraSpecificEpithetControls(this, nonViralName, style);
-			createSpecificNameParts(this, nonViralName, style);
-		}
-		if (isAdvancedView){
-		    //createSpecificNameParts(this, nonViralName, style);
-			text_appendedPhrase = formFactory.createTextWithLabelElement(formElement, "Appended Phrase", nonViralName.getAppendedPhrase(), style);
-		}else{
-			if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE)){
-				text_appendedPhrase = formFactory.createTextWithLabelElement(formElement, "Appended Phrase", nonViralName.getAppendedPhrase(), style);
-        	}
-		}
 	}
 
 	/**
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameDetailElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameDetailElement.java
index 23fe4db93..1b306cbc0 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameDetailElement.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameDetailElement.java
@@ -76,14 +76,14 @@ public class NonViralNameDetailElement extends
         		combo_nomenclaturalCode.setSelection(entity.getNomenclaturalCode());
         		 if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
         			  combo_nomenclaturalCode.setVisible(false);
-                 } 
+                 }
         	}
         	if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_LSID)){
         		textLsid = formFactory.createLsidWithExceptionLabelElement(formElement, "Lsid", entity.getLsid(), style);
-        		
+
         	}
-                       
-        	
+
+
         }
 
 
@@ -91,28 +91,20 @@ public class NonViralNameDetailElement extends
 	    section_name.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
 	    addControl(section_name);
 	    addElement(section_name);
-	    section_author = formFactory.createAuthorshipDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
-	    section_author.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-	    addControl(section_author);
-	    addElement(section_author);
-
+	    if (isAdvancedView || PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP)){
+    	    section_author = formFactory.createAuthorshipDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+    	    section_author.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+    	    addControl(section_author);
+    	    addElement(section_author);
+	    }
 	    //TODO RL
-	    if (isAdvancedView){
+	    if (isAdvancedView || PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_HYBRID)){
     	    if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
     	        section_hybrid = formFactory.createHybridDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
     	        section_hybrid.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
     	        addControl(section_hybrid);
     	        addElement(section_hybrid);
     	    }
-    	 }else{
-    		 if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
-    			 if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_HYBRID)){
-	     	        section_hybrid = formFactory.createHybridDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
-	     	        section_hybrid.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-	     	        addControl(section_hybrid);
-	     	        addElement(section_hybrid);
-    			 }
-     	    }
     	 }
 
 
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java
index 420fcbef8..fcf2e95d2 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java
@@ -278,7 +278,7 @@ public class DetailsViewer extends AbstractCdmDataViewer {
             else if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.TissueSample){
                 //TissueSample should only be created by using it's own class
                 //in future using only one class with different SpecimenOrObservationTypes is desired
-//                createTissueSampleSection(rootElement);
+                createTissueSampleSection(rootElement);
             }
             else{
                 createDerivedUnitBaseElementSection(rootElement);
