Revision 8f96bb65
Added by Patrick Plitzner over 8 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/TaxonAssociationDetailElement.java | ||
---|---|---|
70 | 70 |
//TODO add context menu for deleting associations |
71 | 71 |
|
72 | 72 |
Collection<TaxonBase<?>> associatedTaxa = CdmStore.getService(IOccurrenceService.class).listAssociatedTaxa(entity.innerDerivedUnit(), null, null, null, null); |
73 |
if(associatedTaxa.isEmpty()){ |
|
74 |
Label associationsLabel = formFactory.createLabel(getLayoutComposite(), "Individuals Associations"); |
|
75 |
associationsLabel.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1)); |
|
73 |
Collection<SpecimenTypeDesignation> typeDesignations = CdmStore.getService(IOccurrenceService.class).listTypeDesignations(entity.innerDerivedUnit(), null, null, null, null); |
|
76 | 74 |
|
75 |
if(!associatedTaxa.isEmpty()){ |
|
77 | 76 |
associationsViewer = new TableViewer(getLayoutComposite(), SWT.FULL_SELECTION); |
78 | 77 |
associationsViewer.getTable().setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1)); |
79 | 78 |
associationsViewer.setContentProvider(new ArrayContentProvider()); |
80 | 79 |
associationsViewer.setInput(associatedTaxa); |
81 | 80 |
associationsViewer.addDoubleClickListener(this); |
82 | 81 |
} |
82 |
else{ |
|
83 |
Label label = formFactory.createLabel(getLayoutComposite(), "No associations"); |
|
84 |
label.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1)); |
|
85 |
} |
|
83 | 86 |
|
84 |
Collection<SpecimenTypeDesignation> typeDesignations = CdmStore.getService(IOccurrenceService.class).listTypeDesignations(entity.innerDerivedUnit(), null, null, null, null); |
|
85 | 87 |
//TODO implement service method for this which is just used in the label provider |
86 | 88 |
Collection<TaxonBase<?>> typedTaxa = new HashSet<TaxonBase<?>>(); |
87 | 89 |
for (SpecimenTypeDesignation specimenTypeDesignation : typeDesignations) { |
... | ... | |
112 | 114 |
//empty |
113 | 115 |
} |
114 | 116 |
|
115 |
/* (non-Javadoc) |
|
116 |
* @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(org.eclipse.jface.viewers.DoubleClickEvent) |
|
117 |
*/ |
|
118 | 117 |
@Override |
119 | 118 |
public void doubleClick(DoubleClickEvent event) { |
120 | 119 |
if(event.getSelection() instanceof IStructuredSelection){ |
Also available in: Unified diff
Remove identifier and taxon associations from bulk editor details view