2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.editor
.name
.operation
;
12 import org
.eclipse
.core
.commands
.ExecutionException
;
13 import org
.eclipse
.core
.commands
.operations
.IUndoContext
;
14 import org
.eclipse
.core
.runtime
.IAdaptable
;
15 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
16 import org
.eclipse
.core
.runtime
.IStatus
;
18 import eu
.etaxonomy
.cdm
.model
.taxon
.Synonym
;
19 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
20 import eu
.etaxonomy
.taxeditor
.operation
.AbstractPostTaxonOperation
;
23 * <p>ChangeSynonymToHomotypicalGroupBasionymOperation class.</p>
28 * @deprecated there will be an operation to set the basionym only that automatically unsets the former basionym
30 public class ChangeSynonymToHomotypicalGroupBasionymOperation
extends AbstractPostTaxonOperation
{
32 private Synonym synonym
;
35 * <p>Constructor for ChangeSynonymToHomotypicalGroupBasionymOperation.</p>
37 * @param text a {@link java.lang.String} object.
38 * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
39 * @param taxon a {@link eu.etaxonomy.cdm.model.taxon.Taxon} object.
40 * @param synonym a {@link eu.etaxonomy.cdm.model.taxon.Synonym} object.
42 public ChangeSynonymToHomotypicalGroupBasionymOperation(String text
, IUndoContext undoContext
,
43 Taxon taxon
, Synonym synonym
) {
44 super(text
, undoContext
, taxon
);
46 this.synonym
= synonym
;
50 * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
54 public IStatus
execute(IProgressMonitor monitor
, IAdaptable info
)
55 throws ExecutionException
{
58 // // Get basionym for synonyms homotypic group
59 // homotypicGroup = synonym.getHomotypicGroup();
60 // TaxonNameBase basionym = homotypicGroup.getBasionym();
62 // // Check if synonym is already basionym
63 // if(basionym != null && basionym.equals(synonym.getName())){
64 // return Status.OK_STATUS;
67 // TODO replace w method from cdmlib
68 // FIXME this is also old code: reimplement
69 // CdmUtil.setGroupBasionym(synonym.getName());
72 return postExecute(synonym
);
76 * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
80 public IStatus
redo(IProgressMonitor monitor
, IAdaptable info
)
81 throws ExecutionException
{
82 return execute(monitor
, info
);
86 * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
90 public IStatus
undo(IProgressMonitor monitor
, IAdaptable info
)
91 throws ExecutionException
{
92 // TODO replace w method from cdmlib
93 // FIXME this is also old code: reimplement
94 // CdmUtil.removeGroupBasionym(synonym.getName());
96 return postExecute(synonym
);