Project

General

Profile

Download (1.44 KB) Statistics
| Branch: | Tag: | Revision:
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

    
44
	    CdmStore.getService(ITaxonService.class).save(getEntity());
45
	}
46

    
47
	/** {@inheritDoc} */
48
	@Override
49
	public void setEntity(Taxon entity) {
50
		super.setEntity(entity);
51
	}
52

    
53
	@Override
54
	protected String getEntityName() {
55
		return "Taxon";
56
	}
57
}
(19-19/23)