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;
Set<TaxonRelationship> taxonRelationships = taxon.getTaxonRelations(relatedTaxon);
if(taxonRelationships.size() > 1){
- MessagingUtils.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;
}
// 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);
}
public IStatus undo(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
// see FIXME in execute()
- MessagingUtils.warn(this.getClass(), "Not implemented yet. See developer documentation for details");
+ MessagingUtils.warn(this.getClass(), Messages.ChangeConceptRelationshipTypeOperation_NOT_IMPLEMENTED);
return null;
}
}