Revision 0fe844a4
Added by Pepe Ciardelli about 15 years ago
taxeditor-bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/MergeGroupHandler.java | ||
---|---|---|
28 | 28 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
29 | 29 |
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor; |
30 | 30 |
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorInput; |
31 |
import eu.etaxonomy.taxeditor.bulkeditor.LineAnnotation; |
|
32 |
import eu.etaxonomy.taxeditor.bulkeditor.LineAnnotationModel; |
|
33 | 31 |
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorConstants; |
34 | 32 |
import eu.etaxonomy.taxeditor.bulkeditor.IEntityContainer; |
33 |
import eu.etaxonomy.taxeditor.bulkeditor.LineAnnotationModel; |
|
35 | 34 |
|
36 | 35 |
/** |
37 | 36 |
* @author p.ciardelli |
... | ... | |
71 | 70 |
"No group merge target set", "No group merge target has been set."); |
72 | 71 |
return null; |
73 | 72 |
} |
74 |
CdmBase targetEntity = ((LineAnnotation) targetAnnotation). |
|
75 |
getEntityContainer().getCdmEntity(); |
|
73 |
CdmBase targetEntity = ((IEntityContainer<?>) targetAnnotation).getCdmEntity(); |
|
76 | 74 |
|
77 | 75 |
logger.info("Merging group"); |
78 | 76 |
model.printAnnotations(); |
... | ... | |
83 | 81 |
document.replace(position.getOffset(), position.getLength(), ""); |
84 | 82 |
|
85 | 83 |
// Mark entity container for merging with target entity |
86 |
IEntityContainer container = |
|
87 |
((LineAnnotation) annotation).getEntityContainer(); |
|
88 |
container.markAsMerged(targetEntity); |
|
84 |
((IEntityContainer) annotation).markAsMerged(targetEntity); |
|
89 | 85 |
logger.info("Merging " + annotation + " with " + targetAnnotation); |
90 | 86 |
|
91 | 87 |
// Remove annotation from model |
Also available in: Unified diff
Check in before further refactoring.