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
.view
.descriptive
.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
.description
.TaxonDescription
;
19 import eu
.etaxonomy
.taxeditor
.operation
.AbstractPostTaxonOperation
;
20 import eu
.etaxonomy
.taxeditor
.operation
.IPostOperationEnabled
;
23 * <p>DeleteTaxonDescriptionOperation class.</p>
30 public class DeleteTaxonDescriptionOperation
extends AbstractPostTaxonOperation
{
32 private final TaxonDescription description
;
35 * <p>Constructor for DeleteTaxonDescriptionOperation.</p>
37 * @param label a {@link java.lang.String} object.
38 * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
39 * @param description a {@link eu.etaxonomy.cdm.model.description.TaxonDescription} object.
40 * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
42 public DeleteTaxonDescriptionOperation(String label
, IUndoContext undoContext
,
43 TaxonDescription description
, IPostOperationEnabled postOperationEnabled
) {
44 super(label
, undoContext
, postOperationEnabled
);
46 this.description
= description
;
47 element
= description
.getTaxon();
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
{
59 element
.removeDescription(description
);
62 return postExecute(description
);
66 * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
70 public IStatus
redo(IProgressMonitor monitor
, IAdaptable info
)
71 throws ExecutionException
{
72 return execute(monitor
, info
);
76 * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
80 public IStatus
undo(IProgressMonitor monitor
, IAdaptable info
)
81 throws ExecutionException
{
83 element
.addDescription(description
);
85 return postExecute(null);