1
|
/**
|
2
|
* Copyright (C) 2015 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
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.
|
8
|
*/
|
9
|
package eu.etaxonomy.taxeditor.navigation.key.polytomous.e4.handler;
|
10
|
|
11
|
import org.eclipse.core.commands.operations.AbstractOperation;
|
12
|
import org.eclipse.core.runtime.IStatus;
|
13
|
import org.eclipse.core.runtime.Status;
|
14
|
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
|
15
|
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
|
16
|
import org.eclipse.jface.viewers.IStructuredSelection;
|
17
|
import org.eclipse.swt.widgets.Shell;
|
18
|
|
19
|
import eu.etaxonomy.taxeditor.navigation.key.polytomous.PolytomousKeyViewLabels;
|
20
|
import eu.etaxonomy.taxeditor.navigation.key.polytomous.operation.UpdatePolytomousKeyAllNodesOperation;
|
21
|
import eu.etaxonomy.taxeditor.operation.e4.CdmHandlerE4;
|
22
|
|
23
|
/**
|
24
|
* @author cmathew
|
25
|
* @date 29 Jun 2015
|
26
|
*
|
27
|
*/
|
28
|
public class UpdatePolytomousKeyAllNodesHandlerE4 extends CdmHandlerE4 {
|
29
|
|
30
|
public UpdatePolytomousKeyAllNodesHandlerE4() {
|
31
|
super(PolytomousKeyViewLabels.UPDATE_ALL_POLYTOMOUS_KEY_NODES_LABEL);
|
32
|
}
|
33
|
|
34
|
@Override
|
35
|
public IStatus allowOperations(IStructuredSelection selection, Shell shell, MPart activePart,
|
36
|
MHandledMenuItem menuItem) {
|
37
|
return Status.OK_STATUS;
|
38
|
}
|
39
|
|
40
|
@Override
|
41
|
public AbstractOperation prepareOperation(IStructuredSelection selection, Shell shell, MPart activePart,
|
42
|
MHandledMenuItem menuItem) {
|
43
|
return new UpdatePolytomousKeyAllNodesOperation(getTrigger(), false);
|
44
|
}
|
45
|
|
46
|
@Override
|
47
|
public void onComplete() {
|
48
|
}
|
49
|
|
50
|
/**
|
51
|
* {@inheritDoc}
|
52
|
*/
|
53
|
@Override
|
54
|
protected Object getTrigger() {
|
55
|
return this;
|
56
|
}
|
57
|
|
58
|
}
|