Project

General

Profile

Download (2.4 KB) Statistics
| Branch: | Tag: | Revision:
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.apache.log4j.Logger;
14
import org.eclipse.core.commands.ExecutionException;
15
import org.eclipse.core.commands.operations.IUndoContext;
16
import org.eclipse.core.runtime.IAdaptable;
17
import org.eclipse.core.runtime.IProgressMonitor;
18
import org.eclipse.core.runtime.IStatus;
19

    
20
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
21
import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
22
import eu.etaxonomy.taxeditor.store.CdmStore;
23

    
24
/**
25
 * @author n.hoffmann
26
 * @created Jul 12, 2010
27
 * @version 1.0
28
 */
29
public class EditTaxonomicTreeOperation extends AbstractPersistentPostOperation {
30
	private static final Logger logger = Logger
31
			.getLogger(EditTaxonomicTreeOperation.class);
32
	private TaxonomicTree classification;
33

    
34
	public EditTaxonomicTreeOperation(String label, IUndoContext undoContext, TaxonomicTree classification,
35
			IPostOperationEnabled postOperationEnabled,
36
			IConversationEnabled conversationEnabled) {
37
		super(label, undoContext, postOperationEnabled, conversationEnabled);
38
		
39
		this.classification = classification;
40
	}
41
	
42
	/* (non-Javadoc)
43
	 * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
44
	 */
45
	@Override
46
	public IStatus execute(IProgressMonitor monitor, IAdaptable info)
47
			throws ExecutionException {
48
		bind();
49
		
50
		CdmStore.getTaxonTreeService().save(classification);
51
		
52
		monitor.worked(40);
53

    
54
		return postExecute(classification);
55
		
56
	}
57

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

    
68
	/* (non-Javadoc)
69
	 * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
70
	 */
71
	@Override
72
	public IStatus undo(IProgressMonitor monitor, IAdaptable info)
73
			throws ExecutionException {
74
		// TODO Auto-generated method stub
75
		return null;
76
	}
77
}
(31-31/40)