2 * Copyright (C) 2015 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.
9 package eu
.etaxonomy
.taxeditor
.editor
.key
.polytomous
.operation
;
11 import org
.eclipse
.core
.runtime
.IAdaptable
;
12 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
14 import eu
.etaxonomy
.cdm
.api
.application
.CdmChangeEvent
.Action
;
15 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
16 import eu
.etaxonomy
.cdm
.model
.description
.PolytomousKeyNode
;
17 import eu
.etaxonomy
.taxeditor
.operation
.IPostOperationEnabled
;
18 import eu
.etaxonomy
.taxeditor
.operation
.RemotingCdmDefaultOperation
;
25 public class RemotingCreatePolytomousKeyNodeOperation
extends RemotingCdmDefaultOperation
{
27 private final PolytomousKeyNode parentNode
;
28 private PolytomousKeyNode childNode
;
32 protected IPostOperationEnabled postOperationEnabled
;
34 public PolytomousKeyNode
getChildNode() {
38 private final static String LABEL
= "Create new polytomous key node";
40 public RemotingCreatePolytomousKeyNodeOperation(Object source
,
42 PolytomousKeyNode parentNode
, IPostOperationEnabled postOperationEnabled
){
43 super(LABEL
, Action
.Create
, source
, async
);
44 this.parentNode
= parentNode
;
45 this.postOperationEnabled
= postOperationEnabled
;
49 * @see eu.etaxonomy.taxeditor.operation.RemotingCdmSimpleOperation#doSimpleExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
52 protected CdmBase
doSimpleExecute(IProgressMonitor monitor
, IAdaptable info
) throws Exception
{
53 childNode
= PolytomousKeyNode
.NewInstance();
54 parentNode
.addChild(childNode
);
55 if (postOperationEnabled
.postOperation(childNode
)){