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
.api
.service
.IDescriptionService
;
19 import eu
.etaxonomy
.cdm
.model
.description
.TaxonDescription
;
20 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNode
;
21 import eu
.etaxonomy
.taxeditor
.operation
.AbstractPersistentPostOperation
;
22 import eu
.etaxonomy
.taxeditor
.operation
.IPostOperationEnabled
;
23 import eu
.etaxonomy
.taxeditor
.session
.ICdmEntitySessionEnabled
;
24 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
27 * <p>MoveDescriptionToOtherTaxonOperation</p>
29 * @author a.kohlbecker
30 * @created Okt. 11, 2013
32 public class MoveDescriptionToOtherTaxonOperation
extends
33 AbstractPersistentPostOperation
{
35 private final TaxonNode newAcceptedTaxonNode
;
37 private final TaxonDescription description
;
39 private boolean setNameInSource
;
42 * <p>Constructor for ChangeAcceptedTaxonToSynonymOperation.</p>
44 * @param label a {@link java.lang.String} object.
45 * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
46 * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
47 * @param description a {@link TaxonDescription} object.
48 * @param targetTaxonNode a {@link eu.etaxonomy.cdm.model.taxon.TaxonNode} object.
50 public MoveDescriptionToOtherTaxonOperation(String label
,
51 IUndoContext undoContext
,
52 TaxonDescription description
,
53 TaxonNode targetTaxonNode
,
54 IPostOperationEnabled postOperationEnabled
,
55 ICdmEntitySessionEnabled cdmEntitySessionEnabled
,
56 boolean setNameInSource
) {
57 super(label
, undoContext
, postOperationEnabled
, cdmEntitySessionEnabled
); // FIXME is this the right constructor ???
58 this.description
= description
;
59 this.setNameInSource
= setNameInSource
;
60 this.newAcceptedTaxonNode
= targetTaxonNode
;
65 * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
69 public IStatus
execute(IProgressMonitor monitor
, IAdaptable info
)
70 throws ExecutionException
{
75 CdmStore
.getService(IDescriptionService
.class).moveTaxonDescription(description
.getUuid(), newAcceptedTaxonNode
.getTaxon().getUuid(), setNameInSource
);
80 return postExecute(description
);
84 * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
88 public IStatus
redo(IProgressMonitor monitor
, IAdaptable info
)
89 throws ExecutionException
{
90 // TODO Auto-generated method stub
95 * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
99 public IStatus
undo(IProgressMonitor monitor
, IAdaptable info
)
100 throws ExecutionException
{
101 // TODO Auto-generated method stub