had to rename the packages to make them compliant with buckminster
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / description / StateDataSection.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 org.apache.log4j.Logger;
16
17 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
18 import eu.etaxonomy.cdm.model.description.CategoricalData;
19 import eu.etaxonomy.cdm.model.description.StateData;
20 import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory;
21 import eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement;
22 import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
23
24 /**
25 * <p>StateDataSection class.</p>
26 *
27 * @author n.hoffmann
28 * @created Sep 15, 2010
29 * @version 1.0
30 */
31 public class StateDataSection extends AbstractEntityCollectionSection<CategoricalData, StateData> {
32
33
34 private static final Logger logger = Logger
35 .getLogger(StateDataSection.class);
36
37 /**
38 * <p>Constructor for StateDataSection.</p>
39 *
40 * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory} object.
41 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
42 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement} object.
43 * @param style a int.
44 */
45 public StateDataSection(CdmFormFactory formFactory,
46 ConversationHolder conversation, ICdmFormElement parentElement,
47 int style) {
48 super(formFactory, conversation, parentElement, "State Data", style);
49 }
50
51 /** {@inheritDoc} */
52 @Override
53 public Collection<StateData> getCollection(CategoricalData entity) {
54 return entity.getStates();
55 }
56
57 /** {@inheritDoc} */
58 @Override
59 public StateData createNewElement() {
60 return StateData.NewInstance();
61 }
62
63 /** {@inheritDoc} */
64 @Override
65 public void addElement(StateData element) {
66 getEntity().addState(element);
67 }
68
69 /** {@inheritDoc} */
70 @Override
71 public void removeElement(StateData element) {
72 getEntity().removeState(element);
73 }
74
75 /** {@inheritDoc} */
76 @Override
77 public String getEmptyString() {
78 return "No state data yet.";
79 }
80
81 /** {@inheritDoc} */
82 @Override
83 protected String getTooltipString() {
84 return "Create new state data";
85 }
86
87
88 }