Improve message for orphaned taxa/synonyms #5824
authorPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 25 May 2016 15:27:49 +0000 (17:27 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 25 May 2016 15:27:49 +0000 (17:27 +0200)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/TaxonEditorInput.java

index ed48936664c344de0a08c175f8c80ccc95b3c982..f943e33f4be734f7f01ae7b08408800700b6a817 100644 (file)
@@ -33,6 +33,7 @@ import eu.etaxonomy.cdm.model.common.ITreeNode;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.editor.group.authority.CdmAuthorityEditor;
@@ -173,8 +174,19 @@ public class EditorUtil extends AbstractUtility {
                        throws PartInitException {
            TaxonBase taxonBase = CdmStore.getService(ITaxonService.class).find(taxonBaseUuid);
         if (taxonBase != null && taxonBase.isOrphaned()) {
-                MessagingUtils.warningDialog("Orphaned Taxon", TaxonEditorInput.class, "This is an orphaned taxon i.e. a taxon that is not connected to a classification and not having any taxonomic relationships. Editing of orphaned taxa is currently not supported.");
+            if(taxonBase.isInstanceOf(Synonym.class)){
+                MessagingUtils.warningDialog("Orphaned accepted taxon", TaxonEditorInput.class, "The accepted "
+                        + "taxon of this synonym is not part of any classification. Editing with the "
+                        + "name editor is currently not implemented. Try to edit the taxon with the bulk editor.");
                 return;
+            }
+            else{
+                MessagingUtils.warningDialog("Orphaned Taxon", TaxonEditorInput.class, "This is an orphaned taxon "
+                        + "i.e. a taxon that is not connected to a classification and not having any taxonomic "
+                        + "relationships. Editing of orphaned taxa in the name editor currently not supported. "
+                        + "Try editing with the bulk editor");
+                return;
+            }
         }
                TaxonEditorInput input = TaxonEditorInput
                                .NewInstanceFromTaxonBase(taxonBaseUuid);
index fc6951c5cf732d87a2466bb6f66c0b04f41c6971..d127c3f317347b866f89fcb6f23b84ce44643c29 100644 (file)
@@ -171,9 +171,11 @@ public class TaxonEditorInput  extends CdmEntitySessionInput implements IEditorI
             if(taxonNode != null){
                 init(taxonNode);
             }
-        }else if(taxonNodes.size() == 0){
+        } else if (taxonNodes.size() == 0) {
             // this is an undesired state
-            MessagingUtils.warningDialog("Incorrect state", TaxonEditorInput.class, "The accepted taxon is not part of any classification. This should not have happened.");
+            MessagingUtils.warningDialog("Incorrect state",TaxonEditorInput.class,"The accepted "
+                    + "taxon is not part of any classification. Editing with the "
+                    + "name editor is currently not implemented. Try to edit the taxon with the bulk editor.");
         }
     }