From: Katja Luther Date: Wed, 25 May 2016 09:15:34 +0000 (+0200) Subject: close delete dialog skips the delete fix #5806 X-Git-Tag: 4.1.0^2~36 X-Git-Url: https://dev.e-taxonomy.eu/gitweb/taxeditor.git/commitdiff_plain/546da7cff07d04dd169a17764ad0b77e20480541 close delete dialog skips the delete fix #5806 --- diff --git a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java index cb7da8a2f..f42174ba7 100644 --- a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java +++ b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java @@ -16,6 +16,7 @@ import java.util.List; import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.Status; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; @@ -132,7 +133,7 @@ public class DeleteHandler extends AbstractHandler { 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){ + if (result_dialog != Status.OK){ return null; } result = service.delete(((TaxonNameBase) object).getUuid(), config); @@ -148,7 +149,7 @@ public class DeleteHandler extends AbstractHandler { 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){ + if (result_dialog != Status.OK){ return null; } result = service.deleteTaxon(((TaxonBase) object).getUuid(), config, null); @@ -162,7 +163,7 @@ public class DeleteHandler extends AbstractHandler { SynonymDeletionConfigurator config = new SynonymDeletionConfigurator(); DeleteConfiguratorDialog dialog = new DeleteConfiguratorDialog(config, HandlerUtil.getActiveShell(event), "Confirm Deletion", null, "Do you really want to delete the synonym?", MessageDialog.WARNING, new String[] { "Delete", "Skip" }, 0); int result_dialog= dialog.open(); - if (result_dialog == 1){ + if (result_dialog != Status.OK){ return null; } result = service.deleteSynonym(((Synonym)object).getUuid(), config);