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
.taxon
;
13 import org
.eclipse
.swt
.events
.SelectionListener
;
15 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
16 import eu
.etaxonomy
.taxeditor
.ui
.element
.AbstractFormSection
;
17 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
19 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionElement
;
20 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
24 * @created Mar 29, 2011
27 public class TaxonDetailElement
extends AbstractEntityCollectionElement
<Taxon
> {
29 private EntitySelectionElement
<Taxon
> selection_taxon
;
35 * @param removeListener
36 * @param backgroundColor
39 public TaxonDetailElement(CdmFormFactory formFactory
,
40 AbstractFormSection section
, Taxon entity
,
41 SelectionListener removeListener
, int style
) {
42 super(formFactory
, section
, entity
, removeListener
, null, style
);
49 * eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#setEntity
53 public void setEntity(Taxon entity
) {
54 selection_taxon
.setEntity(entity
);
60 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#
61 * createControls(eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement, int)
64 public void createControls(ICdmFormElement element
, int style
) {
65 selection_taxon
= formFactory
66 .createSelectionElement(Taxon
.class,
67 getConversationHolder(), element
, "Taxon", null,
68 EntitySelectionElement
.NOTHING
, style
);
75 * eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#handleEvent
79 public void handleEvent(Object eventSource
) {
80 if (eventSource
== selection_taxon
) {
81 setEntity(selection_taxon
.getSelection());