2 * Copyright (C) 2009 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
9 package eu
.etaxonomy
.taxeditor
.ui
.section
.common
;
11 import eu
.etaxonomy
.cdm
.model
.common
.SingleSourcedEntityBase
;
12 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
13 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
14 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
15 import eu
.etaxonomy
.taxeditor
.ui
.element
.TextWithLabelElement
;
16 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
17 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
23 public class ReferenceEntityDetailElement
extends AbstractCdmDetailElement
<SingleSourcedEntityBase
>{
25 private EntitySelectionElement
<Reference
> selection_reference
;
26 private TextWithLabelElement text_referenceDetail
;
28 public ReferenceEntityDetailElement(CdmFormFactory formFactory
,
29 ICdmFormElement formElement
) {
30 super(formFactory
, formElement
);
34 protected void createControls(ICdmFormElement formElement
,
35 SingleSourcedEntityBase entity
, int style
) {
36 selection_reference
= formFactory
37 .createSelectionElement(Reference
.class,//getConversationHolder(),
38 formElement
, "Reference",
40 EntitySelectionElement
.ALL
, style
);
41 text_referenceDetail
= formFactory
.createTextWithLabelElement(
42 formElement
, "Reference Detail",
43 entity
.getCitationMicroReference(), style
);
47 public void handleEvent(Object eventSource
) {
48 if (eventSource
== selection_reference
) {
49 getEntity().setCitation(selection_reference
.getSelection());
50 } else if (eventSource
== text_referenceDetail
) {
51 getEntity().setCitationMicroReference(
52 text_referenceDetail
.getText());