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
.location
.NamedArea
;
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
.section
.AbstractEntityCollectionElement
;
20 import eu
.etaxonomy
.taxeditor
.ui
.selection
.NamedAreaSelectionElement
;
23 * <p>CollectingAreasDetailElement class.</p>
26 * @created Oct 14, 2010
29 public class NamedAreaDetailElement
extends
30 AbstractEntityCollectionElement
<NamedArea
> {
32 private NamedAreaSelectionElement selection_namedArea
;
35 * <p>Constructor for CollectingAreasDetailElement.</p>
37 * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory} object.
38 * @param section a {@link eu.etaxonomy.taxeditor.ui.forms.AbstractFormSection} object.
39 * @param entity a {@link eu.etaxonomy.cdm.model.location.NamedArea} object.
40 * @param removeListener a {@link org.eclipse.swt.events.SelectionListener} object.
43 public NamedAreaDetailElement(CdmFormFactory formFactory
,
44 AbstractFormSection section
, NamedArea entity
,
45 SelectionListener removeListener
, int style
) {
46 super(formFactory
, section
, entity
, removeListener
, null, style
);
50 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#setEntity(java.lang.Object)
54 public void setEntity(NamedArea entity
) {
55 selection_namedArea
.setEntity(entity
);
59 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#createControls(eu.etaxonomy.taxeditor.forms.ICdmFormElement, int)
63 public void createControls(ICdmFormElement element
, int style
) {
64 selection_namedArea
= formFactory
.createNamedAreaSelectionElement(element
, getConversationHolder(), "Area", null, style
);
68 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#handleEvent(java.lang.Object)
72 public void handleEvent(Object eventSource
) {
73 if(eventSource
== selection_namedArea
){
74 setEntity(selection_namedArea
.getSelection());