Project

General

Profile

Revision 9499bcaa

ID9499bcaa7739d29301895b99b3a71a3985c608ea
Parent 7e875084
Child db033747

Added by Patrick Plitzner about 3 years ago

ref #6925 Open term editor in editor area

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/e4/handler/OpenDefinedTermEditorHandlerE4.java
11 11
import java.util.UUID;
12 12

  
13 13
import org.eclipse.e4.core.di.annotations.Execute;
14
import org.eclipse.e4.ui.model.application.MApplication;
14 15
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
16
import org.eclipse.e4.ui.model.application.ui.basic.MPartStack;
15 17
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
18
import org.eclipse.e4.ui.workbench.modeling.EModelService;
16 19
import org.eclipse.e4.ui.workbench.modeling.EPartService;
17 20
import org.eclipse.e4.ui.workbench.modeling.EPartService.PartState;
18 21

  
19 22
import eu.etaxonomy.cdm.model.common.TermType;
20 23
import eu.etaxonomy.taxeditor.editor.definedterm.e4.DefinedTermEditorE4;
21 24
import eu.etaxonomy.taxeditor.editor.definedterm.input.TermEditorInput;
25
import eu.etaxonomy.taxeditor.workbench.WorkbenchUtility;
22 26

  
23 27

  
24 28
/**
......
30 34
public class OpenDefinedTermEditorHandlerE4 {
31 35

  
32 36
	@Execute
33
	public void execute(EPartService partService, MHandledMenuItem menuItem) {
37
	public void execute(EPartService partService, MHandledMenuItem menuItem, MApplication application, EModelService modelService) {
34 38

  
35 39
	    String commandId = menuItem.getCommand().getElementId();
36 40
        UUID termTypeUuid = (UUID) menuItem.getTransientData().get(commandId+".termTypeUuid");
37 41

  
38 42
		TermEditorInput termEditorInput = new TermEditorInput(TermType.getByUuid(termTypeUuid));
39 43
		MPart part = partService.createPart("eu.etaxonomy.taxeditor.editor.definedTerm");
44
		MPartStack editorAreaPartStack = WorkbenchUtility.getEditorAreaPartStack(application, modelService);
45
		if(editorAreaPartStack!=null){
46
		    editorAreaPartStack.getChildren().add(part);
47
		}
40 48
		part = partService.showPart(part, PartState.ACTIVATE);
41 49
		DefinedTermEditorE4 termEditor = (DefinedTermEditorE4) part.getObject();
42 50
		termEditor.init(termEditorInput);

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)