4 package eu
.etaxonomy
.taxeditor
.editor
.key
.polytomous
.operation
;
6 import org
.eclipse
.core
.commands
.ExecutionException
;
7 import org
.eclipse
.core
.commands
.operations
.IUndoContext
;
8 import org
.eclipse
.core
.runtime
.IAdaptable
;
9 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
10 import org
.eclipse
.core
.runtime
.IStatus
;
12 import eu
.etaxonomy
.cdm
.model
.description
.PolytomousKeyNode
;
13 import eu
.etaxonomy
.taxeditor
.operation
.AbstractPostTaxonOperation
;
14 import eu
.etaxonomy
.taxeditor
.operation
.IPostOperationEnabled
;
20 public class CreateNodeOperation
extends AbstractPostTaxonOperation
{
22 PolytomousKeyNode parentNode
;
23 private PolytomousKeyNode childNode
;
25 public CreateNodeOperation(String label
,
26 IUndoContext undoContext
, PolytomousKeyNode parentNode
, IPostOperationEnabled postOperationEnabled
) {
27 super(label
, undoContext
, postOperationEnabled
);
28 this.parentNode
= parentNode
;
32 * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
35 public IStatus
execute(IProgressMonitor monitor
, IAdaptable info
)
36 throws ExecutionException
{
38 childNode
= PolytomousKeyNode
.NewInstance();
40 parentNode
.addChild(childNode
);
42 return postExecute(childNode
);
46 * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
49 public IStatus
redo(IProgressMonitor monitor
, IAdaptable info
)
50 throws ExecutionException
{
51 // TODO Auto-generated method stub
56 * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
59 public IStatus
undo(IProgressMonitor monitor
, IAdaptable info
)
60 throws ExecutionException
{
61 // TODO Auto-generated method stub