1 package eu
.etaxonomy
.taxeditor
.navigation
.handler
;
4 * Copyright (C) 2007 EDIT
5 * European Distributed Institute of Taxonomy
6 * http://www.e-taxonomy.eu
8 * The contents of this file are subject to the Mozilla Public License Version 1.1
9 * See LICENSE.TXT at the top of this package for the full license terms.
13 import org
.eclipse
.core
.commands
.AbstractHandler
;
14 import org
.eclipse
.core
.commands
.ExecutionEvent
;
15 import org
.eclipse
.core
.commands
.ExecutionException
;
16 import org
.eclipse
.core
.commands
.IHandler
;
17 import org
.eclipse
.core
.runtime
.IStatus
;
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
.wizard
.NewTaxonNodeWizard
;
25 * <p>NewTaxonNodeHandler class.</p>
28 * @created Sep 15, 2009
31 public class NewTaxonNodeHandler
extends AbstractHandler
implements IHandler
{
34 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
37 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
39 NewTaxonNodeWizard wizard
= new NewTaxonNodeWizard();
40 WizardDialog dialog
= new WizardDialog(HandlerUtil
.getActiveShell(event
), wizard
);
41 int status
= dialog
.open();
43 if(status
== IStatus
.OK
&& wizard
.openInEditor()){
44 if(wizard
.openEmpty()){
45 NavigationUtil
.openEmpty(wizard
.getParent().getUuid());
47 NavigationUtil
.openEditor(wizard
.getTaxonNode());