Project

General

Profile

Download (2.04 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.DeleteResult;
17
import eu.etaxonomy.cdm.api.service.IFeatureNodeService;
18
import eu.etaxonomy.cdm.api.service.config.TermNodeDeletionConfigurator;
19
import eu.etaxonomy.cdm.model.description.Feature;
20
import eu.etaxonomy.cdm.model.term.TermNode;
21
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
22
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
23
import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
24
import eu.etaxonomy.taxeditor.store.CdmStore;
25
import eu.etaxonomy.taxeditor.store.StoreUtil;
26

    
27
/**
28
 * @author pplitzner
29
 * @since Apr 30, 2018
30
 *
31
 */
32
public class RemoveFeatureOperation extends AbstractPostOperation<TermNode<Feature>>{
33

    
34
    public RemoveFeatureOperation(TermNode<Feature> element,
35
            IPostOperationEnabled postOperationEnabled, ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
36
        super("Remove Feature", StoreUtil.getUndoContext(), element, postOperationEnabled, cdmEntitySessionEnabled);
37
    }
38

    
39
    @Override
40
    public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
41
        DeleteResult result = CdmStore.getService(IFeatureNodeService.class).deleteFeatureNode(element.getUuid(), new TermNodeDeletionConfigurator());
42
        return postExecute(null);
43
    }
44

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

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

    
55

    
56

    
57
}
(5-5/6)