implemented user management, fixes #803. Minor refactorings.
[taxeditor.git] / taxeditor-editor / src / main / java / eu / etaxonomy / taxeditor / propertysheet / type / wizard / TypeDesignationWizard.java
1 /**
2 * Copyright (C) 2009 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
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.
8 */
9
10 package eu.etaxonomy.taxeditor.propertysheet.type.wizard;
11
12 import org.eclipse.core.databinding.observable.list.WritableList;
13 import org.eclipse.jface.wizard.Wizard;
14 import org.eclipse.jface.wizard.WizardPage;
15
16 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
17 import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
18 import eu.etaxonomy.taxeditor.model.NameHelper;
19
20
21 /**
22 * @author p.ciardelli
23 * @created 13.02.2009
24 * @version 1.0
25 */
26 public class TypeDesignationWizard extends Wizard {
27
28
29 private TypeDesignationBase<?> typeDesignation;
30 private TaxonNameBase<?, ?> name;
31 private WritableList typeDesignationsList;
32
33 private WizardPage chooseTypePage;
34
35 /**
36 * @param typeDesignation
37 * @param typeDesignationsList
38 */
39 public TypeDesignationWizard(TypeDesignationBase<?> typeDesignation, TaxonNameBase<?, ?> name, WritableList typeDesignationsList) {
40
41 this.name = name;
42 this.typeDesignation = typeDesignation;
43 this.typeDesignationsList = typeDesignationsList;
44 }
45
46 /* (non-Javadoc)
47 * @see org.eclipse.jface.wizard.Wizard#addPages()
48 */
49 public void addPages() {
50 if (NameHelper.isNameSupraSpecific(name)) {
51 chooseTypePage = new ChooseNameTypeWizardPage(typeDesignation, name, typeDesignationsList);
52 } else {
53 chooseTypePage = new ChooseSpecimenTypeWizardPage(typeDesignation, name, typeDesignationsList);
54 }
55
56 addPage(chooseTypePage);
57 }
58
59 /* (non-Javadoc)
60 * @see org.eclipse.jface.wizard.Wizard#performFinish()
61 */
62 @Override
63 public boolean performFinish() {
64
65 chooseTypePage.setPageComplete(true);
66
67 return true;
68 }
69 }