2 * Copyright (C) 2015 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
9 package eu
.etaxonomy
.taxeditor
.operation
;
11 import org
.eclipse
.core
.runtime
.IAdaptable
;
12 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
13 import org
.eclipse
.core
.runtime
.IStatus
;
14 import org
.eclipse
.core
.runtime
.Status
;
16 import eu
.etaxonomy
.cdm
.api
.application
.CdmChangeEvent
.Action
;
17 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
24 public abstract class RemotingCdmDefaultOperation
extends RemotingCdmOperation
{
26 private CdmBase cdmEntity
;
28 public RemotingCdmDefaultOperation(String label
, Action action
, Object source
, boolean async
) {
29 super(label
, action
, source
, async
);
32 * @see eu.etaxonomy.taxeditor.operation.RemotingCdmOperation#doExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
35 protected boolean doExecute(IProgressMonitor monitor
, IAdaptable info
) {
37 cdmEntity
= doSimpleExecute(monitor
, info
);
38 } catch (Exception e
) {
39 throw new RuntimeException(e
);
44 protected abstract CdmBase
doSimpleExecute(IProgressMonitor monitor
, IAdaptable info
) throws Exception
;
47 protected void postExecute(boolean success
) {
48 if(success
&& cdmEntity
!= null) {
49 fireDataChangeEvent(cdmEntity
);
54 * @see eu.etaxonomy.taxeditor.operation.RemotingCdmOperation#onComplete(boolean)
57 protected IStatus
onComplete(boolean success
) {
58 return Status
.OK_STATUS
;