Project

General

Profile

Download (1.48 KB) Statistics
| Branch: | Tag: | Revision:
1
// $Id$
2
/**
3
* Copyright (C) 2007 EDIT
4
* European Distributed Institute of Taxonomy 
5
* http://www.e-taxonomy.eu
6
* 
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.
9
*/
10

    
11
package eu.etaxonomy.taxeditor.editor.newWizard;
12

    
13
import eu.etaxonomy.cdm.model.reference.Reference;
14
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
15
import eu.etaxonomy.taxeditor.section.reference.ReferenceWizardPage;
16
import eu.etaxonomy.taxeditor.store.CdmStore;
17

    
18
/**
19
 * <p>NewReferenceWizard class.</p>
20
 *
21
 * @author n.hoffmann
22
 * @created Jun 1, 2010
23
 * @version 1.0
24
 */
25
public class NewReferenceWizard extends AbstractNewEntityWizard<Reference> {
26
	
27
	private ReferenceWizardPage referencePage;
28
	
29
	/** {@inheritDoc} */
30
	@Override
31
	public void addPages() {
32
		// TODO disabling external service wizard page for now
33
//		addPage(new ExternalReferenceServiceWizardPage(formFactory, getConversationHolder(), entity));
34
		referencePage = new ReferenceWizardPage(formFactory, getConversationHolder(), entity);
35
		addPage(referencePage);
36
	}
37

    
38
	/** {@inheritDoc} */
39
	@Override
40
	protected Reference createNewEntity() {
41
		return ReferenceFactory.newGeneric();
42
	}
43

    
44
	/** {@inheritDoc} */
45
	@Override
46
	protected void saveEntity() {
47
		CdmStore.getReferenceService().saveOrUpdate(entity);
48
	}
49

    
50
	/** {@inheritDoc} */
51
	@Override
52
	public void setEntity(Reference entity) {
53
		super.setEntity(entity);
54
		referencePage.getDetailElement().setEntity(entity);
55
	}
56
}
(8-8/9)