Revision 3be6ef3e
Added by Niels Hoffmann over 13 years ago
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/AbstractCdmDetailElement.java | ||
---|---|---|
30 | 30 |
import eu.etaxonomy.taxeditor.forms.ISelectable; |
31 | 31 |
|
32 | 32 |
/** |
33 |
* <p>Abstract AbstractCdmDetailElement class.</p> |
|
34 |
* |
|
33 | 35 |
* @author n.hoffmann |
34 | 36 |
* @created Feb 26, 2010 |
35 | 37 |
* @version 1.0 |
... | ... | |
43 | 45 |
|
44 | 46 |
private boolean irrelevant; |
45 | 47 |
|
48 |
/** |
|
49 |
* <p>Constructor for AbstractCdmDetailElement.</p> |
|
50 |
* |
|
51 |
* @param formFactory a {@link eu.etaxonomy.taxeditor.forms.CdmFormFactory} object. |
|
52 |
* @param formElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object. |
|
53 |
* @param <T> a T object. |
|
54 |
*/ |
|
46 | 55 |
public AbstractCdmDetailElement(CdmFormFactory formFactory, |
47 | 56 |
ICdmFormElement formElement) { |
48 | 57 |
super(formFactory, (ICdmFormElement) formElement); |
... | ... | |
52 | 61 |
|
53 | 62 |
/** |
54 | 63 |
* Sets the entity and updates controls |
55 |
*
|
|
56 |
* @param entity |
|
64 |
* |
|
65 |
* @param entity a T object.
|
|
57 | 66 |
*/ |
58 | 67 |
public void setEntity(T entity){ |
59 | 68 |
this.entity = entity; |
... | ... | |
64 | 73 |
* (non-Javadoc) |
65 | 74 |
* @see eu.etaxonomy.taxeditor.forms.IEntityElement#getEntity() |
66 | 75 |
*/ |
76 |
/** |
|
77 |
* <p>Getter for the field <code>entity</code>.</p> |
|
78 |
* |
|
79 |
* @return a T object. |
|
80 |
*/ |
|
67 | 81 |
public T getEntity() { |
68 | 82 |
return entity; |
69 | 83 |
} |
... | ... | |
81 | 95 |
* (non-Javadoc) |
82 | 96 |
* @see eu.etaxonomy.taxeditor.forms.ISelectableComposite#setSelected(boolean) |
83 | 97 |
*/ |
98 |
/** {@inheritDoc} */ |
|
84 | 99 |
public void setSelected(boolean selected) { |
85 | 100 |
Composite section = getLayoutComposite().getParent(); |
86 | 101 |
section.setBackground(getColor(selected)); |
... | ... | |
88 | 103 |
|
89 | 104 |
/** |
90 | 105 |
* Sets all field to the given enablement state except the objects in collection except |
91 |
*
|
|
106 |
* |
|
92 | 107 |
* @see eu.etaxonomy.taxeditor.forms.IEnableableFormElement#setEnabled(boolean) |
108 |
* @param enabled a boolean. |
|
109 |
* @param except a {@link java.util.Collection} object. |
|
93 | 110 |
*/ |
94 | 111 |
public void setEnabled(boolean enabled, Collection<Object> except) { |
95 | 112 |
for(ICdmFormElement element : getElements()){ |
... | ... | |
105 | 122 |
} |
106 | 123 |
|
107 | 124 |
/** |
108 |
* |
|
109 |
* @param irrelevant |
|
110 |
* @param except |
|
125 |
* <p>Setter for the field <code>irrelevant</code>.</p> |
|
126 |
* |
|
127 |
* @param irrelevant a boolean. |
|
128 |
* @param except a {@link java.util.Collection} object. |
|
111 | 129 |
*/ |
112 | 130 |
public void setIrrelevant(boolean irrelevant, Collection<Object> except){ |
113 | 131 |
//logger.warn("Setting " + this.getClass().getSimpleName() + " to irrelevant state: " + irrelevant); |
... | ... | |
124 | 142 |
} |
125 | 143 |
} |
126 | 144 |
|
145 |
/** {@inheritDoc} */ |
|
127 | 146 |
public void setEnabled(boolean enabled) { |
128 | 147 |
this.enabled = enabled; |
129 | 148 |
setEnabled(enabled, null); |
130 | 149 |
} |
131 | 150 |
|
151 |
/** {@inheritDoc} */ |
|
132 | 152 |
public void setIrrelevant(boolean irrelevant) { |
133 | 153 |
this.irrelevant = irrelevant; |
134 | 154 |
setIrrelevant(irrelevant, null); |
... | ... | |
136 | 156 |
|
137 | 157 |
/** |
138 | 158 |
* Create all content elements |
139 |
*
|
|
140 |
* @param formElement |
|
141 |
* @param entity |
|
142 |
* @param style |
|
159 |
* |
|
160 |
* @param formElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object.
|
|
161 |
* @param entity a T object.
|
|
162 |
* @param style a int.
|
|
143 | 163 |
*/ |
144 | 164 |
protected abstract void createControls(ICdmFormElement formElement, T entity, int style); |
145 | 165 |
|
166 |
/** {@inheritDoc} */ |
|
146 | 167 |
@Override |
147 | 168 |
public void propertyChange(PropertyChangeEvent event) { |
148 | 169 |
if(event == null){ |
... | ... | |
169 | 190 |
} |
170 | 191 |
} |
171 | 192 |
|
193 |
/** |
|
194 |
* <p>handleEvent</p> |
|
195 |
* |
|
196 |
* @param eventSource a {@link java.lang.Object} object. |
|
197 |
*/ |
|
172 | 198 |
public abstract void handleEvent(Object eventSource); |
173 | 199 |
|
200 |
/** |
|
201 |
* <p>handleException</p> |
|
202 |
* |
|
203 |
* @param event a {@link eu.etaxonomy.taxeditor.forms.CdmPropertyChangeEvent} object. |
|
204 |
*/ |
|
174 | 205 |
public void handleException(CdmPropertyChangeEvent event){ |
175 | 206 |
//override this in subclasses if you want to deal with the error |
176 | 207 |
EditorUtil.error(event.getSource().getClass(), event.getException()); |
177 | 208 |
} |
178 | 209 |
|
210 |
/** |
|
211 |
* <p>isIrrelevant</p> |
|
212 |
* |
|
213 |
* @return a boolean. |
|
214 |
*/ |
|
179 | 215 |
public boolean isIrrelevant() { |
180 | 216 |
return irrelevant; |
181 | 217 |
} |
182 | 218 |
|
219 |
/** |
|
220 |
* <p>getConversationHolder</p> |
|
221 |
* |
|
222 |
* @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object. |
|
223 |
*/ |
|
183 | 224 |
public ConversationHolder getConversationHolder() { |
184 | 225 |
if(getParentElement() instanceof IConversationEnabled){ |
185 | 226 |
return ((IConversationEnabled) getParentElement()).getConversationHolder(); |
... | ... | |
187 | 228 |
throw new IllegalArgumentException("Parent element should be IConversationEnabled"); |
188 | 229 |
} |
189 | 230 |
|
231 |
/** {@inheritDoc} */ |
|
190 | 232 |
public void update(CdmDataChangeMap changeEvents) {} |
191 | 233 |
} |
Also available in: Unified diff
performed javacscript:fix and worked on documentation