Revision 360b73f0
Added by Patrick Plitzner over 6 years ago
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/e4/handler/RefreshPolytomousKeyNodesHandlerE4.java | ||
---|---|---|
11 | 11 |
|
12 | 12 |
import java.util.List; |
13 | 13 |
|
14 |
import org.eclipse.core.commands.AbstractHandler; |
|
15 |
import org.eclipse.core.commands.ExecutionEvent; |
|
16 |
import org.eclipse.core.commands.ExecutionException; |
|
17 |
import org.eclipse.core.commands.IHandler; |
|
14 |
import javax.inject.Named; |
|
15 |
|
|
18 | 16 |
import org.eclipse.core.commands.operations.IUndoContext; |
19 | 17 |
import org.eclipse.core.runtime.IProgressMonitor; |
20 | 18 |
import org.eclipse.core.runtime.IStatus; |
21 | 19 |
import org.eclipse.core.runtime.Status; |
22 | 20 |
import org.eclipse.core.runtime.jobs.Job; |
21 |
import org.eclipse.e4.core.di.annotations.Execute; |
|
22 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
|
23 |
import org.eclipse.e4.ui.services.IServiceConstants; |
|
23 | 24 |
import org.eclipse.swt.widgets.Display; |
24 | 25 |
|
25 | 26 |
import eu.etaxonomy.cdm.model.description.PolytomousKey; |
27 |
import eu.etaxonomy.taxeditor.model.AbstractUtility; |
|
26 | 28 |
import eu.etaxonomy.taxeditor.navigation.NavigationUtil; |
27 |
import eu.etaxonomy.taxeditor.navigation.key.polytomous.PolytomousKeyViewPart;
|
|
29 |
import eu.etaxonomy.taxeditor.navigation.key.polytomous.e4.PolytomousKeyViewPartE4;
|
|
28 | 30 |
import eu.etaxonomy.taxeditor.navigation.key.polytomous.operation.RefreshNodesOperation; |
29 | 31 |
import eu.etaxonomy.taxeditor.navigation.l10n.Messages; |
30 | 32 |
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation; |
... | ... | |
37 | 39 |
* @created Jan 17 2013 |
38 | 40 |
* @version 1.0 |
39 | 41 |
*/ |
40 |
public class RefreshPolytomousKeyNodesHandlerE4 extends AbstractHandler implements IHandler {
|
|
42 |
public class RefreshPolytomousKeyNodesHandlerE4 { |
|
41 | 43 |
|
42 | 44 |
private static final String REFRESHING_POLYTOMOUS_KEY_NODES = Messages.RefreshPolytomousKeyNodesHandler_REFRESHING; |
43 | 45 |
|
44 |
@Override |
|
45 |
public Object execute(ExecutionEvent event) throws ExecutionException { |
|
46 |
final PolytomousKeyViewPart view = (PolytomousKeyViewPart) NavigationUtil.getView(PolytomousKeyViewPart.ID, false); |
|
47 |
final List<PolytomousKey> keys = view.getKeys(); |
|
46 |
@Execute |
|
47 |
public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart) { |
|
48 |
|
|
49 |
PolytomousKeyViewPartE4 view = (PolytomousKeyViewPartE4) activePart.getObject(); |
|
50 |
|
|
51 |
final List<PolytomousKey> keys = view.getKeys(); |
|
48 | 52 |
|
49 | 53 |
final String label = Messages.RefreshPolytomousKeyNodesHandler_REFRESH; |
50 | 54 |
|
... | ... | |
65 | 69 |
@Override |
66 | 70 |
public void run() { |
67 | 71 |
AbstractPostOperation operation = new RefreshNodesOperation(label, undoContext, key, view); |
68 |
NavigationUtil.executeOperation(operation);
|
|
72 |
AbstractUtility.executeOperation(operation);
|
|
69 | 73 |
} |
70 | 74 |
|
71 | 75 |
}); |
... | ... | |
82 | 86 |
job.schedule(); |
83 | 87 |
|
84 | 88 |
} |
85 |
return null; |
|
86 | 89 |
} |
87 | 90 |
} |
88 | 91 |
|
Also available in: Unified diff
ref #6908 Migrate polytomous key list editor handlers