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
.taxon
;
12 import org
.eclipse
.swt
.events
.SelectionListener
;
14 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
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 * @created Mar 29, 2011
26 public class TaxonDetailElement
extends AbstractEntityCollectionElement
<Taxon
> {
28 private EntitySelectionElement
<Taxon
> selection_taxon
;
34 * @param removeListener
35 * @param backgroundColor
38 public TaxonDetailElement(CdmFormFactory formFactory
,
39 AbstractFormSection section
, Taxon entity
,
40 SelectionListener removeListener
, int style
) {
41 super(formFactory
, section
, entity
, removeListener
, null, style
);
48 * eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#setEntity
52 public void setEntity(Taxon entity
) {
53 selection_taxon
.setEntity(entity
);
59 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#
60 * createControls(eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement, int)
63 public void createControls(ICdmFormElement element
, int style
) {
64 selection_taxon
= formFactory
65 .createSelectionElement(Taxon
.class,
66 getConversationHolder(), element
, "Taxon", null,
67 EntitySelectionElement
.NOTHING
, style
);
74 * eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#handleEvent
78 public void handleEvent(Object eventSource
) {
79 if (eventSource
== selection_taxon
) {
80 setEntity(selection_taxon
.getSelection());