Project

General

Profile

Download (1.85 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2018 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.featuretree.e4.operation;
10

    
11
import org.eclipse.core.commands.ExecutionException;
12
import org.eclipse.core.runtime.IAdaptable;
13
import org.eclipse.core.runtime.IProgressMonitor;
14
import org.eclipse.core.runtime.IStatus;
15

    
16
import eu.etaxonomy.cdm.api.service.IFeatureTreeService;
17
import eu.etaxonomy.cdm.model.description.Feature;
18
import eu.etaxonomy.cdm.model.term.TermTree;
19
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
20
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
21
import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
22
import eu.etaxonomy.taxeditor.store.CdmStore;
23
import eu.etaxonomy.taxeditor.store.StoreUtil;
24

    
25
/**
26
 * @author pplitzner
27
 * @since Apr 30, 2018
28
 *
29
 */
30
public class CreateFeatureTreeOperation extends AbstractPostOperation<TermTree<Feature>>{
31

    
32
    public CreateFeatureTreeOperation(TermTree<Feature> element,
33
            IPostOperationEnabled postOperationEnabled, ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
34
        super("Create Feature Tree", StoreUtil.getUndoContext(), element, postOperationEnabled, cdmEntitySessionEnabled);
35
    }
36

    
37
    @Override
38
    public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
39
        CdmStore.getService(IFeatureTreeService.class).save(element);
40
        return postExecute(element);
41
    }
42

    
43
    @Override
44
    public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
45
        return null;
46
    }
47

    
48
    @Override
49
    public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
50
        return null;
51
    }
52

    
53
}
(3-3/6)