merge-update from trunk
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / 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.ui.section.description;
12
13 import java.util.Collection;
14
15 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
16 import eu.etaxonomy.cdm.model.description.QuantitativeData;
17 import eu.etaxonomy.cdm.model.description.StatisticalMeasurementValue;
18 import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
19 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
20 import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
21
22 /**
23 * <p>StatisticalMeasurementValueSection class.</p>
24 *
25 * @author n.hoffmann
26 * @created Sep 15, 2010
27 * @version 1.0
28 */
29 public class StatisticalMeasurementValueSection extends
30 AbstractEntityCollectionSection<QuantitativeData, StatisticalMeasurementValue> {
31
32 /**
33 * <p>Constructor for StatisticalMeasurementValueSection.</p>
34 *
35 * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
36 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
37 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
38 * @param style a int.
39 */
40 public StatisticalMeasurementValueSection(CdmFormFactory formFactory,
41 ConversationHolder conversation, ICdmFormElement parentElement,
42 int style) {
43 super(formFactory, conversation, parentElement, "Statistical Measurement Value", style);
44 }
45
46 /** {@inheritDoc} */
47 @Override
48 public Collection<StatisticalMeasurementValue> getCollection(
49 QuantitativeData entity) {
50 return entity.getStatisticalValues();
51 }
52
53 /** {@inheritDoc} */
54 @Override
55 public StatisticalMeasurementValue createNewElement() {
56 return StatisticalMeasurementValue.NewInstance();
57 }
58
59 /** {@inheritDoc} */
60 @Override
61 public void addElement(StatisticalMeasurementValue element) {
62 getEntity().addStatisticalValue(element);
63 }
64
65 /** {@inheritDoc} */
66 @Override
67 public void removeElement(StatisticalMeasurementValue element) {
68 getEntity().removeStatisticalValue(element);
69 }
70
71 /** {@inheritDoc} */
72 @Override
73 public String getEmptyString() {
74 return "No statistical values yet.";
75 }
76
77 /** {@inheritDoc} */
78 @Override
79 protected String getTooltipString() {
80 return "Create new statistical value";
81 }
82 }