ref #6693: fix update of details view for changed nameType
authorKatja Luther <k.luther@bgbm.org>
Fri, 22 Sep 2017 10:06:18 +0000 (12:06 +0200)
committerKatja Luther <k.luther@bgbm.org>
Fri, 22 Sep 2017 10:06:52 +0000 (12:06 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/AuthorshipDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/HybridDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameDetailElement.java

index f6144a06fd8761beab95018ea47dbd717d7d0f81..0e7689506fab68ac037235bca1d33326a09b8f33 100644 (file)
@@ -61,5 +61,9 @@ public class AuthorshipDetailSection extends AbstractCdmDetailSection<INonViralN
                        AbstractCdmDetailSection<INonViralName> parentElement, int style) {
            return formFactory.createAuthorshipDetailElement(parentElement, style);
        }
+       
+       public void updateContent(){
+               ((AuthorshipDetailElement)this.detailElement).updateContent();
+       }
 
 }
index 6659acb1fff95aca8185f499561d9164b0014a3b..e298dac4551cac94f8290cdf5b613c66fc8f49e2 100644 (file)
@@ -21,6 +21,7 @@ import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.description.detail.AbstractDetailedDescriptionDetailElement;
 
 /**
  * @author n.hoffmann
@@ -73,4 +74,9 @@ public class HybridDetailSection extends AbstractCdmDetailSection<TaxonName> imp
            return formFactory.createHybridDetailElement(parentElement);
        }
 
+       public void updateContent() {
+               ((AbstractCdmDetailElement)this.detailElement).setEntity(getEntity());
+               
+       }
+
 }
index ff91f15a636f3b5efe34b3c1f9cc407d7afc4e27..35b34ef61b57912ff8675fd7a6167b85e55abc2b 100644 (file)
@@ -86,11 +86,6 @@ public class NonViralNameDetailElement
 
                }
                
-               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);
-                       }
-               }
 
         }
 
@@ -126,7 +121,7 @@ public class NonViralNameDetailElement
 //             if(combo_nomenclaturalCode!=null){
 //                 combo_nomenclaturalCode.setEnabled(false);
 //             }
-
+               
                if(toggleable_cache!=null){
                    toggleable_cache.setEnabled(getEntity().isProtectedTitleCache() || getEntity().isProtectedFullTitleCache());
                    setIrrelevant(toggleable_cache.getState(),
@@ -193,7 +188,9 @@ public class NonViralNameDetailElement
                } else if (eventSource == combo_nomenclaturalCode){
                        getEntity().setNameType(combo_nomenclaturalCode.getSelection());
                        this.updateContent();
-                       section_name.updateContent();
+                       section_hybrid.setEntity(getEntity());
+                       section_author.setEntity(getEntity());
+                       section_name.setEntity(getEntity());
                } else if(eventSource == this.text_nameApprobation){
             ((IBacterialName)getEntity()).setNameApprobation(text_nameApprobation.getText());
         }