3 * Copyright (C) 2013 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.
10 package eu
.etaxonomy
.taxeditor
.ui
.campanula
.basicFields
;
12 import org
.eclipse
.swt
.SWT
;
13 import org
.eclipse
.swt
.events
.SelectionListener
;
15 import eu
.etaxonomy
.cdm
.model
.location
.NamedArea
;
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
;
27 public class NamedAreaFieldController
extends AbstractEntityCollectionElement
<NamedArea
> {
29 private EntitySelectionFieldController
<NamedArea
> selection_namedArea
;
33 * Constructor for CollectingAreasDetailElement.
37 * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
41 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
44 * a {@link eu.etaxonomy.cdm.model.location.NamedArea} object.
45 * @param removeListener
46 * a {@link org.eclipse.swt.events.SelectionListener} object.
50 public NamedAreaFieldController(CdmFormFactory formFactory
, AbstractFormSection section
, NamedArea entity
, SelectionListener removeListener
, int style
) {
51 super(formFactory
, section
, entity
, removeListener
, null, style
);
58 * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#setEntity
63 public void setEntity(NamedArea entity
) {
64 selection_namedArea
.setEntity(entity
);
71 * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#createControls
72 * (eu.etaxonomy.taxeditor.forms.ICdmFormElement, int)
76 public void createControls(ICdmFormElement formElement
, int style
) {
77 selection_namedArea
= new EntitySelectionFieldController
<NamedArea
>(new EntitySelectionField(formElement
.getLayoutComposite(), SWT
.NONE
), getFormFactory(), getConversationHolder(), formElement
, NamedArea
.class, "", null, EntitySelectionElement
.NOTHING
);
84 * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#handleEvent
89 public void handleEvent(Object eventSource
) {
90 if (eventSource
== selection_namedArea
) {
91 setEntity(selection_namedArea
.getSelection());