updateContent of NonviralNamedetail part if nc is changed
authorKatja Luther <k.luther@bgbm.org>
Fri, 22 Sep 2017 07:58:55 +0000 (09:58 +0200)
committerKatja Luther <k.luther@bgbm.org>
Fri, 22 Sep 2017 07:58:55 +0000 (09:58 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameDetailElement.java

index fc10e318ea77e326b6b6de5127c4608ef2fb3c1a..ff91f15a636f3b5efe34b3c1f9cc407d7afc4e27 100644 (file)
@@ -60,10 +60,11 @@ public class NonViralNameDetailElement
 
             combo_nomenclaturalCode = formFactory.createEnumComboElement(NomenclaturalCode.class, formElement, style);
             combo_nomenclaturalCode.setSelection(entity.getNomenclaturalCode());
-            textLsid = formFactory.createLsidWithExceptionLabelElement(formElement, "Lsid", entity.getLsid(), style);
             if (entity.getNameType().equals(NomenclaturalCode.ICNB)){
                text_nameApprobation = formFactory.createTextWithLabelElement(formElement, "Name Approbation", entity.getNameApprobation(),style);
             }
+            textLsid = formFactory.createLsidWithExceptionLabelElement(formElement, "Lsid", entity.getLsid(), style);
+            
 
         }else{
                if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_CACHE)){
@@ -74,6 +75,12 @@ public class NonViralNameDetailElement
                        combo_nomenclaturalCode = formFactory.createEnumComboElement(NomenclaturalCode.class, formElement, style);
                        combo_nomenclaturalCode.setSelection(entity.getNomenclaturalCode());
                }
+               if (entity.getNameType().equals(NomenclaturalCode.ICNB)){
+                       if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_APPROBATION)){
+                        text_nameApprobation = formFactory.createTextWithLabelElement(formElement, "Name Approbation", entity.getNameApprobation(),style);
+                       }
+               }
+
                if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_LSID)){
                        textLsid = formFactory.createLsidWithExceptionLabelElement(formElement, "Lsid", entity.getLsid(), style);
 
@@ -185,6 +192,7 @@ public class NonViralNameDetailElement
                    getEntity().setLsid(textLsid.parseText());
                } else if (eventSource == combo_nomenclaturalCode){
                        getEntity().setNameType(combo_nomenclaturalCode.getSelection());
+                       this.updateContent();
                        section_name.updateContent();
                } else if(eventSource == this.text_nameApprobation){
             ((IBacterialName)getEntity()).setNameApprobation(text_nameApprobation.getText());