ref #8526: remove workaround for hotfix
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / name / operation / ChangeConceptRelationshipTypeOperation.java
index 850747b6252772404bb0d6cfbb7f5145d9914067..285b5b093182c61df844930ddda426e4b49c38b1 100644 (file)
@@ -20,9 +20,12 @@ import org.eclipse.core.runtime.IStatus;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
+import eu.etaxonomy.taxeditor.editor.l10n.Messages;
+import eu.etaxonomy.taxeditor.event.EventUtility;
+import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>ChangeConceptRelationshipTypeOperation class.</p>
@@ -59,8 +62,7 @@ public class ChangeConceptRelationshipTypeOperation extends AbstractPostTaxonOpe
                Set<TaxonRelationship> taxonRelationships = taxon.getTaxonRelations(relatedTaxon);
 
                if(taxonRelationships.size() > 1){
-                       StoreUtil.warningDialog("Multiple relations between taxa", this, "There are multiple relations between the " +
-                                       "accepted and the related taxon. This case is not handled by the software yet");
+                       MessagingUtils.warningDialog(ChangeConceptToSynonymOperation.CHANGE_CONCEPT_TO_SYNONYM_OPERATION_MULTI_REPS, this, ChangeConceptToSynonymOperation.CHANGE_CONCEPT_TO_SYNONYM_OPERATION_MULTI_REPS_MESSAGE);
                        return;
                }
 
@@ -79,14 +81,15 @@ public class ChangeConceptRelationshipTypeOperation extends AbstractPostTaxonOpe
 
                // Remove relatedTaxon and old relationship
                // FIXME since taxon relationships come in a set, which relationships are we going to delete here?
-           element.removeTaxon(relatedTaxon, oldRelationshipType);
+         //  element.removeTaxon(relatedTaxon, oldRelationshipType);
                monitor.worked(20);
 
         // Add new relationship
                // TODO add microcitation for misapplied name to property sheet
-               relatedTaxon.addTaxonRelation(element, newRelationshipType, null, null);
+       //      relatedTaxon.addTaxonRelation(element, newRelationshipType, null, null);
+               this.taxonRelationship.setType(newRelationshipType);
                monitor.worked(40);
-
+               EventUtility.postEvent(WorkbenchEventConstants.REFRESH_DETAILS, true);
                return postExecute(relatedTaxon);
        }
 
@@ -108,7 +111,7 @@ public class ChangeConceptRelationshipTypeOperation extends AbstractPostTaxonOpe
        public IStatus undo(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
                // see FIXME in execute()
-               StoreUtil.warn(this.getClass(), "Not implemented yet. See developer documentation for details");
+               MessagingUtils.warn(this.getClass(), Messages.ChangeConceptRelationshipTypeOperation_NOT_IMPLEMENTED);
                return null;
        }
 }