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
.editor
.newWizard
;
13 import org
.apache
.log4j
.Logger
;
15 import eu
.etaxonomy
.cdm
.model
.name
.BotanicalName
;
16 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalCode
;
17 import eu
.etaxonomy
.cdm
.model
.name
.NonViralName
;
18 import eu
.etaxonomy
.cdm
.model
.name
.ZoologicalName
;
19 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
20 import eu
.etaxonomy
.taxeditor
.section
.name
.NonViralNameWizardPage
;
21 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
25 * @created Jun 1, 2010
28 public class NewNonViralNameWizard
extends AbstractNewEntityWizard
<NonViralName
> {
29 private static final Logger logger
= Logger
30 .getLogger(NewNonViralNameWizard
.class);
33 public void addPages() {
34 addPage(new NonViralNameWizardPage(formFactory
, getConversationHolder(), entity
));
38 protected NonViralName
createNewEntity() {
39 NomenclaturalCode code
= PreferencesUtil
.getPreferredNomenclaturalCode();
40 if(code
.equals(NomenclaturalCode
.ICBN
)){
41 return BotanicalName
.NewInstance(null);
42 }else if(code
.equals(NomenclaturalCode
.ICZN
)){
43 return ZoologicalName
.NewInstance(null);
49 protected void saveEntity() {
50 CdmStore
.getNameService().saveOrUpdate(entity
);