Project

General

Profile

Download (2.05 KB) Statistics
| Branch: | Tag: | Revision:
1
// $Id$
2
/**
3
* Copyright (C) 2015 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
package eu.etaxonomy.taxeditor.operation;
11

    
12
import org.eclipse.core.commands.ExecutionException;
13
import org.eclipse.core.commands.operations.AbstractOperation;
14
import org.eclipse.core.runtime.IAdaptable;
15
import org.eclipse.core.runtime.IProgressMonitor;
16
import org.eclipse.core.runtime.IStatus;
17

    
18
/**
19
 * @author cmathew
20
 * @date 16 Jun 2015
21
 *
22
 */
23
public abstract class RemotingCdmOperation extends AbstractOperation {
24

    
25
    public RemotingCdmOperation(String label) {
26
        super(label);
27
    }
28

    
29
    /* (non-Javadoc)
30
     * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
31
     */
32
    @Override
33
    public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
34

    
35
       boolean success = doExecute(monitor, info);
36
       postExecute(success);
37
       return onComplete(success);
38
    }
39

    
40
    public abstract boolean doExecute(IProgressMonitor monitor, IAdaptable info);
41

    
42
    public void postExecute(boolean success) {}
43

    
44
    public abstract IStatus onComplete(boolean success);
45

    
46
    /* (non-Javadoc)
47
     * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
48
     */
49
    @Override
50
    public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
51
        // TODO Auto-generated method stub
52
        return null;
53
    }
54

    
55
    /* (non-Javadoc)
56
     * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
57
     */
58
    @Override
59
    public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
60
        // TODO Auto-generated method stub
61
        return null;
62
    }
63

    
64
}
(7-7/8)