Project

General

Profile

Download (1.76 KB) Statistics
| Branch: | Tag: | Revision:
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.navigation.navigator.operation;
11

    
12
import org.eclipse.core.runtime.IAdaptable;
13
import org.eclipse.core.runtime.IProgressMonitor;
14

    
15
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
16
import eu.etaxonomy.cdm.api.service.UpdateResult;
17
import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
18
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
19
import eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation;
20
import eu.etaxonomy.taxeditor.store.CdmStore;
21

    
22

    
23
/**
24
 * @author cmathew
25
 * @date 17 Jun 2015
26
 *
27
 */
28
public class RemotingChangeAcceptedTaxonToSynonymOperation extends RemotingCdmUpdateOperation {
29

    
30
    private final TaxonNode newAcceptedTaxonNode;
31
    private final ITaxonTreeNode oldTaxonNode;
32

    
33
    /**
34
     * @param label
35
     */
36
    public RemotingChangeAcceptedTaxonToSynonymOperation(String label,
37
            ITaxonTreeNode oldTaxonNode,
38
            TaxonNode newAcceptedTaxonNode) {
39
        super(label);
40
        this.oldTaxonNode = oldTaxonNode;
41
        this.newAcceptedTaxonNode = newAcceptedTaxonNode;
42
    }
43

    
44
    /* (non-Javadoc)
45
     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation#doUpdateExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
46
     */
47
    @Override
48
    public UpdateResult doUpdateExecute(IProgressMonitor monitor, IAdaptable info) {
49
        return CdmStore.getService(ITaxonNodeService.class).makeTaxonNodeASynonymOfAnotherTaxonNode(oldTaxonNode.getUuid(), newAcceptedTaxonNode.getUuid(), null, null, null);
50
    }
51

    
52
}
(6-6/6)