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
.navigation
.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
.IPolytomousKeyService
;
20 import eu
.etaxonomy
.cdm
.model
.description
.PolytomousKey
;
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
;
28 * @created Dec 2, 2010
31 @Deprecated // we do not undo creation of elements
32 public class CreatePolytomousKey
extends AbstractPersistentPostOperation
{
34 private final PolytomousKey key
;
39 * @param postOperationEnabled
40 * @param conversationEnabled
42 public CreatePolytomousKey(String label
,
43 IUndoContext undoContext
,
45 IPostOperationEnabled postOperationEnabled
,
46 IConversationEnabled conversationEnabled
,
47 ICdmEntitySessionEnabled cdmEntitySessionEnabled
) {
48 super(label
, undoContext
, postOperationEnabled
, conversationEnabled
, cdmEntitySessionEnabled
);
53 * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
56 public IStatus
execute(IProgressMonitor monitor
, IAdaptable info
)
57 throws ExecutionException
{
60 CdmStore
.getService(IPolytomousKeyService
.class).saveOrUpdate(key
);
63 return postExecute(key
);
67 * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
70 public IStatus
redo(IProgressMonitor monitor
, IAdaptable info
)
71 throws ExecutionException
{
76 * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
79 public IStatus
undo(IProgressMonitor monitor
, IAdaptable info
)
80 throws ExecutionException
{