Revision 25fe366b
Added by Patrick Plitzner over 5 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameDetailElement.java | ||
---|---|---|
135 | 135 |
|
136 | 136 |
} |
137 | 137 |
|
138 |
@Override |
|
139 |
protected void update(INonViralName nonViralName) { |
|
140 |
super.update(nonViralName); |
|
141 |
if (isAdvancedView){ |
|
142 |
toggleable_cache.setText(nonViralName.getNameCache()); |
|
143 |
|
|
144 |
combo_rank.setSelection(nonViralName.getRank()); |
|
145 |
|
|
146 |
|
|
147 |
text_uninomial.setText(nonViralName.getGenusOrUninomial()); |
|
148 |
text_infragenericEpithet.setText(nonViralName.getInfraGenericEpithet()); |
|
149 |
text_specificEpithet.setText(nonViralName.getSpecificEpithet()); |
|
150 |
text_infraspecificEpithet.setText(nonViralName.getInfraSpecificEpithet()); |
|
151 |
updateSpecificNameParts(nonViralName); |
|
152 |
|
|
153 |
text_appendedPhrase.setText(nonViralName.getAppendedPhrase()); |
|
154 |
}else{ |
|
155 |
if (config.isNameCacheActivated()){ |
|
156 |
toggleable_cache.setText(nonViralName.getNameCache()); |
|
157 |
} |
|
158 |
|
|
159 |
if (config.isRankActivated()){ |
|
160 |
combo_rank.setSelection(nonViralName.getRank()); |
|
161 |
} |
|
162 |
|
|
163 |
if (config.isAtomisedEpithetsActivated()){ |
|
164 |
text_uninomial.setText(nonViralName.getGenusOrUninomial()); |
|
165 |
text_infragenericEpithet.setText(nonViralName.getInfraGenericEpithet()); |
|
166 |
text_specificEpithet.setText(nonViralName.getSpecificEpithet()); |
|
167 |
text_infraspecificEpithet.setText(nonViralName.getInfraSpecificEpithet()); |
|
168 |
updateSpecificNameParts(nonViralName); |
|
169 |
} |
|
170 |
if (config.isAppendedPhraseActivated()){ |
|
171 |
text_appendedPhrase.setText(nonViralName.getAppendedPhrase()); |
|
172 |
} |
|
173 |
} |
|
174 |
} |
|
175 |
|
|
138 | 176 |
/** |
139 | 177 |
* <p>clearCheckRankWarnings</p> |
140 | 178 |
*/ |
... | ... | |
170 | 208 |
} |
171 | 209 |
|
172 | 210 |
|
211 |
private void updateSpecificNameParts(INonViralName nonViralName) { |
|
212 |
NomenclaturalCode code = nonViralName.getNomenclaturalCode(); |
|
213 |
if (code != null){ |
|
214 |
switch(nonViralName.getNomenclaturalCode()){ |
|
215 |
case ICNAFP : |
|
216 |
//nothing do add |
|
217 |
updateBotanicalNameParts(nonViralName); |
|
218 |
break; |
|
219 |
case Fungi : |
|
220 |
if (isAdvancedView){ |
|
221 |
updateFungusNameParts(nonViralName); |
|
222 |
} |
|
223 |
break; |
|
224 |
case ICZN: |
|
225 |
updateZoologicalNameParts(nonViralName); |
|
226 |
break; |
|
227 |
case ICVCN: |
|
228 |
//TODO implement |
|
229 |
logger.warn("ICVCN not yet implemented"); |
|
230 |
break; |
|
231 |
case ICNB: |
|
232 |
updateBacterialNameParts(nonViralName); |
|
233 |
break; |
|
234 |
case ICNCP: |
|
235 |
updateCultivarNameParts(nonViralName); |
|
236 |
break; |
|
237 |
case NonViral: |
|
238 |
//TODO implement |
|
239 |
logger.warn("NonViral not yet implemented"); |
|
240 |
break; |
|
241 |
} |
|
242 |
} |
|
243 |
} |
|
244 |
|
|
173 | 245 |
private void createSpecificNameParts(ICdmFormElement formElement, |
174 | 246 |
INonViralName nonViralName, int style) { |
175 | 247 |
NomenclaturalCode code = nonViralName.getNomenclaturalCode(); |
... | ... | |
213 | 285 |
|
214 | 286 |
} |
215 | 287 |
|
288 |
private void updateBacterialNameParts(INonViralName nonViralName) { |
|
289 |
IBacterialName bacterialName = (IBacterialName) nonViralName; |
|
290 |
text_subGenusAuthorship.setText(bacterialName.getSubGenusAuthorship()); |
|
291 |
} |
|
292 |
|
|
216 | 293 |
private void createCultivarNameParts(ICdmFormElement formElement, INonViralName nonViralName, int style) { |
217 | 294 |
ICultivarPlantName cultivarName = (ICultivarPlantName)nonViralName; |
218 | 295 |
text_cultivarName = formFactory.createTextWithLabelElement(formElement, "Cultivar Name", cultivarName.getCultivarName(), style); |
296 |
} |
|
219 | 297 |
|
298 |
private void updateCultivarNameParts(INonViralName nonViralName) { |
|
299 |
ICultivarPlantName cultivarName = (ICultivarPlantName)nonViralName; |
|
300 |
text_cultivarName.setText(cultivarName.getCultivarName()); |
|
220 | 301 |
} |
221 | 302 |
|
222 | 303 |
private void createBotanicalNameParts(ICdmFormElement formElement, INonViralName nonViralName, int style){ |
223 | 304 |
//nothing to do |
224 | 305 |
} |
225 | 306 |
|
307 |
private void updateBotanicalNameParts(INonViralName nonViralName){ |
|
308 |
//nothing to do |
|
309 |
} |
|
310 |
|
|
226 | 311 |
private void createFungusNameParts(ICdmFormElement formElement, INonViralName nonViralName, int style){ |
227 | 312 |
IFungusName fungusName= (IFungusName)nonViralName; |
228 | 313 |
checkbox_anamorphic = formFactory.createCheckbox(formElement, "Anamorphic", fungusName.isAnamorphic(), style); |
229 | 314 |
} |
230 | 315 |
|
316 |
private void updateFungusNameParts(INonViralName nonViralName){ |
|
317 |
IFungusName fungusName= (IFungusName)nonViralName; |
|
318 |
checkbox_anamorphic.setSelection(fungusName.isAnamorphic()); |
|
319 |
} |
|
320 |
|
|
231 | 321 |
private void createZoologicalNameParts(ICdmFormElement formElement, INonViralName nonViralName, int style){ |
232 | 322 |
IZoologicalName zoologicalName = (IZoologicalName) nonViralName; |
233 | 323 |
|
... | ... | |
236 | 326 |
} |
237 | 327 |
} |
238 | 328 |
|
329 |
private void updateZoologicalNameParts(INonViralName nonViralName){ |
|
330 |
IZoologicalName zoologicalName = (IZoologicalName) nonViralName; |
|
331 |
if (isAdvancedView){ |
|
332 |
text_breed.setText(zoologicalName.getBreed()); |
|
333 |
} |
|
334 |
} |
|
335 |
|
|
239 | 336 |
private void createGenusOrUninomialControls(ICdmFormElement element, INonViralName nonViralName, int style){ |
240 | 337 |
String title = "Genus"; |
241 | 338 |
Rank rank = nonViralName.getRank(); |
Also available in: Unified diff
ref #6554 Implement update() for taxon details view sections