#5247 Fix duplicate entity issue for new entities by using the new merge service...
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / key / polytomous / operation / RemotingCreatePolytomousKeyNodeOperation.java
1 // $Id$
2 /**
3 * Copyright (C) 2015 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
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.
9 */
10 package eu.etaxonomy.taxeditor.editor.key.polytomous.operation;
11
12 import org.eclipse.core.runtime.IAdaptable;
13 import org.eclipse.core.runtime.IProgressMonitor;
14
15 import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
16 import eu.etaxonomy.cdm.model.common.CdmBase;
17 import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
18 import eu.etaxonomy.taxeditor.operation.RemotingCdmDefaultOperation;
19
20 /**
21 * @author cmathew
22 * @date 21 Jul 2015
23 *
24 */
25 public class RemotingCreatePolytomousKeyNodeOperation extends RemotingCdmDefaultOperation {
26
27 private final PolytomousKeyNode parentNode;
28
29 private final static String LABEL = "Create new polytomous key node";
30
31 public RemotingCreatePolytomousKeyNodeOperation(Object source,
32 boolean async,
33 PolytomousKeyNode parentNode){
34 super(LABEL, Action.Create, source, async);
35 this.parentNode = parentNode;
36 }
37
38 /* (non-Javadoc)
39 * @see eu.etaxonomy.taxeditor.operation.RemotingCdmSimpleOperation#doSimpleExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
40 */
41 @Override
42 protected CdmBase doSimpleExecute(IProgressMonitor monitor, IAdaptable info) throws Exception {
43 PolytomousKeyNode childNode = PolytomousKeyNode.NewInstance();
44 parentNode.addChild(childNode);
45 return childNode;
46 }
47
48 }