Merge branch 'develop' into LibrAlign
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / description / StatisticalMeasurementValueSection.java
1 /**
2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9
10 package eu.etaxonomy.taxeditor.ui.section.description;
11
12 import java.util.Collection;
13
14 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
15 import eu.etaxonomy.cdm.model.description.QuantitativeData;
16 import eu.etaxonomy.cdm.model.description.StatisticalMeasurementValue;
17 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
18 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
19 import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
20
21 /**
22 * <p>StatisticalMeasurementValueSection class.</p>
23 *
24 * @author n.hoffmann
25 * @created Sep 15, 2010
26 * @version 1.0
27 */
28 public class StatisticalMeasurementValueSection extends
29 AbstractEntityCollectionSection<QuantitativeData, StatisticalMeasurementValue> {
30
31 /**
32 * <p>Constructor for StatisticalMeasurementValueSection.</p>
33 *
34 * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
35 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
36 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
37 * @param style a int.
38 */
39 public StatisticalMeasurementValueSection(CdmFormFactory formFactory,
40 ConversationHolder conversation, ICdmFormElement parentElement,
41 int style) {
42 super(formFactory, conversation, parentElement, "Statistical Measurement Value", style);
43 }
44
45 /** {@inheritDoc} */
46 @Override
47 public Collection<StatisticalMeasurementValue> getCollection(
48 QuantitativeData entity) {
49 return entity.getStatisticalValues();
50 }
51
52 /** {@inheritDoc} */
53 @Override
54 public StatisticalMeasurementValue createNewElement() {
55 return StatisticalMeasurementValue.NewInstance();
56 }
57
58 /** {@inheritDoc} */
59 @Override
60 public void addElement(StatisticalMeasurementValue element) {
61 getEntity().addStatisticalValue(element);
62 }
63
64 /** {@inheritDoc} */
65 @Override
66 public void removeElement(StatisticalMeasurementValue element) {
67 getEntity().removeStatisticalValue(element);
68 }
69
70 /** {@inheritDoc} */
71 @Override
72 public String getEmptyString() {
73 return "No statistical values yet.";
74 }
75
76 /** {@inheritDoc} */
77 @Override
78 protected String getTooltipString() {
79 return "Create new statistical value";
80 }
81 }