3 * Copyright (C) 2015 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
.runtime
.IAdaptable
;
13 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
14 import org
.eclipse
.core
.runtime
.IStatus
;
15 import org
.eclipse
.core
.runtime
.Status
;
17 import eu
.etaxonomy
.cdm
.api
.application
.CdmChangeEvent
.Action
;
18 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
25 public abstract class RemotingCdmDefaultOperation
extends RemotingCdmOperation
{
27 private CdmBase cdmEntity
;
29 public RemotingCdmDefaultOperation(String label
, Action action
, Object source
, boolean async
) {
30 super(label
, action
, source
, async
);
33 * @see eu.etaxonomy.taxeditor.operation.RemotingCdmOperation#doExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
36 protected boolean doExecute(IProgressMonitor monitor
, IAdaptable info
) {
38 cdmEntity
= doSimpleExecute(monitor
, info
);
39 } catch (Exception e
) {
40 throw new RuntimeException(e
);
45 protected abstract CdmBase
doSimpleExecute(IProgressMonitor monitor
, IAdaptable info
) throws Exception
;
48 protected void postExecute(boolean success
) {
49 if(success
&& cdmEntity
!= null) {
50 fireDataChangeEvent(cdmEntity
);
55 * @see eu.etaxonomy.taxeditor.operation.RemotingCdmOperation#onComplete(boolean)
58 protected IStatus
onComplete(boolean success
) {
59 return Status
.OK_STATUS
;