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
.conversation
.IConversationEnabled
;
19 import eu
.etaxonomy
.cdm
.api
.service
.IDescriptionService
;
20 import eu
.etaxonomy
.cdm
.model
.description
.TaxonDescription
;
21 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNode
;
22 import eu
.etaxonomy
.taxeditor
.operation
.AbstractPersistentPostOperation
;
23 import eu
.etaxonomy
.taxeditor
.operation
.IPostOperationEnabled
;
24 import eu
.etaxonomy
.taxeditor
.session
.ICdmEntitySessionEnabled
;
25 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
28 * <p>MoveDescriptionToOtherTaxonOperation</p>
30 * @author a.kohlbecker
31 * @created Okt. 11, 2013
33 public class MoveDescriptionToOtherTaxonOperation
extends
34 AbstractPersistentPostOperation
{
36 private final TaxonNode newAcceptedTaxonNode
;
38 private final TaxonDescription description
;
41 * <p>Constructor for ChangeAcceptedTaxonToSynonymOperation.</p>
43 * @param label a {@link java.lang.String} object.
44 * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
45 * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
46 * @param description a {@link TaxonDescription} object.
47 * @param targetTaxonNode a {@link eu.etaxonomy.cdm.model.taxon.TaxonNode} object.
48 * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
50 public MoveDescriptionToOtherTaxonOperation(String label
,
51 IUndoContext undoContext
,
52 TaxonDescription description
,
53 TaxonNode targetTaxonNode
,
54 IPostOperationEnabled postOperationEnabled
,
55 IConversationEnabled conversationEnabled
,
56 ICdmEntitySessionEnabled cdmEntitySessionEnabled
) {
57 super(label
, undoContext
, postOperationEnabled
, conversationEnabled
, cdmEntitySessionEnabled
); // FIXME is this the right constructor ???
58 this.description
= description
;
59 this.newAcceptedTaxonNode
= targetTaxonNode
;
64 * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
68 public IStatus
execute(IProgressMonitor monitor
, IAdaptable info
)
69 throws ExecutionException
{
72 CdmStore
.getService(IDescriptionService
.class).moveTaxonDescription(description
.getUuid(), newAcceptedTaxonNode
.getTaxon().getUuid());
75 return postExecute(description
);
79 * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
83 public IStatus
redo(IProgressMonitor monitor
, IAdaptable info
)
84 throws ExecutionException
{
85 // TODO Auto-generated method stub
90 * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
94 public IStatus
undo(IProgressMonitor monitor
, IAdaptable info
)
95 throws ExecutionException
{
96 // TODO Auto-generated method stub