Project

General

Profile

Download (1.55 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.NonViralName;
14
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
15
import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
16
import eu.etaxonomy.cdm.model.taxon.Taxon;
17
import eu.etaxonomy.taxeditor.store.CdmStore;
18
import eu.etaxonomy.taxeditor.ui.section.name.NonViralNameWizardPage;
19
import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonWizardPage;
20

    
21
/**
22
 *
23
 * @author pplitzner
24
 * @date Jan 18, 2016
25
 *
26
 */
27
public class NewTaxonWizard extends AbstractNewEntityWizard<Taxon> {
28

    
29
	/** {@inheritDoc} */
30
	@Override
31
	public void addPages() {
32
	    addPage(new TaxonWizardPage(formFactory, getConversationHolder(), getEntity()));
33
	    addPage(new NonViralNameWizardPage(formFactory, getConversationHolder(), (NonViralName) getEntity().getName()));
34
	}
35

    
36
	/** {@inheritDoc} */
37
	@Override
38
	protected Taxon createNewEntity() {
39
		return Taxon.NewInstance(TaxonNameFactory.NewNonViralInstance(null), null);
40
	}
41

    
42
	/** {@inheritDoc} */
43
	@Override
44
	protected void saveEntity() {
45
	    CdmStore.getService(ITaxonService.class).save(getEntity());
46
	}
47

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

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