ref #6805 Only drop features from term editor to feature tree editor
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / featuretree / e4 / operation / RemoveFeatureTreeOperation.java
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.FeatureTree;
18 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
19 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
20 import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
21 import eu.etaxonomy.taxeditor.store.CdmStore;
22 import eu.etaxonomy.taxeditor.store.StoreUtil;
23
24 /**
25 * @author pplitzner
26 * @since Apr 30, 2018
27 *
28 */
29 public class RemoveFeatureTreeOperation extends AbstractPostOperation<FeatureTree>{
30
31 public RemoveFeatureTreeOperation(FeatureTree element,
32 IPostOperationEnabled postOperationEnabled, ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
33 super("Remove Feature Tree", StoreUtil.getUndoContext(), element, postOperationEnabled, cdmEntitySessionEnabled);
34 }
35
36 @Override
37 public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
38 CdmStore.getService(IFeatureTreeService.class).delete(element.getUuid());
39 return postExecute(null);
40 }
41
42 @Override
43 public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
44 return null;
45 }
46
47 @Override
48 public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
49 return null;
50 }
51
52 }