performed javacscript:fix and worked on documentation
[taxeditor.git] / taxeditor-editor / src / main / java / eu / etaxonomy / taxeditor / section / description / StatisticalMeasurementValueSection.java
1 // $Id$
2 /**
3 * Copyright (C) 2007 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
11 package eu.etaxonomy.taxeditor.section.description;
12
13 import java.util.Collection;
14
15 import org.apache.log4j.Logger;
16
17 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
18 import eu.etaxonomy.cdm.model.description.QuantitativeData;
19 import eu.etaxonomy.cdm.model.description.StatisticalMeasurementValue;
20 import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
21 import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
22 import eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection;
23
24 /**
25 * <p>StatisticalMeasurementValueSection class.</p>
26 *
27 * @author n.hoffmann
28 * @created Sep 15, 2010
29 * @version 1.0
30 */
31 public class StatisticalMeasurementValueSection extends
32 AbstractEntityCollectionSection<QuantitativeData, StatisticalMeasurementValue> {
33
34
35 private static final Logger logger = Logger
36 .getLogger(StatisticalMeasurementValueSection.class);
37
38 /**
39 * <p>Constructor for StatisticalMeasurementValueSection.</p>
40 *
41 * @param formFactory a {@link eu.etaxonomy.taxeditor.forms.CdmFormFactory} object.
42 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
43 * @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object.
44 * @param style a int.
45 */
46 public StatisticalMeasurementValueSection(CdmFormFactory formFactory,
47 ConversationHolder conversation, ICdmFormElement parentElement,
48 int style) {
49 super(formFactory, conversation, parentElement, "Statistical Measurement Value", style);
50 }
51
52 /** {@inheritDoc} */
53 @Override
54 public Collection<StatisticalMeasurementValue> getCollection(
55 QuantitativeData entity) {
56 return entity.getStatisticalValues();
57 }
58
59 /** {@inheritDoc} */
60 @Override
61 public StatisticalMeasurementValue createNewElement() {
62 return StatisticalMeasurementValue.NewInstance();
63 }
64
65 /** {@inheritDoc} */
66 @Override
67 public void addElement(StatisticalMeasurementValue element) {
68 getEntity().addStatisticalValue(element);
69 }
70
71 /** {@inheritDoc} */
72 @Override
73 public void removeElement(StatisticalMeasurementValue element) {
74 getEntity().removeStatisticalValue(element);
75 }
76
77 /** {@inheritDoc} */
78 @Override
79 public String getEmptyString() {
80 return "No statistical values yet.";
81 }
82
83 /** {@inheritDoc} */
84 @Override
85 protected String getTooltipString() {
86 return "Create new statistical value";
87 }
88 }