Project

General

Profile

Download (2.06 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2015 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
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.
8
*/
9
package eu.etaxonomy.taxeditor.navigation.navigator.operation;
10

    
11
import java.util.UUID;
12

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

    
16
import eu.etaxonomy.cdm.api.application.CdmApplicationState;
17
import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
18
import eu.etaxonomy.cdm.api.service.IDescriptionService;
19
import eu.etaxonomy.cdm.api.service.UpdateResult;
20
import eu.etaxonomy.taxeditor.navigation.l10n.Messages;
21
import eu.etaxonomy.taxeditor.operation.CdmUpdateOperation;
22

    
23
/**
24
 * @author cmathew
25
 * @date 19 Jun 2015
26
 *
27
 */
28
public class MoveFactualDataOperation extends CdmUpdateOperation {
29

    
30
    private final static String LABEL = Messages.RemotingMoveFactualDataOperation_MOVE_OP;
31

    
32
    private final UUID sourceTaxonUuid;
33
    private final UUID targetParentTaxonUuid;
34
    private boolean setNameInSource;
35

    
36
    /**
37
     * @param label
38
     * @param action
39
     * @param source
40
     * @param async
41
     */
42
    public MoveFactualDataOperation(Object source,
43
            boolean async,
44
            UUID sourceTaxonUuid,
45
            UUID targetParentTaxonUuid, boolean setNameInSource) {
46
        super(LABEL, Action.Update, source, async);
47
        this.sourceTaxonUuid = sourceTaxonUuid;
48
        this.targetParentTaxonUuid = targetParentTaxonUuid;
49
        this.setNameInSource = setNameInSource;
50
    }
51

    
52
    /* (non-Javadoc)
53
     * @see eu.etaxonomy.taxeditor.operation.CdmUpdateOperation#doUpdateExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
54
     */
55
    @Override
56
    protected UpdateResult doUpdateExecute(IProgressMonitor monitor, IAdaptable info) throws Exception {
57
        return CdmApplicationState.getService(IDescriptionService.class).moveTaxonDescriptions(sourceTaxonUuid,
58
                targetParentTaxonUuid, setNameInSource);//TODO
59
    }
60

    
61
}
(5-5/10)