From 4fdd8520ae72ef7876bd32724ea7bfd4c80deb14 Mon Sep 17 00:00:00 2001
From: Patrick Plitzner
Date: Wed, 28 Oct 2015 18:17:00 +0100
Subject: [PATCH] Show taxon associations only when they exist
---
.../TaxonAssociationDetailElement.java | 36 ++++++++++---------
1 file changed, 20 insertions(+), 16 deletions(-)
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