add publication year to zoological simple details view
authorKatja Luther <k.luther@bgbm.org>
Mon, 6 Jun 2016 11:05:45 +0000 (13:05 +0200)
committerKatja Luther <k.luther@bgbm.org>
Mon, 6 Jun 2016 11:05:45 +0000 (13:05 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameDetailElement.java

index 293f09bb7a3ef92fc1e236df7330cf7f511ceb0f..f663b2876bfd9d28f47090cf9f0d532dcb712121 100644 (file)
@@ -88,8 +88,9 @@ public class NameDetailElement extends AbstractIdentifiableEntityDetailElement<N
                createInfragenerericEpithetControls(this, nonViralName, style);
                createSpecificEpithetControls(this, nonViralName, style);
                createInfraSpecificEpithetControls(this, nonViralName, style);
+               createSpecificNameParts(this, nonViralName, style);
                if (isAdvancedView){
-                   createSpecificNameParts(this, nonViralName, style);
+                   //createSpecificNameParts(this, nonViralName, style);
                        text_appendedPhrase = formFactory.createTextWithLabelElement(formElement, "Appended Phrase", nonViralName.getAppendedPhrase(), style);
                }
        }
@@ -132,7 +133,7 @@ public class NameDetailElement extends AbstractIdentifiableEntityDetailElement<N
                        switch(nonViralName.getNomenclaturalCode()){
                        case ICNAFP :
                                // TODO RL
-                               if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL))
+                               if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL) && isAdvancedView)
                                {
                                        createBotanicalNameParts(formElement, nonViralName, style);
                                }
@@ -163,9 +164,11 @@ public class NameDetailElement extends AbstractIdentifiableEntityDetailElement<N
 
        private void createZoologicalNameParts(ICdmFormElement formElement, NonViralName nonViralName, int style){
                ZoologicalName zoologicalName = (ZoologicalName) nonViralName;
-               text_breed = formFactory.createTextWithLabelElement(formElement, "Breed", zoologicalName.getBreed(), style);
                text_publicationYear = formFactory.createNumberTextWithLabelElement(formElement, "Publication Year", zoologicalName.getPublicationYear(), style);
-               text_originalPublicationYear = formFactory.createNumberTextWithLabelElement(formElement, "Orig. Publication Year", zoologicalName.getOriginalPublicationYear(), style);
+               if (isAdvancedView){
+                   text_breed = formFactory.createTextWithLabelElement(formElement, "Breed", zoologicalName.getBreed(), style);
+                       text_originalPublicationYear = formFactory.createNumberTextWithLabelElement(formElement, "Orig. Publication Year", zoologicalName.getOriginalPublicationYear(), style);
+               }
        }
 
        private void createGenusOrUninomialControls(ICdmFormElement element, NonViralName nonViralName, int style){