2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
;
12 import org
.eclipse
.swt
.events
.SelectionListener
;
14 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnit
;
15 import eu
.etaxonomy
.taxeditor
.ui
.element
.AbstractFormSection
;
16 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
17 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
18 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionElement
;
19 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
23 * SpecimenCollectionDetailElement class.
27 * @created Oct 14, 2010
30 public class SpecimenCollectionDetailElement
extends
31 AbstractEntityCollectionElement
<DerivedUnit
> {
33 private EntitySelectionElement
<DerivedUnit
> selection_derivedUnit
;
37 * Constructor for SpecimenCollectionDetailElement.
41 * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
44 * a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
47 * a {@link eu.etaxonomy.cdm.model.occurrence.Specimen} object.
48 * @param removeListener
49 * a {@link org.eclipse.swt.events.SelectionListener} object.
53 public SpecimenCollectionDetailElement(CdmFormFactory formFactory
,
54 AbstractFormSection section
, DerivedUnit entity
,
55 SelectionListener removeListener
, int style
) {
56 super(formFactory
, section
, entity
, removeListener
, null, style
);
63 * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#setEntity
68 public void setEntity(DerivedUnit entity
) {
70 selection_derivedUnit
.setEntity(entity
);
77 * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#createControls
78 * (eu.etaxonomy.taxeditor.forms.ICdmFormElement, int)
82 public void createControls(ICdmFormElement element
, int style
) {
83 selection_derivedUnit
= formFactory
84 .createSelectionElement(DerivedUnit
.class,
85 getConversationHolder(), element
, "Derived Unit", null,
86 EntitySelectionElement
.EDITABLE
| EntitySelectionElement
.SELECTABLE
, style
);
93 * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#handleEvent
98 public void handleEvent(Object eventSource
) {
99 if (eventSource
== selection_derivedUnit
) {
100 this.setEntity((DerivedUnit
) selection_derivedUnit
.getSelection());