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
.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
.name
.TaxonNameBase
;
19 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
20 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
23 * <p>RemoveHomotypicalGroupBasionymOperation class.</p>
29 public class RemoveHomotypicalGroupBasionymOperation
extends
30 AbstractPostOperation
{
32 private TaxonBase taxonBase
;
35 * <p>Constructor for RemoveHomotypicalGroupBasionymOperation.</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 taxonBase a {@link eu.etaxonomy.cdm.model.taxon.TaxonBase} object.
41 * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operations.IPostOperationEnabled} object.
43 public RemoveHomotypicalGroupBasionymOperation(String text
,
44 IUndoContext undoContext
, Taxon taxon
, TaxonBase taxonBase
, IPostOperationEnabled postOperationEnabled
) {
45 super(text
, undoContext
, taxon
, postOperationEnabled
);
47 this.taxonBase
= taxonBase
;
51 * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
55 public IStatus
execute(IProgressMonitor monitor
, IAdaptable info
)
56 throws ExecutionException
{
58 TaxonNameBase
<?
, ?
> name
= taxonBase
.getName();
61 name
.removeAsGroupsBasionym();
64 return postExecute(taxonBase
);
68 * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
72 public IStatus
redo(IProgressMonitor monitor
, IAdaptable info
)
73 throws ExecutionException
{
74 return execute(monitor
, info
);
78 * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
82 public IStatus
undo(IProgressMonitor monitor
, IAdaptable info
)
83 throws ExecutionException
{
84 taxonBase
.getName().setAsGroupsBasionym();
86 return postExecute(taxonBase
);