3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
11 package eu
.etaxonomy
.taxeditor
.editor
.view
.descriptive
.operation
;
13 import java
.util
.Collection
;
15 import org
.eclipse
.core
.commands
.ExecutionException
;
16 import org
.eclipse
.core
.commands
.operations
.IUndoContext
;
17 import org
.eclipse
.core
.runtime
.IAdaptable
;
18 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
19 import org
.eclipse
.core
.runtime
.IStatus
;
20 import org
.eclipse
.swt
.widgets
.Display
;
21 import org
.eclipse
.ui
.PartInitException
;
23 import eu
.etaxonomy
.cdm
.api
.service
.IDescriptionService
;
24 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
25 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionBase
;
26 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementBase
;
27 import eu
.etaxonomy
.taxeditor
.editor
.EditorUtil
;
28 import eu
.etaxonomy
.taxeditor
.editor
.MultiPageTaxonEditor
;
29 import eu
.etaxonomy
.taxeditor
.model
.AbstractUtility
;
30 import eu
.etaxonomy
.taxeditor
.model
.MessagingUtils
;
31 import eu
.etaxonomy
.taxeditor
.operation
.AbstractPostTaxonOperation
;
32 import eu
.etaxonomy
.taxeditor
.operation
.IPostOperationEnabled
;
33 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
37 * @created Feb 8, 2011
40 public class MoveDescriptionElementsOperation
extends AbstractPostTaxonOperation
{
42 private Collection
<DescriptionElementBase
> descriptionElements
;
43 private DescriptionBase targetDescription
;
44 private IDescriptionService service
;
45 private boolean isCopy
;
51 * @param targetDescription
52 * @param descriptionElements
54 * @param postOperationEnabled
56 public MoveDescriptionElementsOperation(String label
,
57 IUndoContext undoContext
, DescriptionBase targetDescription
,
58 Collection
<DescriptionElementBase
> descriptionElements
, boolean isCopy
,
59 IPostOperationEnabled postOperationEnabled
) {
60 super(label
, undoContext
, postOperationEnabled
);
61 this.targetDescription
= targetDescription
;
62 this.descriptionElements
= descriptionElements
;
65 service
= CdmStore
.getService(IDescriptionService
.class);
69 * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
72 public IStatus
execute(IProgressMonitor monitor
, IAdaptable info
)
73 throws ExecutionException
{
76 service
.moveDescriptionElementsToDescription(descriptionElements
, targetDescription
, isCopy
);
79 return postExecute(targetDescription
);
83 * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
86 public IStatus
redo(IProgressMonitor monitor
, IAdaptable info
)
87 throws ExecutionException
{
88 // TODO Auto-generated method stub
93 * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
96 public IStatus
undo(IProgressMonitor monitor
, IAdaptable info
)
97 throws ExecutionException
{
98 // TODO Auto-generated method stub