1
|
package eu.etaxonomy.taxeditor.editor.key.polytomous.operation;
|
2
|
|
3
|
import org.eclipse.core.commands.ExecutionException;
|
4
|
import org.eclipse.core.commands.operations.IUndoContext;
|
5
|
import org.eclipse.core.runtime.IAdaptable;
|
6
|
import org.eclipse.core.runtime.IProgressMonitor;
|
7
|
import org.eclipse.core.runtime.IStatus;
|
8
|
|
9
|
import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
|
10
|
import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
|
11
|
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
|
12
|
|
13
|
/**
|
14
|
* Operation responsible for refreshing node numbers of the Polytomous Key Nodes.
|
15
|
* The refresh is performed on the entire Key starting from the root.
|
16
|
*
|
17
|
* @author c.mathew
|
18
|
*
|
19
|
*/
|
20
|
public class RefreshNodeNumberingOperation extends AbstractPostTaxonOperation {
|
21
|
|
22
|
PolytomousKeyNode node;
|
23
|
private PolytomousKeyNode childNode;
|
24
|
|
25
|
public RefreshNodeNumberingOperation(String label,
|
26
|
IUndoContext undoContext,
|
27
|
PolytomousKeyNode node,
|
28
|
IPostOperationEnabled postOperationEnabled) {
|
29
|
super(label, undoContext, postOperationEnabled);
|
30
|
this.node = node;
|
31
|
}
|
32
|
|
33
|
/* (non-Javadoc)
|
34
|
* @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
|
35
|
*/
|
36
|
@Override
|
37
|
public IStatus execute(IProgressMonitor monitor, IAdaptable info)
|
38
|
throws ExecutionException {
|
39
|
|
40
|
node.refreshNodeNumbering();
|
41
|
return postExecute(node);
|
42
|
}
|
43
|
|
44
|
/* (non-Javadoc)
|
45
|
* @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
|
46
|
*/
|
47
|
@Override
|
48
|
public IStatus redo(IProgressMonitor monitor, IAdaptable info)
|
49
|
throws ExecutionException {
|
50
|
// TODO Auto-generated method stub
|
51
|
return null;
|
52
|
}
|
53
|
|
54
|
/* (non-Javadoc)
|
55
|
* @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
|
56
|
*/
|
57
|
@Override
|
58
|
public IStatus undo(IProgressMonitor monitor, IAdaptable info)
|
59
|
throws ExecutionException {
|
60
|
// TODO Auto-generated method stub
|
61
|
return null;
|
62
|
}
|
63
|
|
64
|
}
|