Revision 782f192b
Added by Andreas Kohlbecker almost 6 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/model/registration/SpecimenTypeDesignationWorkingSetDTO.java | ||
---|---|---|
16 | 16 |
import org.joda.time.Partial; |
17 | 17 |
|
18 | 18 |
import eu.etaxonomy.cdm.model.agent.AgentBase; |
19 |
import eu.etaxonomy.cdm.model.common.Annotation; |
|
19 | 20 |
import eu.etaxonomy.cdm.model.common.Language; |
20 | 21 |
import eu.etaxonomy.cdm.model.common.LanguageString; |
21 | 22 |
import eu.etaxonomy.cdm.model.common.VersionableEntity; |
... | ... | |
23 | 24 |
import eu.etaxonomy.cdm.model.location.Point; |
24 | 25 |
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation; |
25 | 26 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
26 |
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit; |
|
27 | 27 |
import eu.etaxonomy.cdm.model.occurrence.FieldUnit; |
28 | 28 |
import eu.etaxonomy.cdm.model.occurrence.GatheringEvent; |
29 | 29 |
import eu.etaxonomy.cdm.model.reference.Reference; |
... | ... | |
336 | 336 |
return deletedEntities; |
337 | 337 |
} |
338 | 338 |
|
339 |
public Set<Annotation> getAnnotations() { |
|
340 |
if(fieldUnit != null){ |
|
341 |
return fieldUnit.getAnnotations(); |
|
342 |
} else { |
|
343 |
return null; |
|
344 |
} |
|
345 |
} |
|
346 |
|
|
347 |
public void setAnnotations(Set<Annotation> annotations) { |
|
348 |
|
|
349 |
if(fieldUnit != null){ |
|
350 |
List<Annotation> currentAnnotations = new ArrayList<>(fieldUnit.getAnnotations()); |
|
351 |
List<Annotation> annotationsSeen = new ArrayList<>(); |
|
352 |
for(Annotation a : annotations){ |
|
353 |
if(a == null){ |
|
354 |
continue; |
|
355 |
} |
|
356 |
if(!currentAnnotations.contains(a)){ |
|
357 |
fieldUnit.addAnnotation(a); |
|
358 |
} |
|
359 |
annotationsSeen.add(a); |
|
360 |
} |
|
361 |
for(Annotation a : currentAnnotations){ |
|
362 |
if(!annotationsSeen.contains(a)){ |
|
363 |
fieldUnit.removeAnnotation(a); |
|
364 |
} |
|
365 |
} |
|
366 |
} |
|
367 |
} |
|
368 |
|
|
339 | 369 |
} |
Also available in: Unified diff
ref #7458 implementation of the note field for the TypeSpecimenEditor