1
|
/**
|
2
|
* Copyright (C) 2009 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.definedterm.e4.handler;
|
11
|
import java.util.UUID;
|
12
|
|
13
|
import org.eclipse.e4.core.di.annotations.Execute;
|
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.e4.ui.workbench.modeling.EPartService;
|
17
|
import org.eclipse.e4.ui.workbench.modeling.EPartService.PartState;
|
18
|
|
19
|
import eu.etaxonomy.cdm.model.common.TermType;
|
20
|
import eu.etaxonomy.taxeditor.editor.definedterm.e4.DefinedTermEditorE4;
|
21
|
import eu.etaxonomy.taxeditor.editor.definedterm.input.TermEditorInput;
|
22
|
|
23
|
|
24
|
/**
|
25
|
*
|
26
|
* @author pplitzner
|
27
|
* @since Aug 22, 2017
|
28
|
*
|
29
|
*/
|
30
|
public class OpenDefinedTermEditorHandlerE4 {
|
31
|
|
32
|
@Execute
|
33
|
public void execute(EPartService partService, MHandledMenuItem menuItem) {
|
34
|
|
35
|
String commandId = menuItem.getCommand().getElementId();
|
36
|
UUID termTypeUuid = (UUID) menuItem.getTransientData().get(commandId+".termTypeUuid");
|
37
|
|
38
|
TermEditorInput termEditorInput = new TermEditorInput(TermType.getByUuid(termTypeUuid));
|
39
|
MPart mPart = partService.showPart("eu.etaxonomy.taxeditor.editor.definedTerm", PartState.ACTIVATE);
|
40
|
DefinedTermEditorE4 termEditor = (DefinedTermEditorE4) mPart.getObject();
|
41
|
termEditor.init(termEditorInput);
|
42
|
}
|
43
|
|
44
|
}
|