ref #4611 Refactor string constants
authorPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 21 Mar 2017 13:33:12 +0000 (14:33 +0100)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 21 Mar 2017 13:33:12 +0000 (14:33 +0100)
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java

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