ref #9116: adapt expand state of additional information of source
authorKatja Luther <k.luther@bgbm.org>
Fri, 14 Aug 2020 15:07:19 +0000 (17:07 +0200)
committerKatja Luther <k.luther@bgbm.org>
Fri, 14 Aug 2020 15:07:19 +0000 (17:07 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/OriginalSourceElement.java

index a22b032908402084f8b146bb3c84318138654cf0..522b419da541d6cc505c7abc583c6551642c6986 100755 (executable)
@@ -8,6 +8,7 @@
 */
 package eu.etaxonomy.taxeditor.ui.section.reference;
 
+import org.apache.commons.lang.StringUtils;
 import org.eclipse.jface.util.IPropertyChangeListener;
 import org.eclipse.ui.forms.widgets.TableWrapData;
 
@@ -72,10 +73,9 @@ public class OriginalSourceElement extends AbstractCdmDetailElement<ReferencedEn
         addElement(advancedSection);
         advancedSection.setBackground(this.getPersistentBackground());
         advancedSection.setEntity(entity);
-        if (!((DescriptionElementSource)entity).checkEmpty()){
+        advancedSection.setExpanded(false);
+        if (StringUtils.isNotBlank(((DescriptionElementSource)entity).getIdInSource()) || StringUtils.isNotBlank(((DescriptionElementSource)entity).getIdNamespace()) || StringUtils.isNotBlank(((DescriptionElementSource)entity).getOriginalNameString()) || (((DescriptionElementSource)entity).getLinks() != null && !((DescriptionElementSource)entity).getLinks().isEmpty())  || (((DescriptionElementSource)entity).getNameUsedInSource() != null)){
             advancedSection.setExpanded(true);
-        }else{
-            advancedSection.setExpanded(false);
         }
 
     }