3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
11 package eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
;
13 import org
.eclipse
.swt
.SWT
;
14 import org
.eclipse
.swt
.events
.SelectionListener
;
16 import eu
.etaxonomy
.cdm
.model
.common
.ReferencedEntityBase
;
17 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.AbstractFormSection
;
19 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
20 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
21 import eu
.etaxonomy
.taxeditor
.ui
.element
.TextWithLabelElement
;
22 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionElement
;
23 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
27 * @created Mar 25, 2010
30 public abstract class AbstractReferencedEntityElement
<T
extends ReferencedEntityBase
>
31 extends AbstractEntityCollectionElement
<T
> {
33 protected EntitySelectionElement
<Reference
> selection_reference
;
34 protected TextWithLabelElement text_referenceDetail
;
36 public AbstractReferencedEntityElement(CdmFormFactory formFactory
,
37 AbstractFormSection section
, T entity
,
38 SelectionListener removeListener
, int style
) {
39 super(formFactory
, section
, entity
, removeListener
, null, style
);
44 public void createControls(ICdmFormElement formElement
, int style
) {
45 selection_reference
= formFactory
46 .createSelectionElement(Reference
.class,
47 getConversationHolder(), formElement
, "Reference",
48 null, EntitySelectionElement
.ALL
, style
);
49 text_referenceDetail
= formFactory
.createTextWithLabelElement(
50 formElement
, "Reference Detail", null, SWT
.NULL
);
54 public void setEntity(T entity
) {
57 selection_reference
.setEntity(entity
.getCitation());
58 text_referenceDetail
.setText(entity
.getCitationMicroReference());