Revision bcdc7df3
Added by Katja Luther over 9 years ago
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java | ||
---|---|---|
22 | 22 |
import org.eclipse.ui.handlers.HandlerUtil; |
23 | 23 |
import org.eclipse.ui.texteditor.IDocumentProvider; |
24 | 24 |
|
25 |
import eu.etaxonomy.cdm.api.service.DeleteResult; |
|
25 | 26 |
import eu.etaxonomy.cdm.api.service.IAgentService; |
26 | 27 |
import eu.etaxonomy.cdm.api.service.IGroupService; |
27 | 28 |
import eu.etaxonomy.cdm.api.service.INameService; |
... | ... | |
85 | 86 |
for(Object object : structuredSelection.toList()){ |
86 | 87 |
|
87 | 88 |
LineAnnotation annotation = (LineAnnotation) model.getAnnotation(object); |
88 |
String result = "";
|
|
89 |
DeleteResult result = new DeleteResult();
|
|
89 | 90 |
try { |
90 | 91 |
ICdmApplicationConfiguration controller; |
91 | 92 |
controller = (ICdmApplicationConfiguration) CdmStore.getCurrentApplicationConfiguration(); |
... | ... | |
120 | 121 |
} catch (Exception e){ |
121 | 122 |
BulkEditorUtil.errorDialog("Could not delete", getClass(), e.getMessage(), null); |
122 | 123 |
} |
123 |
try { |
|
124 |
UUID uuid = UUID.fromString(result); |
|
125 |
}catch (IllegalArgumentException e){ |
|
126 |
BulkEditorUtil.errorDialog("Could not delete", getClass(), result, null); |
|
124 |
if (result.isError()){ |
|
125 |
BulkEditorUtil.errorDialog("Could not delete", getClass(), result.getExceptions().get(0).getMessage(), null); |
|
127 | 126 |
} |
128 | 127 |
((BulkEditor) editor).removeAnnotatedLine(annotation); |
129 | 128 |
|
Also available in: Unified diff
adaption for error handling of delete methods