Project

General

Profile

Download (1.61 KB) Statistics
| Branch: | Tag: | Revision:
1 729887cf n.hoffmann
/**
2
* Copyright (C) 2007 EDIT
3 2e93b829 Cherian Mathew
* European Distributed Institute of Taxonomy
4 729887cf n.hoffmann
* http://www.e-taxonomy.eu
5 2e93b829 Cherian Mathew
*
6 729887cf n.hoffmann
* 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 f211dd28 n.hoffmann
package eu.etaxonomy.taxeditor.newWizard;
11 729887cf n.hoffmann
12 db5e366d n.hoffmann
import eu.etaxonomy.cdm.api.service.IReferenceService;
13 d31115e0 n.hoffmann
import eu.etaxonomy.cdm.model.reference.Reference;
14 729887cf n.hoffmann
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
15
import eu.etaxonomy.taxeditor.store.CdmStore;
16 f211dd28 n.hoffmann
import eu.etaxonomy.taxeditor.ui.section.reference.ReferenceWizardPage;
17 729887cf n.hoffmann
18
/**
19 3be6ef3e n.hoffmann
 * <p>NewReferenceWizard class.</p>
20
 *
21 729887cf n.hoffmann
 * @author n.hoffmann
22
 * @created Jun 1, 2010
23
 * @version 1.0
24
 */
25 d31115e0 n.hoffmann
public class NewReferenceWizard extends AbstractNewEntityWizard<Reference> {
26 2e93b829 Cherian Mathew
27 d31115e0 n.hoffmann
	private ReferenceWizardPage referencePage;
28 2e93b829 Cherian Mathew
29 3be6ef3e n.hoffmann
	/** {@inheritDoc} */
30 729887cf n.hoffmann
	@Override
31
	public void addPages() {
32 30140758 n.hoffmann
		// TODO disabling external service wizard page for now
33
//		addPage(new ExternalReferenceServiceWizardPage(formFactory, getConversationHolder(), entity));
34 f211dd28 n.hoffmann
		referencePage = new ReferenceWizardPage(formFactory, getConversationHolder(), getEntity());
35 d31115e0 n.hoffmann
		addPage(referencePage);
36 729887cf n.hoffmann
	}
37
38 3be6ef3e n.hoffmann
	/** {@inheritDoc} */
39 729887cf n.hoffmann
	@Override
40 d31115e0 n.hoffmann
	protected Reference createNewEntity() {
41 729887cf n.hoffmann
		return ReferenceFactory.newGeneric();
42
	}
43
44 3be6ef3e n.hoffmann
	/** {@inheritDoc} */
45 729887cf n.hoffmann
	@Override
46
	protected void saveEntity() {
47 2e93b829 Cherian Mathew
	    CdmStore.getService(IReferenceService.class).save(getEntity());
48 729887cf n.hoffmann
	}
49 cfcb0ce6 n.hoffmann
50 3be6ef3e n.hoffmann
	/** {@inheritDoc} */
51 cfcb0ce6 n.hoffmann
	@Override
52 d31115e0 n.hoffmann
	public void setEntity(Reference entity) {
53 cfcb0ce6 n.hoffmann
		super.setEntity(entity);
54 d31115e0 n.hoffmann
		referencePage.getDetailElement().setEntity(entity);
55 cfcb0ce6 n.hoffmann
	}
56 38f1558f n.hoffmann
57
	@Override
58
	protected String getEntityName() {
59
		return "Reference";
60
	}
61 729887cf n.hoffmann
}