/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
import eu.etaxonomy.cdm.model.description.DescriptionBase;
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
-import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
/**
* <p>DeleteDescriptionElementOperation class.</p>
* @created 05.02.2009
* @version 1.0
*/
-public class DeleteDescriptionElementOperation extends AbstractPostOperation {
-
- private DescriptionElementBase element;
+public class DeleteDescriptionElementOperation extends AbstractPostTaxonOperation {
+
+ private final DescriptionElementBase element;
private DescriptionBase description = null;
/**
* @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
*/
public DeleteDescriptionElementOperation(String label, IUndoContext undoContext,
- DescriptionElementBase element, IPostOperationEnabled postOperationEnabled) {
- super(label, undoContext, postOperationEnabled);
-
+ DescriptionElementBase element, IPostOperationEnabled postOperationEnabled,
+ ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
+ super(label, undoContext, postOperationEnabled, cdmEntitySessionEnabled);
+
this.element = element;
}
@Override
public IStatus execute(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
-
+
description = element.getInDescription();
-
+
monitor.worked(20);
-
+
// Remove element from description
if (description == null) {
- StoreUtil.error(this.getClass(), "Couldn't find element's description!", null);
+ MessagingUtils.error(this.getClass(), "Couldn't find element's description!", null);
} else {
description.removeElement(element);
}
throws ExecutionException {
description.addElement(element);
-
+
return postExecute(element);
}
}