if (object != null){
NameDeletionConfigurator config = new NameDeletionConfigurator();
- DeleteConfiguratorDialog dialog = new DeleteConfiguratorDialog(config, HandlerUtil.getActiveShell(event), "Confirm Deletion", null, "Do you really want to delete the name", MessageDialog.WARNING, new String[] { "Delete", "Skip" }, 0);
+ DeleteConfiguratorDialog dialog = new DeleteConfiguratorDialog(config, HandlerUtil.getActiveShell(event), "Confirm Deletion", null, "Do you really want to delete the name?", MessageDialog.WARNING, new String[] { "Delete", "Skip" }, 0);
int result_dialog= dialog.open();
if (result_dialog == 1){
return null;
ITaxonService service = controller.getTaxonService();
if (object != null){
if (object instanceof Taxon){
- TaxonDeletionConfigurator config = new TaxonDeletionConfigurator();
+ TaxonDeletionConfigurator config = new TaxonDeletionConfigurator();
config.setDeleteInAllClassifications(true);
- DeleteConfiguratorDialog dialog = new DeleteConfiguratorDialog(config, HandlerUtil.getActiveShell(event), "Confirm Deletion", null, "Do you really want to delete the taxon", MessageDialog.WARNING, new String[] { "Delete", "Skip" }, 0);
- int result_dialog= dialog.open();
- if (result_dialog == 1){
- return null;
+ DeleteConfiguratorDialog dialog;
+ if (((Taxon)object).getTaxonNodes().isEmpty()){
+ dialog = new DeleteConfiguratorDialog(config, HandlerUtil.getActiveShell(event), "Confirm Deletion", null, "Do you really want to delete the taxon?", MessageDialog.WARNING, new String[] { "Delete", "Skip" }, 0);
+ int result_dialog= dialog.open();
+ if (result_dialog == 1){
+ return null;
+ }
+ result = service.deleteTaxon(((TaxonBase) object).getUuid(), config, null);
+ errorMessage = "The taxon ";
+ } else{
+ MessagingUtils.messageDialog("Delete not possible", getClass(), "The taxon can not be deleted in bulk editor. It is used in a classification.", null);
+ return null;
}
- result = service.deleteTaxon(((TaxonBase) object).getUuid(), config, null);
- errorMessage = "The taxon ";
+
}else{
SynonymDeletionConfigurator config = new SynonymDeletionConfigurator();