- added supportsCommonTaxonName checkbox to FeatureDetailElement (#3207)
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / vocabulary / FeatureDetailElement.java
1 // $Id$
2 /**
3 * Copyright (C) 2009 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
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.
9 */
10 package eu.etaxonomy.taxeditor.ui.section.vocabulary;
11
12 import eu.etaxonomy.cdm.model.description.Feature;
13 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
14 import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
15 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
16
17 /**
18 * @author l.morris
19 * @date 20 Dec 2011
20 *
21 */
22 public class FeatureDetailElement extends DefinedTermDetailElement<Feature> {
23
24 private CheckboxElement supportsTextData;
25
26 private CheckboxElement supportsQuantitativeData;
27
28 private CheckboxElement supportsDistribution;
29
30 private CheckboxElement supportsIndividualAssociation;
31
32 private CheckboxElement supportsTaxonInteraction;
33
34 private CheckboxElement supportsCategoricalData;
35
36 private CheckboxElement supportsCommonTaxonName;
37
38 /**
39 * @param formFactory
40 * @param formElement
41 */
42 public FeatureDetailElement(CdmFormFactory formFactory,
43 ICdmFormElement formElement) {
44 super(formFactory, formElement);
45 }
46
47 /* (non-Javadoc)
48 * @see eu.etaxonomy.taxeditor.ui.section.vocabulary.AbstractTermBaseDetailElement#createControls(eu.etaxonomy.taxeditor.ui.element.ICdmFormElement, eu.etaxonomy.cdm.model.common.TermBase, int)
49 */
50 @Override
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);
60 }
61
62 /* (non-Javadoc)
63 * @see eu.etaxonomy.taxeditor.ui.section.vocabulary.DefinedTermDetailElement#handleEvent(java.lang.Object)
64 */
65 @Override
66 public void handleEvent(Object eventSource) {
67 super.handleEvent(eventSource);
68 if(eventSource == supportsTextData){
69 getEntity().setSupportsTextData(supportsTextData.getSelection());
70 }
71 else if(eventSource == supportsQuantitativeData){
72 getEntity().setSupportsQuantitativeData(supportsQuantitativeData.getSelection());
73 }
74 else if(eventSource == supportsDistribution){
75 getEntity().setSupportsDistribution(supportsDistribution.getSelection());
76 }
77 else if(eventSource == supportsIndividualAssociation){
78 getEntity().setSupportsIndividualAssociation(supportsIndividualAssociation.getSelection());
79 }
80 else if(eventSource == supportsTaxonInteraction){
81 getEntity().setSupportsTaxonInteraction(supportsTaxonInteraction.getSelection());
82 }
83 else if(eventSource == supportsCategoricalData){
84 getEntity().setSupportsCategoricalData(supportsCategoricalData.getSelection());
85 }
86 else if(eventSource == supportsCommonTaxonName){
87 getEntity().setSupportsCommonTaxonName(supportsCommonTaxonName.getSelection());
88 }
89 }
90
91 }