3 * Copyright (C) 2013 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.operation
;
12 import org
.eclipse
.core
.commands
.operations
.AbstractOperation
;
13 import org
.eclipse
.core
.runtime
.IStatus
;
14 import org
.eclipse
.core
.runtime
.Status
;
16 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
23 public abstract class AbstractPostOperation
extends AbstractOperation
{
28 protected IPostOperationEnabled postOperationEnabled
;
33 public AbstractPostOperation(String label
) {
38 * This method will try to call the post operation on a possibly registered
39 * IPostOperationEnabled implementor. Objects that were affected by the operation
40 * may be passed to the registered IPostOperationEnabled implementor.
42 * @param objectAffectedByOperation the affected object. Should be <code>null</code> if not needed
43 * @return a {@link org.eclipse.core.runtime.IStatus} object.
45 protected IStatus
postExecute(CdmBase objectAffectedByOperation
) {
46 if(postOperationEnabled
!= null){
47 return postOperationEnabled
.postOperation(objectAffectedByOperation
) ? Status
.OK_STATUS
: Status
.CANCEL_STATUS
;
49 return Status
.OK_STATUS
;
53 * <p>Getter for the field <code>postOperationEnabled</code>.</p>
55 * @return a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
57 public IPostOperationEnabled
getPostOperationEnabled() {
58 return postOperationEnabled
;