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
.navigator
.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
.runtime
.IStatus
;
16 import org
.eclipse
.jface
.wizard
.WizardDialog
;
17 import org
.eclipse
.ui
.handlers
.HandlerUtil
;
19 import eu
.etaxonomy
.taxeditor
.navigation
.NavigationUtil
;
20 import eu
.etaxonomy
.taxeditor
.newWizard
.IWizardPageListener
;
21 import eu
.etaxonomy
.taxeditor
.newWizard
.NewTaxonNodeWizard
;
24 * <p>NewTaxonNodeHandler class.</p>
27 * @created Sep 15, 2009
30 public class NewTaxonNodeHandler
extends AbstractHandler
{
34 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
35 final NewTaxonNodeWizard wizard
= new NewTaxonNodeWizard();
36 wizard
.init(null, null);
37 final WizardDialog dialog
= new WizardDialog(HandlerUtil
.getActiveShell(event
), wizard
);
38 wizard
.addWizardPageListener(new IWizardPageListener() {
42 wizard
.performFinish();
46 int status
= dialog
.open();
48 if(status
== IStatus
.OK
&& wizard
.openInEditor()){
49 if(wizard
.openEmpty()){
50 NavigationUtil
.openEmpty(wizard
.getParentTreeNode().getUuid());
51 }else if(wizard
.getTaxonNode() != null){
52 NavigationUtil
.openEditor(wizard
.getTaxonNode());