Revision bcdc7df3
Added by Katja Luther over 9 years ago
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/DeleteOperation.java | ||
---|---|---|
19 | 19 |
import org.eclipse.core.runtime.IAdaptable; |
20 | 20 |
import org.eclipse.core.runtime.IProgressMonitor; |
21 | 21 |
import org.eclipse.core.runtime.IStatus; |
22 |
import org.eclipse.jface.dialogs.MessageDialog; |
|
22 | 23 |
|
23 | 24 |
import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration; |
24 | 25 |
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled; |
26 |
import eu.etaxonomy.cdm.api.service.DeleteResult; |
|
25 | 27 |
import eu.etaxonomy.cdm.api.service.IClassificationService; |
26 | 28 |
import eu.etaxonomy.cdm.api.service.ITaxonNodeService; |
27 | 29 |
import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator; |
... | ... | |
102 | 104 |
|
103 | 105 |
element = ((TaxonNode)taxonNode).getTaxon(); |
104 | 106 |
|
105 |
String result = service.deleteTaxonNode((TaxonNode)taxonNode, config); |
|
106 |
//TODO:if result is not a UUIDstring then pop up a message box |
|
107 |
DeleteResult result = service.deleteTaxonNode((TaxonNode)taxonNode, config); |
|
108 |
if (result.isError()){ |
|
109 |
//TODO:Error message! |
|
110 |
MessageDialog.openError(null, "Delete failed", result.getExceptions().get(0).getMessage()); |
|
111 |
} |
|
112 |
|
|
107 | 113 |
|
108 | 114 |
}else if(taxonNode != null && taxonNode instanceof Classification){ |
109 | 115 |
Classification taxonomicTree = (Classification) taxonNode; |
... | ... | |
113 | 119 |
} |
114 | 120 |
}*/ |
115 | 121 |
|
116 |
String result = CdmStore.getService(IClassificationService.class).delete(taxonomicTree); |
|
117 |
|
|
122 |
DeleteResult result = CdmStore.getService(IClassificationService.class).delete(taxonomicTree); |
|
123 |
if (result.isError()){ |
|
124 |
//TODO:Error message! |
|
125 |
MessageDialog.openError(null, "Delete failed", result.getExceptions().get(0).getMessage()); |
|
126 |
} |
|
118 | 127 |
|
119 | 128 |
/*}else{ |
120 | 129 |
try{ |
Also available in: Unified diff
adaption for error handling of delete methods