//TODO add context menu for deleting associations
- 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());
Collection<TaxonBase<?>> 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<SpecimenTypeDesignation> 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<TaxonBase<?>> typedTaxa = new HashSet<TaxonBase<?>>();
}
}
}
- typeDesignationViewer.setInput(typedTaxa);
- typeDesignationViewer.addDoubleClickListener(this);
+ if(!typedTaxa.isEmpty()){
+ Label typeLabel = formFactory.createLabel(getLayoutComposite(), "Type Designations");
+ typeLabel.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+
+ typeDesignationViewer = new TableViewer(getLayoutComposite(), SWT.FULL_SELECTION);
+ typeDesignationViewer.getTable().setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+ typeDesignationViewer.setContentProvider(new ArrayContentProvider());
+ typeDesignationViewer.setInput(typedTaxa);
+ typeDesignationViewer.addDoubleClickListener(this);
+ }
}
/** {@inheritDoc} */