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