fix #6342: fix exception when using ? in selection dialog
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / newWizard / NewReferenceWizard.java
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.IReferenceService;
13 import eu.etaxonomy.cdm.model.reference.Reference;
14 import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
15 import eu.etaxonomy.taxeditor.store.CdmStore;
16 import eu.etaxonomy.taxeditor.ui.section.reference.ReferenceWizardPage;
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(), getEntity());
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.getService(IReferenceService.class).save(getEntity());
48 }
49
50 /** {@inheritDoc} */
51 @Override
52 public void setEntity(Reference entity) {
53 super.setEntity(entity);
54 referencePage.getDetailElement().setEntity(entity);
55 }
56
57 @Override
58 protected String getEntityName() {
59 return "Reference";
60 }
61 }