3 * Copyright (C) 2015 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.
10 package eu
.etaxonomy
.taxeditor
.editor
.key
.polytomous
.operation
;
12 import org
.eclipse
.core
.runtime
.IAdaptable
;
13 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
15 import eu
.etaxonomy
.cdm
.api
.application
.CdmApplicationState
;
16 import eu
.etaxonomy
.cdm
.api
.application
.CdmChangeEvent
.Action
;
17 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
18 import eu
.etaxonomy
.cdm
.model
.description
.PolytomousKeyNode
;
19 import eu
.etaxonomy
.taxeditor
.operation
.RemotingCdmMergeOperation
;
26 public class RemotingCreatePolytomousKeyNodeOperation
extends RemotingCdmMergeOperation
{
28 private final PolytomousKeyNode parentNode
;
30 private final static String LABEL
= "Create new polytomous key node";
32 public RemotingCreatePolytomousKeyNodeOperation(Object source
,
34 PolytomousKeyNode parentNode
){
35 super(LABEL
, Action
.Create
, source
, async
);
36 this.parentNode
= parentNode
;
39 * @see eu.etaxonomy.taxeditor.operation.RemotingCdmMergeOperation#doMergeExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
42 protected CdmBase
doMergeExecute(IProgressMonitor monitor
, IAdaptable info
) throws Exception
{
43 PolytomousKeyNode childNode
= PolytomousKeyNode
.NewInstance();
44 parentNode
.addChild(childNode
);
45 return CdmApplicationState
.getCurrentAppConfig().getPolytomousKeyNodeService().merge(childNode
);