- //TODO implement service method for this which is just used in the label provider
- Collection<TaxonBase<?>> typedTaxa = new HashSet<TaxonBase<?>>();
- for (SpecimenTypeDesignation specimenTypeDesignation : typeDesignations) {
- for (TaxonNameBase taxonNameBase : specimenTypeDesignation.getTypifiedNames()) {
- Set taxa = taxonNameBase.getTaxa();
- for (Object taxon : taxa) {
- if(taxon instanceof CdmBase && ((CdmBase)taxon).isInstanceOf(TaxonBase.class)){
- typedTaxa.add(HibernateProxyHelper.deproxy(taxon, TaxonBase.class));
- }
- }
- }
- }
- 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);
- }