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
.name
;
13 import eu
.etaxonomy
.cdm
.model
.name
.NonViralName
;
14 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
15 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmPropertyChangeEvent
;
16 import eu
.etaxonomy
.taxeditor
.ui
.element
.CheckboxElement
;
17 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
18 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
22 * @created Jan 5, 2011
25 public class HybridDetailElement
extends AbstractCdmDetailElement
<NonViralName
> {
27 private CheckboxElement checkbox_monomHybrid
;
28 private CheckboxElement checkbox_binomHybrid
;
29 private CheckboxElement checkbox_trinomHybrid
;
35 public HybridDetailElement(CdmFormFactory formFactory
,
36 ICdmFormElement formElement
) {
37 super(formFactory
, formElement
);
41 * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#createControls(eu.etaxonomy.taxeditor.forms.ICdmFormElement, java.lang.Object, int)
44 protected void createControls(ICdmFormElement formElement
, NonViralName entity
,
46 checkbox_monomHybrid
= formFactory
.createCheckbox(formElement
, "Monom Hybrid", entity
.isMonomHybrid(), style
);
47 checkbox_binomHybrid
= formFactory
.createCheckbox(formElement
, "Binom Hybrid", entity
.isBinomHybrid(), style
);
48 checkbox_trinomHybrid
= formFactory
.createCheckbox(formElement
, "Trinom Hybrid", entity
.isTrinomHybrid(), style
);
52 * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java.lang.Object)
55 public void handleEvent(Object eventSource
) {
56 if(eventSource
== checkbox_monomHybrid
){
57 getEntity().setMonomHybrid(checkbox_monomHybrid
.getSelection());
59 else if(eventSource
== checkbox_binomHybrid
){
60 getEntity().setBinomHybrid(checkbox_binomHybrid
.getSelection());
62 else if(eventSource
== checkbox_trinomHybrid
){
63 getEntity().setTrinomHybrid(checkbox_trinomHybrid
.getSelection());