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
.operations
;
12 import org
.apache
.log4j
.Logger
;
13 import org
.eclipse
.core
.commands
.ExecutionException
;
14 import org
.eclipse
.core
.commands
.operations
.IUndoContext
;
15 import org
.eclipse
.core
.runtime
.IAdaptable
;
16 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
17 import org
.eclipse
.core
.runtime
.IStatus
;
19 import eu
.etaxonomy
.cdm
.model
.taxon
.Synonym
;
20 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
26 * @deprecated there will be an operation to set the basionym only that automatically unsets the former basionym
28 public class ChangeSynonymToHomotypicalGroupBasionymOperation
extends AbstractPostOperation
{
29 private static final Logger logger
= Logger
30 .getLogger(ChangeSynonymToHomotypicalGroupBasionymOperation
.class);
32 private Synonym synonym
;
34 public ChangeSynonymToHomotypicalGroupBasionymOperation(String text
, IUndoContext undoContext
,
35 Taxon taxon
, Synonym synonym
) {
36 super(text
, undoContext
, taxon
);
38 this.synonym
= synonym
;
42 * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
45 public IStatus
execute(IProgressMonitor monitor
, IAdaptable info
)
46 throws ExecutionException
{
47 // // Get basionym for synonyms homotypic group
48 // homotypicGroup = synonym.getHomotypicGroup();
49 // TaxonNameBase basionym = homotypicGroup.getBasionym();
51 // // Check if synonym is already basionym
52 // if(basionym != null && basionym.equals(synonym.getName())){
53 // return Status.OK_STATUS;
56 // TODO replace w method from cdmlib
57 // FIXME this is also old code: reimplement
58 // CdmUtil.setGroupBasionym(synonym.getName());
60 return postExecute(synonym
);
64 * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
67 public IStatus
redo(IProgressMonitor monitor
, IAdaptable info
)
68 throws ExecutionException
{
69 return execute(monitor
, info
);
73 * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
76 public IStatus
undo(IProgressMonitor monitor
, IAdaptable info
)
77 throws ExecutionException
{
78 // TODO replace w method from cdmlib
79 // FIXME this is also old code: reimplement
80 // CdmUtil.removeGroupBasionym(synonym.getName());
82 return postExecute(synonym
);