Project

General

Profile

Download (2.16 KB) Statistics
| Branch: | Tag: | Revision:
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.CategoricalData;
17
import eu.etaxonomy.cdm.model.description.StateData;
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

    
22
/**
23
 * <p>StateDataSection class.</p>
24
 *
25
 * @author n.hoffmann
26
 * @created Sep 15, 2010
27
 * @version 1.0
28
 */
29
public class StateDataSection extends AbstractEntityCollectionSection<CategoricalData, StateData> {
30

    
31
	/**
32
	 * <p>Constructor for StateDataSection.</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 StateDataSection(CdmFormFactory formFactory,
40
			ConversationHolder conversation, ICdmFormElement parentElement,
41
			int style) {
42
		super(formFactory, conversation, parentElement, "State Data", style);
43
	}
44
	
45
	/** {@inheritDoc} */
46
	@Override
47
	public Collection<StateData> getCollection(CategoricalData entity) {
48
		return entity.getStateData();
49
	}
50

    
51
	/** {@inheritDoc} */
52
	@Override
53
	public StateData createNewElement() {
54
		return StateData.NewInstance();
55
	}
56

    
57
	/** {@inheritDoc} */
58
	@Override
59
	public void addElement(StateData element) {
60
		getEntity().addStateData(element);
61
	}
62

    
63
	/** {@inheritDoc} */
64
	@Override
65
	public void removeElement(StateData element) {
66
		getEntity().removeStateData(element);
67
	}
68

    
69
	/** {@inheritDoc} */
70
	@Override
71
	public String getEmptyString() {
72
		return "No state data yet.";
73
	}
74

    
75
	/** {@inheritDoc} */
76
	@Override
77
	protected String getTooltipString() {
78
		return "Create new state data";
79
	}
80

    
81
	
82
}
(23-23/25)