Project

General

Profile

Download (1.55 KB) Statistics
| Branch: | Tag: | Revision:
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
package eu.etaxonomy.taxeditor.bulkeditor.e4.handler;
10
import org.eclipse.core.commands.ParameterizedCommand;
11
import org.eclipse.e4.core.di.annotations.Execute;
12
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
13
import org.eclipse.e4.ui.workbench.modeling.EPartService;
14
import org.eclipse.e4.ui.workbench.modeling.EPartService.PartState;
15

    
16
import eu.etaxonomy.taxeditor.bulkeditor.AppModelId;
17
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorConstants;
18
import eu.etaxonomy.taxeditor.bulkeditor.e4.BulkEditorE4;
19
import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
20
import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputType;
21

    
22
/**
23
 *
24
 * @author pplitzner
25
 * @since Sep 8, 2017
26
 *
27
 */
28
public class OpenBulkEditorHandlerE4 {
29

    
30
	@Execute
31
	public void execute(ParameterizedCommand command, EPartService partService) {
32
	    String inputTypeId = (String) command.getParameterMap().get(IBulkEditorConstants.INPUT_TYPE_PARAMETER_ID);
33
		BulkEditorInputType inputType = BulkEditorInputType.getById(inputTypeId);
34

    
35
		MPart part = partService.createPart(AppModelId.PARTDESCRIPTOR_BULKEDITOR_EDITOR);
36
        part = partService.showPart(part, PartState.ACTIVATE);
37
        BulkEditorE4 bulkEditor = (BulkEditorE4) part.getObject();
38
        bulkEditor.init(AbstractBulkEditorInput.NewInstance(inputType));
39
	}
40
}
(5-5/9)