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
.occurrence
.dna
;
13 import org
.eclipse
.swt
.events
.SelectionListener
;
14 import org
.eclipse
.swt
.graphics
.Color
;
16 import eu
.etaxonomy
.cdm
.model
.common
.Identifier
;
17 import eu
.etaxonomy
.taxeditor
.ui
.element
.AbstractFormSection
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
19 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
20 import eu
.etaxonomy
.taxeditor
.ui
.element
.TextWithLabelElement
;
21 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionElement
;
30 public class SampleDesignationTextDetailElement
extends
31 AbstractEntityCollectionElement
<Identifier
> {
33 protected TextWithLabelElement text_description
;
39 * @param removeListener
40 * @param backgroundColor
43 public SampleDesignationTextDetailElement(CdmFormFactory formFactory
, AbstractFormSection
<?
> section
,
44 Identifier entity
, SelectionListener removeListener
, Color backgroundColor
, int style
) {
45 super(formFactory
, section
, entity
, removeListener
, backgroundColor
, style
);
52 * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#createControls
53 * (eu.etaxonomy.taxeditor.forms.ICdmFormElement, int)
57 public void createControls(ICdmFormElement element
, int style
) {
58 text_description
= formFactory
.createTextWithLabelElement(element
,
59 "Sample Designation", null, style
);
63 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#handleEvent(java.lang.Object)
66 public void handleEvent(Object eventSource
) {
67 if(eventSource
==text_description
){
68 this.entity
.setIdentifier(text_description
.getText());
73 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#setEntity(java.lang.Object)
76 public void setEntity(Identifier entity
) {
78 text_description
.setText(entity
.getIdentifier());