1 package eu
.etaxonomy
.taxeditor
.editor
.handler
;
3 import org
.eclipse
.core
.commands
.AbstractHandler
;
4 import org
.eclipse
.core
.commands
.ExecutionEvent
;
5 import org
.eclipse
.core
.commands
.ExecutionException
;
6 import org
.eclipse
.e4
.ui
.model
.application
.ui
.basic
.MPart
;
7 import org
.eclipse
.e4
.ui
.workbench
.modeling
.EPartService
;
8 import org
.eclipse
.e4
.ui
.workbench
.modeling
.EPartService
.PartState
;
10 import eu
.etaxonomy
.taxeditor
.editor
.AppModelId
;
11 import eu
.etaxonomy
.taxeditor
.editor
.view
.derivate
.DerivateView
;
12 import eu
.etaxonomy
.taxeditor
.editor
.view
.derivate
.DerivateViewEditorInput
;
13 import eu
.etaxonomy
.taxeditor
.store
.internal
.TaxeditorStorePlugin
;
15 public class OpenDerivateViewHandler
extends AbstractHandler
{
18 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
19 EPartService partService
= TaxeditorStorePlugin
.getDefault().getWorkbench().getActiveWorkbenchWindow().getService(EPartService
.class);
20 MPart part
= partService
.createPart(AppModelId
.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_VIEW_DERIVATE_DERIVATEVIEW
);
21 part
= partService
.showPart(part
, PartState
.ACTIVATE
);
22 DerivateView derivateView
= (DerivateView
) part
.getObject();
23 derivateView
.init(new DerivateViewEditorInput());