Merge branch 'release/5.18.0'
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / reference / NomenclaturalReferenceDetailElement.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.ui.section.reference;
11
12 import eu.etaxonomy.cdm.model.name.NomenclaturalSource;
13 import eu.etaxonomy.cdm.model.name.TaxonName;
14 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
15 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
16 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
17
18 /**
19 * <p>
20 * NomenclaturalReferenceDetailElement class.
21 * </p>
22 *
23 * @author n.hoffmann
24 * @created Mar 12, 2010
25 */
26 public class NomenclaturalReferenceDetailElement extends
27 AbstractCdmDetailElement<TaxonName> {
28
29 private OriginalSourceElement sourceElement;
30
31 /**
32 * <p>
33 * Constructor for NomenclaturalReferenceDetailElement.
34 * </p>
35 *
36 * @param cdmFormFactory
37 * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
38 * object.
39 * @param formElement
40 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
41 * object.
42 * @param style
43 * a int.
44 */
45 public NomenclaturalReferenceDetailElement(CdmFormFactory cdmFormFactory,
46 ICdmFormElement formElement, int style) {
47 super(cdmFormFactory, formElement);
48 }
49
50 @Override
51 protected void createControls(ICdmFormElement formElement,
52 TaxonName entity, int style) {
53
54 sourceElement = formFactory.createNomenclaturalSourceElement(formElement, entity, "Reference");
55 if (entity.getNomenclaturalSource() == null){
56 NomenclaturalSource source = NomenclaturalSource.NewNomenclaturalInstance(entity);
57 entity.setNomenclaturalSource(source);
58 sourceElement.setEntity(source);
59 }else{
60 sourceElement.setEntity(entity.getNomenclaturalSource());
61 }
62 sourceElement.setPersistentBackground(formElement.getPersistentBackground());
63
64 }
65
66 @Override
67 public void handleEvent(Object eventSource) {
68
69 }
70
71
72 }