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
;
13 import org
.eclipse
.swt
.events
.SelectionListener
;
15 import eu
.etaxonomy
.cdm
.model
.occurrence
.Specimen
;
16 import eu
.etaxonomy
.taxeditor
.ui
.forms
.AbstractFormSection
;
17 import eu
.etaxonomy
.taxeditor
.ui
.forms
.CdmFormFactory
;
18 import eu
.etaxonomy
.taxeditor
.ui
.forms
.ICdmFormElement
;
19 import eu
.etaxonomy
.taxeditor
.ui
.forms
.CdmFormFactory
.SelectionType
;
20 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionElement
;
21 import eu
.etaxonomy
.taxeditor
.ui
.selection
.DerivedUnitBaseSelectionElement
;
24 * <p>SpecimenCollectionDetailElement class.</p>
27 * @created Oct 14, 2010
30 public class SpecimenCollectionDetailElement
extends
31 AbstractEntityCollectionElement
<Specimen
> {
33 private DerivedUnitBaseSelectionElement selection_derivedUnit
;
36 * <p>Constructor for SpecimenCollectionDetailElement.</p>
38 * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory} object.
39 * @param section a {@link eu.etaxonomy.taxeditor.ui.forms.AbstractFormSection} object.
40 * @param entity a {@link eu.etaxonomy.cdm.model.occurrence.Specimen} object.
41 * @param removeListener a {@link org.eclipse.swt.events.SelectionListener} object.
44 public SpecimenCollectionDetailElement(CdmFormFactory formFactory
,
45 AbstractFormSection section
, Specimen entity
,
46 SelectionListener removeListener
, int style
) {
47 super(formFactory
, section
, entity
, removeListener
, null, style
);
51 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#setEntity(java.lang.Object)
55 public void setEntity(Specimen entity
) {
57 selection_derivedUnit
.setEntity(entity
);
61 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#createControls(eu.etaxonomy.taxeditor.forms.ICdmFormElement, int)
65 public void createControls(ICdmFormElement element
, int style
) {
66 selection_derivedUnit
= (DerivedUnitBaseSelectionElement
) formFactory
.createSelectionElement(SelectionType
.DERIVED_UNIT
, getConversationHolder(), element
, "Derived Unit", null, style
);
70 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#handleEvent(java.lang.Object)
74 public void handleEvent(Object eventSource
) {
75 if(eventSource
== selection_derivedUnit
){
76 this.setEntity((Specimen
) selection_derivedUnit
.getSelection());