refactored folder structure
[taxeditor.git] / taxeditor-store / src / main / java / eu / etaxonomy / taxeditor / operations / AbstractPersistentPostOperation.java
1 // $Id$
2 /**
3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
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.
9 */
10
11 package eu.etaxonomy.taxeditor.operations;
12
13 import org.eclipse.core.commands.operations.IUndoContext;
14 import org.eclipse.core.runtime.IStatus;
15
16 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
17 import eu.etaxonomy.cdm.model.common.CdmBase;
18 import eu.etaxonomy.cdm.model.taxon.Taxon;
19
20 /**
21 * @author n.hoffmann
22 * @created 08.05.2009
23 * @version 1.0
24 */
25 public abstract class AbstractPersistentPostOperation extends AbstractPostOperation {
26 private IConversationEnabled conversationEnabled;
27
28 /**
29 * @param label
30 * @param undoContext
31 * @param taxon
32 * @param postOperationEnabled
33 */
34 public AbstractPersistentPostOperation(String label,
35 IUndoContext undoContext, Taxon taxon,
36 IPostOperationEnabled postOperationEnabled) {
37 super(label, undoContext, taxon, postOperationEnabled);
38 // TODO Auto-generated constructor stub
39 }
40
41 public AbstractPersistentPostOperation(String label,
42 IUndoContext undoContext, Taxon taxon,
43 IPostOperationEnabled postOperationEnabled,
44 IConversationEnabled conversationEnabled) {
45 super(label, undoContext, taxon, postOperationEnabled);
46
47 this.conversationEnabled = conversationEnabled;
48 }
49
50 protected IStatus postExecute(CdmBase objectAffectedByOperation) {
51 IStatus status = super.postExecute(objectAffectedByOperation);
52
53 if(conversationEnabled != null){
54 conversationEnabled.getConversationHolder().commit(true);
55 }
56
57 return status;
58 }
59
60 }