Revision 7dce04a4
Added by Katja Luther over 7 years ago
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/annotatedlineeditor/AnnotatedLineDocumentProvider.java | ||
---|---|---|
26 | 26 |
import org.eclipse.ui.texteditor.AbstractDocumentProvider; |
27 | 27 |
|
28 | 28 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
29 |
import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase; |
|
30 |
import eu.etaxonomy.cdm.api.service.exception.ReferencedObjectUndeletableException; |
|
29 | 31 |
import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput; |
30 | 32 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
31 | 33 |
|
... | ... | |
274 | 276 |
} |
275 | 277 |
if (annotation.isMarkedAsMerged()) { |
276 | 278 |
persistenceService.merge(annotation.getEntity(), annotation.getMergeTarget()); // merge |
277 |
} else { |
|
279 |
} if (annotation.isMarkedAsDeleted()) { |
|
280 |
try { |
|
281 |
persistenceService.delete(annotation.getEntity(), annotation.getDeleteConfigurator()); |
|
282 |
} catch (ReferencedObjectUndeletableException e) { |
|
283 |
// TODO Auto-generated catch block |
|
284 |
e.printStackTrace(); |
|
285 |
} // merge |
|
286 |
} |
|
287 |
|
|
288 |
else { |
|
278 | 289 |
// TODO clarify w AM whether this needs to be executed on merged objects |
279 | 290 |
//persistenceService.delete(annotation.getEntity()); // delete |
280 | 291 |
} |
... | ... | |
378 | 389 |
int length = position.getLength(); |
379 | 390 |
|
380 | 391 |
Object entity = annotation.getEntity(); |
381 |
annotation.markAsDeleted();
|
|
392 |
//annotation.markAsDeleted(configurator);
|
|
382 | 393 |
model.removeAnnotation(annotation); |
383 |
|
|
394 |
|
|
384 | 395 |
// Immediately followed by a delimiter? |
385 | 396 |
int annotationEnd = offset + length; |
386 | 397 |
try { |
... | ... | |
392 | 403 |
} |
393 | 404 |
|
394 | 405 |
try { |
406 |
|
|
395 | 407 |
document.replace(offset, length, ""); |
408 |
|
|
396 | 409 |
} catch (BadLocationException e) { |
397 | 410 |
MessagingUtils.error(getClass(), "Problems removing annotated line", e); |
398 | 411 |
} |
... | ... | |
411 | 424 |
updateLineFromAnnotation(annotation); |
412 | 425 |
} |
413 | 426 |
} |
427 |
|
|
428 |
|
|
414 | 429 |
} |
Also available in: Unified diff
fix #5692: adapt delete algorithm to annotatedLineEditor mechanisms