close delete dialog skips the delete fix #5806
authorKatja Luther <k.luther@bgbm.org>
Wed, 25 May 2016 09:15:34 +0000 (11:15 +0200)
committerKatja Luther <k.luther@bgbm.org>
Wed, 25 May 2016 09:15:34 +0000 (11:15 +0200)
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java

index cb7da8a2faffea7668cd93c0fa1176197ae4100c..f42174ba757a1968b76a5bed6f369d32a8315885 100644 (file)
@@ -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);