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
;
21 import eu
.etaxonomy
.cdm
.api
.service
.IDescriptionService
;
22 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionBase
;
23 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionElementBase
;
24 import eu
.etaxonomy
.taxeditor
.operation
.AbstractPostTaxonOperation
;
25 import eu
.etaxonomy
.taxeditor
.operation
.IPostOperationEnabled
;
26 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
30 * @created Feb 8, 2011
33 public class MoveDescriptionElementsOperation
extends AbstractPostTaxonOperation
{
35 private Collection
<DescriptionElementBase
> descriptionElements
;
36 private DescriptionBase targetDescription
;
37 private IDescriptionService service
;
38 private boolean isCopy
;
44 * @param targetDescription
45 * @param descriptionElements
47 * @param postOperationEnabled
49 public MoveDescriptionElementsOperation(String label
,
50 IUndoContext undoContext
, DescriptionBase targetDescription
,
51 Collection
<DescriptionElementBase
> descriptionElements
, boolean isCopy
,
52 IPostOperationEnabled postOperationEnabled
) {
53 super(label
, undoContext
, postOperationEnabled
);
54 this.targetDescription
= targetDescription
;
55 this.descriptionElements
= descriptionElements
;
58 service
= CdmStore
.getService(IDescriptionService
.class);
62 * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
65 public IStatus
execute(IProgressMonitor monitor
, IAdaptable info
)
66 throws ExecutionException
{
69 service
.moveDescriptionElementsToDescription(descriptionElements
, targetDescription
, isCopy
);
71 return postExecute(targetDescription
);
75 * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
78 public IStatus
redo(IProgressMonitor monitor
, IAdaptable info
)
79 throws ExecutionException
{
80 // TODO Auto-generated method stub
85 * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
88 public IStatus
undo(IProgressMonitor monitor
, IAdaptable info
)
89 throws ExecutionException
{
90 // TODO Auto-generated method stub