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
.navigation
.key
.polytomous
.handler
;
12 import org
.eclipse
.core
.commands
.AbstractHandler
;
13 import org
.eclipse
.core
.commands
.ExecutionEvent
;
14 import org
.eclipse
.core
.commands
.ExecutionException
;
15 import org
.eclipse
.core
.commands
.IHandler
;
16 import org
.eclipse
.core
.runtime
.Status
;
17 import org
.eclipse
.jface
.viewers
.StructuredSelection
;
18 import org
.eclipse
.jface
.wizard
.WizardDialog
;
19 import org
.eclipse
.ui
.handlers
.HandlerUtil
;
21 import eu
.etaxonomy
.taxeditor
.navigation
.NavigationUtil
;
22 import eu
.etaxonomy
.taxeditor
.navigation
.key
.polytomous
.PolytomousKeyViewPart
;
23 import eu
.etaxonomy
.taxeditor
.newWizard
.NewPolytomousKeyWizard
;
26 * <p>NewTaxonNodeHandler class.</p>
29 * @created Sep 15, 2009
32 public class NewPolytomousKeyHandler
extends AbstractHandler
implements IHandler
{
35 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
38 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
39 NewPolytomousKeyWizard wizard
= new NewPolytomousKeyWizard();
40 wizard
.init(null,null);
41 WizardDialog dialog
= new WizardDialog(HandlerUtil
.getActiveShell(event
), wizard
);
42 int status
= dialog
.open();
43 if(status
== Status
.OK
) {
44 PolytomousKeyViewPart view
= (PolytomousKeyViewPart
) NavigationUtil
.getView(PolytomousKeyViewPart
.ID
, false);
45 //List<PolytomousKey> pklist = CdmStore.getService(IPolytomousKeyService.class).list(PolytomousKey.class, null, null, null, null);
47 view
.setViewerSelection(new StructuredSelection(wizard
.getEntity()),true);
48 view
.openSelectedKeyNodes();