Project

General

Profile

Download (2.87 KB) Statistics
| Branch: | Tag: | Revision:
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
import java.util.Comparator;
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.element.CdmFormFactory;
19
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
20
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
21
import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
22

    
23
/**
24
 * <p>StatisticalMeasurementValueSection class.</p>
25
 *
26
 * @author n.hoffmann
27
 * @created Sep 15, 2010
28
 * @version 1.0
29
 */
30
public class StatisticalMeasurementValueSection extends
31
		AbstractEntityCollectionSection<QuantitativeData, StatisticalMeasurementValue> {
32

    
33
	/**
34
	 * <p>Constructor for StatisticalMeasurementValueSection.</p>
35
	 *
36
	 * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
37
	 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
38
	 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
39
	 * @param style a int.
40
	 */
41
	public StatisticalMeasurementValueSection(CdmFormFactory formFactory,
42
			ConversationHolder conversation, ICdmFormElement parentElement,
43
			int style) {
44
		super(formFactory, conversation, parentElement, "Statistical Measurement Value", style);
45
	}
46

    
47
	/** {@inheritDoc} */
48
	@Override
49
	public Collection<StatisticalMeasurementValue> getCollection(
50
			QuantitativeData entity) {
51
		return entity.getStatisticalValues();
52
	}
53

    
54
	@Override
55
	public Comparator<StatisticalMeasurementValue> getComparator() {
56
        return new DefaultCdmBaseComparator<>();
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

    
89
    /**
90
     * {@inheritDoc}
91
     */
92
    @Override
93
    public StatisticalMeasurementValue addExisting() {
94
        return null;
95
    }
96

    
97
    /**
98
     * {@inheritDoc}
99
     */
100
    @Override
101
    public boolean allowAddExisting() {
102
        return false;
103
    }
104
}
(25-25/25)