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
.DerivedUnit
;
16 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.compatibility
.ICdmFormElement
;
17 import eu
.etaxonomy
.taxeditor
.ui
.element
.AbstractFormSection
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
19 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionElement
;
20 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
24 * SpecimenCollectionDetailElement class.
28 * @created Oct 14, 2010
31 public class SpecimenCollectionDetailElement
extends
32 AbstractEntityCollectionElement
<DerivedUnit
> {
34 private EntitySelectionElement
<DerivedUnit
> selection_derivedUnit
;
38 * Constructor for SpecimenCollectionDetailElement.
42 * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
45 * a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
48 * a {@link eu.etaxonomy.cdm.model.occurrence.Specimen} object.
49 * @param removeListener
50 * a {@link org.eclipse.swt.events.SelectionListener} object.
54 public SpecimenCollectionDetailElement(CdmFormFactory formFactory
,
55 AbstractFormSection section
, DerivedUnit entity
,
56 SelectionListener removeListener
, int style
) {
57 super(formFactory
, section
, entity
, removeListener
, null, style
);
64 * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#setEntity
69 public void setEntity(DerivedUnit entity
) {
71 selection_derivedUnit
.setEntity(entity
);
78 * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#createControls
79 * (eu.etaxonomy.taxeditor.forms.ICdmFormElement, int)
83 public void createControls(ICdmFormElement element
, int style
) {
84 selection_derivedUnit
= formFactory
85 .createSelectionElement(DerivedUnit
.class,
86 getConversationHolder(), element
, "Derived Unit", null,
87 EntitySelectionElement
.EDITABLE
| EntitySelectionElement
.SELECTABLE
, style
);
94 * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#handleEvent
99 public void handleEvent(Object eventSource
) {
100 if (eventSource
== selection_derivedUnit
) {
101 this.setEntity((DerivedUnit
) selection_derivedUnit
.getSelection());