From: Patrick Plitzner
Date: Wed, 28 Oct 2015 17:17:00 +0000 (+0100)
Subject: Show taxon associations only when they exist
X-Git-Tag: 3.12.0^2~75^2~7
X-Git-Url: https://dev.e-taxonomy.eu/gitweb/taxeditor.git/commitdiff_plain/4fdd8520ae72ef7876bd32724ea7bfd4c80deb14
Show taxon associations only when they exist
---
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/TaxonAssociationDetailElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/TaxonAssociationDetailElement.java
index 890942c61..a7d9f73c4 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/TaxonAssociationDetailElement.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/TaxonAssociationDetailElement.java
@@ -69,22 +69,18 @@ public class TaxonAssociationDetailElement extends AbstractCdmDetailElement> associatedTaxa = CdmStore.getService(IOccurrenceService.class).listAssociatedTaxa(entity.innerDerivedUnit(), null, null, null, null);
- associationsViewer.setInput(associatedTaxa);
- associationsViewer.addDoubleClickListener(this);
-
- Label typeLabel = formFactory.createLabel(getLayoutComposite(), "Type Designations");
- typeLabel.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+ if(associatedTaxa.isEmpty()){
+ Label associationsLabel = formFactory.createLabel(getLayoutComposite(), "Individuals Associations");
+ associationsLabel.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+
+ associationsViewer = new TableViewer(getLayoutComposite(), SWT.FULL_SELECTION);
+ associationsViewer.getTable().setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+ associationsViewer.setContentProvider(new ArrayContentProvider());
+ associationsViewer.setInput(associatedTaxa);
+ associationsViewer.addDoubleClickListener(this);
+ }
- typeDesignationViewer = new TableViewer(getLayoutComposite(), SWT.FULL_SELECTION);
- typeDesignationViewer.getTable().setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
- typeDesignationViewer.setContentProvider(new ArrayContentProvider());
Collection typeDesignations = CdmStore.getService(IOccurrenceService.class).listTypeDesignations(entity.innerDerivedUnit(), null, null, null, null);
//TODO implement service method for this which is just used in the label provider
Collection> typedTaxa = new HashSet>();
@@ -98,8 +94,16 @@ public class TaxonAssociationDetailElement extends AbstractCdmDetailElement