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
.ui
.forms
.widgets
.ExpandableComposite
;
15 import eu
.etaxonomy
.cdm
.model
.molecular
.DnaSample
;
16 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
17 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.LayoutConstants
;
19 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
27 public class SampleDesignationDetailElement
extends AbstractCdmDetailElement
<DnaSample
> {
29 private CurrentSampleDesignationDetailSection sectionCurrentSampleDesignation
;
31 private SampleDesignationHistoryDetailSection sectionSampleDesignationHistory
;
37 public SampleDesignationDetailElement(CdmFormFactory formFactory
,
38 ICdmFormElement formElement
) {
39 super(formFactory
, formElement
);
43 * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#createControls(eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement, java.lang.Object, int)
46 protected void createControls(ICdmFormElement formElement
,
47 DnaSample entity
, int style
) {
49 sectionCurrentSampleDesignation
= formFactory
.createCurrentSampleDesignationDetailSection(getConversationHolder(), formElement
, ExpandableComposite
.EXPANDED
);
50 sectionCurrentSampleDesignation
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY(2, 1));
51 sectionCurrentSampleDesignation
.setEntity(entity
);
53 sectionSampleDesignationHistory
= formFactory
.createSampleDesignationHistoryDetailSection(getConversationHolder(), formElement
, ExpandableComposite
.TWISTIE
);
54 sectionSampleDesignationHistory
.setLayoutData(LayoutConstants
.FILL_HORIZONTALLY(2, 1));
55 sectionSampleDesignationHistory
.setEntity(entity
);
60 * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#handleEvent(java.lang.Object)
63 public void handleEvent(Object eventSource
) {
64 if(eventSource
== sectionCurrentSampleDesignation
){
65 sectionSampleDesignationHistory
.refresh();