Revision c0e5fd02
Added by Katja Luther over 10 years ago
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/DeleteOperation.java | ||
---|---|---|
17 | 17 |
import org.eclipse.core.runtime.IAdaptable; |
18 | 18 |
import org.eclipse.core.runtime.IProgressMonitor; |
19 | 19 |
import org.eclipse.core.runtime.IStatus; |
20 |
import org.eclipse.jface.dialogs.MessageDialog; |
|
21 |
import org.eclipse.ui.handlers.HandlerUtil; |
|
20 | 22 |
|
21 | 23 |
import eu.etaxonomy.cdm.api.application.CdmApplicationController; |
22 | 24 |
import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration; |
... | ... | |
113 | 115 |
|
114 | 116 |
}else if(taxonNode != null && taxonNode instanceof Classification){ |
115 | 117 |
Classification taxonomicTree = (Classification) taxonNode; |
116 |
if(taxonomicTree.hasChildNodes()){ |
|
117 |
StoreUtil.warningDialog("Tree is not empty", this, "It is not possible to delete a Taxonomic Tree that " + |
|
118 |
"is not empty. Please delete included taxa first"); |
|
119 |
}else{ |
|
118 |
/*if(taxonomicTree.hasChildNodes()){ |
|
119 |
if(! MessageDialog.openConfirm(null, "Confirm Deletion", "The selected tree has children, do yu realy want to delete the whole tree with its children?")){ |
|
120 |
return null; |
|
121 |
} |
|
122 |
}*/ |
|
123 |
try{ |
|
124 |
CdmStore.getService(IClassificationService.class).delete(taxonomicTree); |
|
125 |
}catch(ReferencedObjectUndeletableException e){ |
|
126 |
throw new ExecutionException(e.getMessage()); |
|
127 |
} |
|
128 |
|
|
129 |
|
|
130 |
/*}else{ |
|
120 | 131 |
try{ |
121 | 132 |
CdmStore.getService(IClassificationService.class).delete(taxonomicTree); |
122 | 133 |
}catch(ReferencedObjectUndeletableException e){ |
123 | 134 |
throw new ExecutionException(e.getMessage()); |
124 | 135 |
} |
125 |
} |
|
136 |
}*/
|
|
126 | 137 |
} else { |
127 | 138 |
try { |
128 | 139 |
service.deleteTaxonNodes(treeNodes, config); |
Also available in: Unified diff
delete whole classification with children