Merge branch 'release/4.6.0'
[taxeditor.git] / eu.etaxonomy.taxeditor.navigation / src / main / java / eu / etaxonomy / taxeditor / navigation / navigator / handler / RemotingMoveFactualDataHandler.java
index f0fa3d9216b6a79f22588f711f2aa27d7317c7e6..c77c20dc19b06bab43c124af21db768b0419dfe8 100644 (file)
@@ -1,4 +1,3 @@
-// $Id$
 /**
 * Copyright (C) 2015 EDIT
 * European Distributed Institute of Taxonomy
@@ -30,6 +29,7 @@ import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
+import eu.etaxonomy.taxeditor.navigation.l10n.Messages;
 import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigatorLabels;
 import eu.etaxonomy.taxeditor.navigation.navigator.operation.RemotingMoveFactualDataOperation;
 import eu.etaxonomy.taxeditor.operation.RemotingCdmHandler;
@@ -61,14 +61,14 @@ public class RemotingMoveFactualDataHandler extends RemotingCdmHandler {
         // check that only a single taxon tree node has been selected
         if(selection.size() > 1) {
             return new Status(IStatus.ERROR,
-                    "unknown",
+                    "unknown", //$NON-NLS-1$
                     TaxonNavigatorLabels.SINGLE_TAXON_SELECTION_MESSAGE);
         }
 
         // check for no taxon tree node selected
         if(selection.size() == 0) {
             return new Status(IStatus.ERROR,
-                    "unknown",
+                    "unknown", //$NON-NLS-1$
                     TaxonNavigatorLabels.NO_TAXON_SELECTION_MESSAGE);
         }
 
@@ -78,13 +78,13 @@ public class RemotingMoveFactualDataHandler extends RemotingCdmHandler {
             sourceTaxonNode = (TaxonNode)obj;
         } else {
             return new Status(IStatus.ERROR,
-                    "unknown",
+                    "unknown", //$NON-NLS-1$
                     TaxonNavigatorLabels.SELECTED_OBJECT_NOT_TREE_NODE_MESSAGE);
         }
 
         if(NavigationUtil.isDirty(sourceTaxonNode)) {
             return new Status(IStatus.ERROR,
-                    "unknown",
+                    "unknown", //$NON-NLS-1$
                     TaxonNavigatorLabels.UNSAVED_CHANGES_MESSAGE);
         }
 
@@ -93,19 +93,19 @@ public class RemotingMoveFactualDataHandler extends RemotingCdmHandler {
 
         targetTaxonNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event),
                 new ConversationHolderMock(),
-                "Choose the accepted taxon",
+                Messages.RemotingMoveFactualDataHandler_CHOOSE_TAXA,
                 excludeTaxa,
                 null,
-                null);
+                sourceTaxonNode.getClassification());
 
         if(targetTaxonNode == null) {
             return new Status(IStatus.CANCEL,
-                    "unknown",
-                    "");
+                    "unknown", //$NON-NLS-1$
+                    ""); //$NON-NLS-1$
         }
         if(NavigationUtil.isDirty(targetTaxonNode)){
             return new Status(IStatus.ERROR,
-                    "unknown",
+                    "unknown", //$NON-NLS-1$
                     TaxonNavigatorLabels.UNSAVED_CHANGES_MESSAGE);
         }
         return Status.OK_STATUS;
@@ -144,7 +144,7 @@ public class RemotingMoveFactualDataHandler extends RemotingCdmHandler {
                     MessagingUtils.error(this.getClass(), e);
                     throw new RuntimeException(e);
                 } catch (Exception e) {
-                    MessagingUtils.warningDialog("Could not create Taxon", this, e.getMessage());
+                    MessagingUtils.warningDialog(Messages.RemotingMoveFactualDataHandler_CREATE_FAILED, this, e.getMessage());
                 }
             }