ref #8774: adapt term tree editors to dto usage
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / feature / FeatureStateWizard.java
1 /**
2 * Copyright (C) 2019 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 package eu.etaxonomy.taxeditor.ui.section.feature;
10
11 import org.eclipse.jface.wizard.Wizard;
12
13 import eu.etaxonomy.cdm.model.description.FeatureState;
14 import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
15 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
16
17 /**
18 * @author pplitzner
19 * @since Aug 16, 2019
20 *
21 */
22 public class FeatureStateWizard extends Wizard {
23
24 private static final String CREATE_FEATURE_STATE = "Create Feature State";
25 private FeatureStateWizardPage page;
26 private CdmFormFactory formFactory;
27 private TermNodeDto termNode;
28
29 public FeatureStateWizard(TermNodeDto termNode, CdmFormFactory formFactory) {
30 super();
31 this.formFactory = formFactory;
32 this.termNode = termNode;
33 setWindowTitle(CREATE_FEATURE_STATE);
34 }
35
36 @Override
37 public void addPages() {
38 page = new FeatureStateWizardPage(CREATE_FEATURE_STATE, termNode, formFactory);
39 addPage(page);
40 }
41
42 @Override
43 public boolean performFinish() {
44 return page.isPageComplete();
45 }
46
47 FeatureState getFeatureState(){
48 return page.getFeatureState();
49 }
50
51 }