From 38053dd0c5531590da15358c4d85bf05f7a181ae Mon Sep 17 00:00:00 2001
From: Patrick Plitzner
Date: Tue, 21 Mar 2017 14:33:12 +0100
Subject: [PATCH] ref #4611 Refactor string constants
---
.../bulkeditor/handler/DeleteHandler.java | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
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 cbc2768ac..cc9ff859d 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
@@ -66,7 +66,11 @@ public class DeleteHandler extends AbstractHandler {
- /* (non-Javadoc)
+ private static final String SKIP = "Skip";
+ private static final String DELETE = "Delete";
+ private static final String CONFIRM_DELETION = "Confirm Deletion";
+
+ /* (non-Javadoc)
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
@Override
@@ -124,7 +128,7 @@ public class DeleteHandler extends AbstractHandler {
if (object != null){
config = new NameDeletionConfigurator();
- DeleteConfiguratorDialog dialog = new DeleteConfiguratorDialog(config, HandlerUtil.getActiveShell(event), "Confirm Deletion", null, "Do you really want to delete the name?\nThis operation is irreversible!", MessageDialog.WARNING, new String[] { "Delete", "Skip" }, 0, true);
+ DeleteConfiguratorDialog dialog = new DeleteConfiguratorDialog(config, HandlerUtil.getActiveShell(event), CONFIRM_DELETION, null, "Do you really want to delete the name?\nThis operation is irreversible!", MessageDialog.WARNING, new String[] { DELETE, SKIP }, 0, true);
int result_dialog= dialog.open();
if (result_dialog != Status.OK){
return null;
@@ -140,7 +144,7 @@ public class DeleteHandler extends AbstractHandler {
Synonym synonym = HibernateProxyHelper.deproxy(object, Synonym.class);
config = new SynonymDeletionConfigurator();
errorMessage = "The synonym ";
- 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, true);
+ 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, true);
int result_dialog= dialog.open();
if (result_dialog != Status.OK){
return null;
@@ -159,7 +163,7 @@ public class DeleteHandler extends AbstractHandler {
config = new TaxonDeletionConfigurator();
((TaxonDeletionConfigurator) config).setDeleteInAllClassifications(true);
DeleteConfiguratorDialog dialog;
- 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, true);
+ 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, true);
int result_dialog= dialog.open();
if (result_dialog != Status.OK){
return null;
@@ -174,7 +178,7 @@ public class DeleteHandler extends AbstractHandler {
config = new MediaDeletionConfigurator();
Media media = HibernateProxyHelper.deproxy(object, Media.class);
DeleteConfiguratorDialog dialog;
- dialog = new DeleteConfiguratorDialog(config, HandlerUtil.getActiveShell(event), "Confirm Deletion", null, "Do you really want to delete the media?", MessageDialog.WARNING, new String[] { "Delete", "Skip" }, 0, true);
+ dialog = new DeleteConfiguratorDialog(config, HandlerUtil.getActiveShell(event), CONFIRM_DELETION, null, "Do you really want to delete the media?", MessageDialog.WARNING, new String[] { DELETE, SKIP }, 0, true);
int result_dialog= dialog.open();
if (result_dialog != Status.OK){
return null;
--
2.34.1