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.termtree.e4.operation;
|
10
|
|
11
|
import java.util.UUID;
|
12
|
|
13
|
import org.eclipse.core.commands.ExecutionException;
|
14
|
import org.eclipse.core.runtime.IAdaptable;
|
15
|
import org.eclipse.core.runtime.IProgressMonitor;
|
16
|
import org.eclipse.core.runtime.IStatus;
|
17
|
|
18
|
import eu.etaxonomy.cdm.api.service.DeleteResult;
|
19
|
import eu.etaxonomy.cdm.api.service.IFeatureNodeService;
|
20
|
import eu.etaxonomy.cdm.api.service.config.TermNodeDeletionConfigurator;
|
21
|
import eu.etaxonomy.cdm.model.term.TermNode;
|
22
|
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
|
23
|
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
|
24
|
import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
|
25
|
import eu.etaxonomy.taxeditor.store.CdmStore;
|
26
|
import eu.etaxonomy.taxeditor.store.StoreUtil;
|
27
|
|
28
|
/**
|
29
|
* @author pplitzner
|
30
|
* @since Apr 30, 2018
|
31
|
*
|
32
|
*/
|
33
|
public class RemoveFeatureOperation extends AbstractPostOperation<TermNode>{
|
34
|
|
35
|
public RemoveFeatureOperation(UUID elementUuid,
|
36
|
IPostOperationEnabled postOperationEnabled, ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
|
37
|
super("Remove Feature", elementUuid, StoreUtil.getUndoContext(), postOperationEnabled, cdmEntitySessionEnabled);
|
38
|
}
|
39
|
|
40
|
@Override
|
41
|
public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
|
42
|
DeleteResult result = CdmStore.getService(IFeatureNodeService.class).deleteFeatureNode(elementUuid, new TermNodeDeletionConfigurator());
|
43
|
return postExecute(null);
|
44
|
}
|
45
|
|
46
|
@Override
|
47
|
public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
|
48
|
return null;
|
49
|
}
|
50
|
|
51
|
@Override
|
52
|
public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
|
53
|
return null;
|
54
|
}
|
55
|
|
56
|
|
57
|
|
58
|
}
|