3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
11 package eu
.etaxonomy
.taxeditor
.preference
.wizards
;
13 import org
.apache
.log4j
.Logger
;
14 import org
.eclipse
.jface
.wizard
.Wizard
;
16 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
17 import eu
.etaxonomy
.cdm
.model
.description
.Feature
;
18 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
25 public class FeatureWizard
extends Wizard
{
26 private static final Logger logger
= Logger
.getLogger(FeatureWizard
.class);
28 private Feature feature
= null;
30 private boolean editMode
= false;
35 public FeatureWizard(){}
39 * @param selectedFeature
41 public FeatureWizard(Feature selectedFeature
){
42 this.feature
= selectedFeature
;
47 * @see org.eclipse.jface.wizard.Wizard#addPages()
50 public void addPages() {
53 addPage(new FeatureWizardPage());
57 * @see org.eclipse.jface.wizard.Wizard#performFinish()
60 public boolean performFinish() {
62 ConversationHolder conversation
= CdmStore
.NewTransactionalConversation();
65 CdmStore
.updateFeature(feature
);
67 CdmStore
.saveFeature(feature
);
70 conversation
.commit(true);
81 public void setFeature(String term
, String label
, String labelAbbreviation
) {
82 feature
= Feature
.NewInstance(term
, label
, labelAbbreviation
);
88 public Feature
getFeature() {
93 * @return the editMode
95 public boolean isEditMode() {