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
.actions
.ui
;
12 import java
.util
.List
;
14 import org
.apache
.log4j
.Logger
;
15 import org
.eclipse
.jface
.action
.Action
;
16 import org
.eclipse
.jface
.resource
.ImageDescriptor
;
17 import org
.eclipse
.jface
.wizard
.Wizard
;
18 import org
.eclipse
.jface
.wizard
.WizardDialog
;
20 import eu
.etaxonomy
.cdm
.model
.name
.NameRelationship
;
21 import eu
.etaxonomy
.cdm
.model
.name
.TaxonNameBase
;
22 import eu
.etaxonomy
.taxeditor
.controller
.GlobalController
;
23 import eu
.etaxonomy
.taxeditor
.propertysheet
.namerelations
.wizard
.NameRelationWizard
;
24 import eu
.etaxonomy
.taxeditor
.propertysheet
.namerelations
.wizard
.NameRelationWizardModel
;
31 public class OpenNameRelationWizardAction
extends Action
{
32 private static final Logger logger
= Logger
33 .getLogger(OpenNameRelationWizardAction
.class);
35 private static String text
= "Create name relation ...";
36 // private ImageDescriptor image = TaxEditorPlugin.getDefault()
37 // .getImageDescriptor(ITaxEditorConstants.ACTIVE_DELETE_ICON);
38 private ImageDescriptor image
= null;
39 public static final String ID
= "eu.etaxonomy.taxeditor.actions.opennamerelationswizard"; //$NON-NLS-1$
41 private NameRelationWizardModel relationModel
;
43 private OpenNameRelationWizardAction() {
45 setImageDescriptor(image
);
49 public OpenNameRelationWizardAction(TaxonNameBase name
) {
52 this.relationModel
= new NameRelationWizardModel(name
);
55 public OpenNameRelationWizardAction(TaxonNameBase name
,
56 List
<NameRelationship
> nameRelationsList
) {
59 this.relationModel
.setNameRelationsList(nameRelationsList
);
62 public OpenNameRelationWizardAction(TaxonNameBase name
,
63 NameRelationship relation
) {
66 this.relationModel
.setRelation(relation
);
70 if (relationModel
.getBaseName() == null) {
74 Wizard wizard
= new NameRelationWizard(relationModel
);
76 WizardDialog dialog
= new WizardDialog(GlobalController
.getShell(), wizard
);