1
|
/**
|
2
|
* Copyright (C) 2007 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.newWizard;
|
11
|
|
12
|
import eu.etaxonomy.cdm.api.service.ITaxonService;
|
13
|
import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
|
14
|
import eu.etaxonomy.cdm.model.taxon.Taxon;
|
15
|
import eu.etaxonomy.taxeditor.store.CdmStore;
|
16
|
import eu.etaxonomy.taxeditor.ui.section.name.NonViralNameWizardPage;
|
17
|
import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonWizardPage;
|
18
|
|
19
|
/**
|
20
|
*
|
21
|
* @author pplitzner
|
22
|
* @date Jan 18, 2016
|
23
|
*
|
24
|
*/
|
25
|
public class NewTaxonWizard extends AbstractNewEntityWizard<Taxon> {
|
26
|
|
27
|
/** {@inheritDoc} */
|
28
|
@Override
|
29
|
public void addPages() {
|
30
|
addPage(new TaxonWizardPage(formFactory, getConversationHolder(), getEntity()));
|
31
|
addPage(new NonViralNameWizardPage(formFactory, getConversationHolder(), getEntity().getName()));
|
32
|
}
|
33
|
|
34
|
/** {@inheritDoc} */
|
35
|
@Override
|
36
|
protected Taxon createNewEntity() {
|
37
|
return Taxon.NewInstance(TaxonNameFactory.NewNonViralInstance(null), null);
|
38
|
}
|
39
|
|
40
|
/** {@inheritDoc} */
|
41
|
@Override
|
42
|
protected void saveEntity() {
|
43
|
CdmStore.getService(ITaxonService.class).save(getEntity());
|
44
|
}
|
45
|
|
46
|
/** {@inheritDoc} */
|
47
|
@Override
|
48
|
public void setEntity(Taxon entity) {
|
49
|
super.setEntity(entity);
|
50
|
}
|
51
|
|
52
|
@Override
|
53
|
protected String getEntityName() {
|
54
|
return "Taxon";
|
55
|
}
|
56
|
}
|