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
.cdm
.model
.molecular
.DnaSample
;
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
;
31 public class SampleDesignationTextDetailElement
extends
32 AbstractEntityCollectionElement
<Identifier
<DnaSample
>> {
34 protected TextWithLabelElement text_description
;
40 * @param removeListener
41 * @param backgroundColor
44 public SampleDesignationTextDetailElement(CdmFormFactory formFactory
, AbstractFormSection
<?
> section
,
45 Identifier
<DnaSample
> entity
, SelectionListener removeListener
, Color backgroundColor
, int style
) {
46 super(formFactory
, section
, entity
, removeListener
, backgroundColor
, style
);
53 * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#createControls
54 * (eu.etaxonomy.taxeditor.forms.ICdmFormElement, int)
58 public void createControls(ICdmFormElement element
, int style
) {
59 text_description
= formFactory
.createTextWithLabelElement(element
,
60 "Sample Designation", null, style
);
64 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#handleEvent(java.lang.Object)
67 public void handleEvent(Object eventSource
) {
68 if(eventSource
==text_description
){
69 this.entity
.setIdentifier(text_description
.getText());
74 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#setEntity(java.lang.Object)
77 public void setEntity(Identifier
<DnaSample
> entity
) {
79 text_description
.setText(entity
.getIdentifier());