2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.taxeditor
.bulkeditor
;
12 import org
.eclipse
.core
.commands
.operations
.IOperationHistory
;
13 import org
.eclipse
.core
.commands
.operations
.IUndoContext
;
14 import org
.eclipse
.e4
.ui
.model
.application
.MApplication
;
15 import org
.eclipse
.e4
.ui
.model
.application
.ui
.basic
.MPart
;
16 import org
.eclipse
.e4
.ui
.model
.application
.ui
.basic
.MPartStack
;
17 import org
.eclipse
.e4
.ui
.workbench
.modeling
.EModelService
;
18 import org
.eclipse
.e4
.ui
.workbench
.modeling
.EPartService
;
19 import org
.eclipse
.e4
.ui
.workbench
.modeling
.EPartService
.PartState
;
21 import eu
.etaxonomy
.taxeditor
.bulkeditor
.e4
.BulkEditorE4
;
22 import eu
.etaxonomy
.taxeditor
.bulkeditor
.input
.AbstractBulkEditorInput
;
23 import eu
.etaxonomy
.taxeditor
.bulkeditor
.internal
.TaxeditorBulkeditorPlugin
;
24 import eu
.etaxonomy
.taxeditor
.model
.AbstractUtility
;
25 import eu
.etaxonomy
.taxeditor
.workbench
.WorkbenchUtility
;
28 * <p>BulkEditorUtil class.</p>
31 * @created Mar 12, 2010
34 public class BulkEditorUtil
extends AbstractUtility
{
40 * @return a {@link java.lang.String} object.
42 public static String
getPluginId(){
43 return TaxeditorBulkeditorPlugin
.PLUGIN_ID
;
46 public static void openBulkEditor(AbstractBulkEditorInput
<?
> input
,
47 EModelService modelService
, EPartService partService
, MApplication application
){
48 MPart part
= partService
.createPart(AppModelId
.PARTDESCRIPTOR_BULKEDITOR_EDITOR
);
49 MPartStack editorAreaPartStack
= WorkbenchUtility
.getEditorAreaPartStack(application
, modelService
);
50 if(editorAreaPartStack
!=null){
51 editorAreaPartStack
.getChildren().add(part
);
53 part
= partService
.showPart(part
, PartState
.ACTIVATE
);
54 BulkEditorE4 bulkEditor
= (BulkEditorE4
) part
.getObject();
55 bulkEditor
.init(input
);
59 * <p>getUndoContext</p>
61 * @return a {@link org.eclipse.core.commands.operations.IUndoContext} object.
63 public static IUndoContext
getUndoContext(){
64 return IOperationHistory
.GLOBAL_UNDO_CONTEXT
;