3 * Copyright (C) 2009 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
.section
.vocabulary
;
12 import eu
.etaxonomy
.cdm
.model
.description
.Feature
;
13 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.compatibility
.ICdmFormElement
;
14 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
15 import eu
.etaxonomy
.taxeditor
.ui
.element
.CheckboxElement
;
22 public class FeatureDetailElement
extends DefinedTermDetailElement
<Feature
> {
24 private CheckboxElement supportsTextData
;
26 private CheckboxElement supportsQuantitativeData
;
28 private CheckboxElement supportsDistribution
;
30 private CheckboxElement supportsIndividualAssociation
;
32 private CheckboxElement supportsTaxonInteraction
;
34 private CheckboxElement supportsCategoricalData
;
36 private CheckboxElement supportsCommonTaxonName
;
42 public FeatureDetailElement(CdmFormFactory formFactory
,
43 ICdmFormElement formElement
) {
44 super(formFactory
, formElement
);
48 * @see eu.etaxonomy.taxeditor.ui.section.vocabulary.AbstractTermBaseDetailElement#createControls(eu.etaxonomy.taxeditor.ui.element.ICdmFormElement, eu.etaxonomy.cdm.model.common.TermBase, int)
51 protected void createControls(ICdmFormElement formElement
, Feature entity
, int style
) {
52 super.createControls(formElement
, entity
, style
);
53 supportsTextData
= formFactory
.createCheckbox(formElement
, "Supports Text Data", entity
.isSupportsTextData(), style
);
54 supportsQuantitativeData
= formFactory
.createCheckbox(formElement
, "Supports Quantitive Data", entity
.isSupportsQuantitativeData(), style
);
55 supportsDistribution
= formFactory
.createCheckbox(formElement
, "Supports Distribution", entity
.isSupportsDistribution(), style
);
56 supportsIndividualAssociation
= formFactory
.createCheckbox(formElement
, "Supports Individual Association", entity
.isSupportsIndividualAssociation(), style
);
57 supportsTaxonInteraction
= formFactory
.createCheckbox(formElement
, "Supports Taxon Interaction", entity
.isSupportsTaxonInteraction(), style
);
58 supportsCategoricalData
= formFactory
.createCheckbox(formElement
, "Supports Categorical Data", entity
.isSupportsCategoricalData(), style
);
59 supportsCommonTaxonName
= formFactory
.createCheckbox(formElement
, "Supports Common Taxon Name", entity
.isSupportsCommonTaxonName(), style
);
63 * @see eu.etaxonomy.taxeditor.ui.section.vocabulary.DefinedTermDetailElement#handleEvent(java.lang.Object)
66 public void handleEvent(Object eventSource
) {
67 super.handleEvent(eventSource
);
68 if(eventSource
== supportsTextData
){
69 getEntity().setSupportsTextData(supportsTextData
.getSelection());
71 else if(eventSource
== supportsQuantitativeData
){
72 getEntity().setSupportsQuantitativeData(supportsQuantitativeData
.getSelection());
74 else if(eventSource
== supportsDistribution
){
75 getEntity().setSupportsDistribution(supportsDistribution
.getSelection());
77 else if(eventSource
== supportsIndividualAssociation
){
78 getEntity().setSupportsIndividualAssociation(supportsIndividualAssociation
.getSelection());
80 else if(eventSource
== supportsTaxonInteraction
){
81 getEntity().setSupportsTaxonInteraction(supportsTaxonInteraction
.getSelection());
83 else if(eventSource
== supportsCategoricalData
){
84 getEntity().setSupportsCategoricalData(supportsCategoricalData
.getSelection());
86 else if(eventSource
== supportsCommonTaxonName
){
87 getEntity().setSupportsCommonTaxonName(supportsCommonTaxonName
.getSelection());