Revision 19744d89
Added by Andreas Müller over 2 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/StateDataElement.java | ||
---|---|---|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
9 |
|
|
10 | 9 |
package eu.etaxonomy.taxeditor.ui.section.description; |
11 | 10 |
|
12 | 11 |
import java.util.ArrayList; |
... | ... | |
33 | 32 |
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement; |
34 | 33 |
|
35 | 34 |
/** |
36 |
* <p>StateDataElement class.</p> |
|
37 |
* |
|
38 | 35 |
* @author n.hoffmann |
39 | 36 |
* @created Sep 15, 2010 |
40 |
* @version 1.0 |
|
41 | 37 |
*/ |
42 | 38 |
public class StateDataElement extends AbstractEntityCollectionElement<StateData> { |
43 | 39 |
|
... | ... | |
45 | 41 |
private ModifierSection section_modifiers; |
46 | 42 |
private TextWithLabelElement text_modifyingText; |
47 | 43 |
|
48 |
/** |
|
49 |
* <p>Constructor for StateDataElement.</p> |
|
50 |
* |
|
51 |
* @param formFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object. |
|
52 |
* @param section a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection} object. |
|
53 |
* @param entity a {@link eu.etaxonomy.cdm.model.description.StateData} object. |
|
54 |
* @param removeListener a {@link org.eclipse.swt.events.SelectionListener} object. |
|
55 |
* @param style a int. |
|
56 |
*/ |
|
57 | 44 |
public StateDataElement(CdmFormFactory formFactory, |
58 | 45 |
AbstractFormSection section, StateData entity, |
59 | 46 |
SelectionListener removeListener, int style) { |
60 | 47 |
super(formFactory, section, entity, removeListener, null, style); |
61 | 48 |
} |
62 | 49 |
|
63 |
/** {@inheritDoc} */ |
|
64 | 50 |
@Override |
65 | 51 |
public void setEntity(StateData entity) { |
66 | 52 |
this.entity = entity; |
67 |
List<State> stateTerms = new ArrayList<State>();
|
|
53 |
List<State> stateTerms = new ArrayList<>(); |
|
68 | 54 |
Set<TermVocabulary<State>> stateVocabularies = getEntity().getCategoricalData().getFeature().getSupportedCategoricalEnumerations(); |
69 | 55 |
for (TermVocabulary<State> termVocabulary : stateVocabularies) { |
70 | 56 |
stateTerms.addAll(termVocabulary.getTerms()); |
... | ... | |
83 | 69 |
} |
84 | 70 |
} |
85 | 71 |
|
86 |
/** {@inheritDoc} */ |
|
87 | 72 |
@Override |
88 | 73 |
public void createControls(ICdmFormElement element, int style) { |
89 | 74 |
combo_state = formFactory.createDefinedTermComboElement(TermType.State, element, "State", null, style); |
... | ... | |
98 | 83 |
|
99 | 84 |
} |
100 | 85 |
|
101 |
/** {@inheritDoc} */ |
|
102 | 86 |
@Override |
103 | 87 |
public void handleEvent(Object eventSource) { |
104 | 88 |
if(eventSource == combo_state){ |
... | ... | |
110 | 94 |
} |
111 | 95 |
} |
112 | 96 |
|
113 |
public void setEnabled(boolean enable){ |
|
97 |
@Override |
|
98 |
public void setEnabled(boolean enable){ |
|
114 | 99 |
if (combo_state != null){ |
115 | 100 |
combo_state.setEnabled(enable); |
116 | 101 |
} |
117 | 102 |
if (section_modifiers != null){ |
118 | 103 |
section_modifiers.setEnabled(enable); |
119 | 104 |
} |
120 |
if (text_modifyingText != null){
|
|
105 |
if (text_modifyingText != null){ |
|
121 | 106 |
text_modifyingText.setEnabled(enable); |
122 | 107 |
} |
123 | 108 |
} |
Also available in: Unified diff
cleanup