1
|
/**
|
2
|
* Copyright (C) 2007 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
|
|
10
|
package eu.etaxonomy.taxeditor.editor.name.e4.handler;
|
11
|
|
12
|
import javax.inject.Named;
|
13
|
|
14
|
import org.eclipse.e4.core.di.annotations.Execute;
|
15
|
import org.eclipse.e4.ui.di.UISynchronize;
|
16
|
import org.eclipse.e4.ui.model.application.MApplication;
|
17
|
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
|
18
|
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
|
19
|
import org.eclipse.e4.ui.services.IServiceConstants;
|
20
|
import org.eclipse.e4.ui.workbench.modeling.EModelService;
|
21
|
import org.eclipse.e4.ui.workbench.modeling.EPartService;
|
22
|
import org.eclipse.jface.viewers.IStructuredSelection;
|
23
|
import org.eclipse.swt.widgets.Shell;
|
24
|
|
25
|
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
|
26
|
|
27
|
/**
|
28
|
*
|
29
|
* @author pplitzner
|
30
|
* @since Aug 28, 2017
|
31
|
*
|
32
|
*/
|
33
|
public class SwapSynonymAndAcceptedSetNameInSourceHandlerE5 extends SwapSynonymAndAcceptedHandler implements IPostOperationEnabled {
|
34
|
|
35
|
|
36
|
|
37
|
|
38
|
@Override
|
39
|
@Execute
|
40
|
public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart activePart,
|
41
|
@Named(IServiceConstants.ACTIVE_SELECTION) IStructuredSelection selection,
|
42
|
@Named(IServiceConstants.ACTIVE_SHELL) Shell shell, MHandledMenuItem menuItem, EPartService partService,
|
43
|
EModelService modelService, MApplication application,
|
44
|
UISynchronize sync) {
|
45
|
|
46
|
this.isSetNameInSource = true;
|
47
|
|
48
|
super.execute(activePart, selection, shell, menuItem, partService, modelService, application, sync);
|
49
|
|
50
|
// this.activePart = activePart;
|
51
|
// this.modelService = modelService;
|
52
|
// this.application = application;
|
53
|
// this.partService = partService;
|
54
|
//
|
55
|
// editor = (TaxonEditor) activePart.getObject();
|
56
|
//
|
57
|
// Synonym synonym = (Synonym) selection.getFirstElement();
|
58
|
//
|
59
|
// // Force user to save taxon - not really necessary though, is it?
|
60
|
// if (!EditorUtil.forceUserSaveE4Editor(editor, shell)) {
|
61
|
// return;
|
62
|
// }
|
63
|
//
|
64
|
// SwapSynonymAndAcceptedOperation operation = new SwapSynonymAndAcceptedOperation(menuItem.getLocalizedLabel(),
|
65
|
// editor.getUndoContext(), editor.getTaxon(), synonym, this, editor.getEditorInput(), true);
|
66
|
//
|
67
|
// AbstractUtility.executeOperation(operation, sync);
|
68
|
|
69
|
}
|
70
|
|
71
|
|
72
|
}
|