Project

General

Profile

Download (2.38 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

    
14
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
15
import eu.etaxonomy.cdm.model.description.CategoricalData;
16
import eu.etaxonomy.cdm.model.description.StateData;
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>StateDataSection class.</p>
23
 *
24
 * @author n.hoffmann
25
 * @created Sep 15, 2010
26
 * @version 1.0
27
 */
28
public class StateDataSection extends AbstractEntityCollectionSection<CategoricalData, StateData> {
29

    
30
	/**
31
	 * <p>Constructor for StateDataSection.</p>
32
	 *
33
	 * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
34
	 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
35
	 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
36
	 * @param style a int.
37
	 */
38
	public StateDataSection(CdmFormFactory formFactory,
39
			ConversationHolder conversation, ICdmFormElement parentElement,
40
			int style) {
41
		super(formFactory, conversation, parentElement, "State Data", style);
42
	}
43

    
44
	/** {@inheritDoc} */
45
	@Override
46
	public Collection<StateData> getCollection(CategoricalData entity) {
47
		return entity.getStateData();
48
	}
49

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

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

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

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

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

    
80
    /**
81
     * {@inheritDoc}
82
     */
83
    @Override
84
    public StateData addExisting() {
85
        return null;
86
    }
87

    
88
    /**
89
     * {@inheritDoc}
90
     */
91
    @Override
92
    public boolean allowAddExisting() {
93
        return false;
94
    }
95

    
96

    
97
}
(23-23/25)