Revision 2b01f647
Added by Katja Luther over 6 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameDetailElement.java | ||
---|---|---|
13 | 13 |
|
14 | 14 |
import org.eclipse.ui.forms.widgets.ExpandableComposite; |
15 | 15 |
|
16 |
import eu.etaxonomy.cdm.model.name.IBacterialName; |
|
16 | 17 |
import eu.etaxonomy.cdm.model.name.INonViralName; |
17 | 18 |
import eu.etaxonomy.cdm.model.name.NomenclaturalCode; |
18 | 19 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
... | ... | |
23 | 24 |
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; |
24 | 25 |
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants; |
25 | 26 |
import eu.etaxonomy.taxeditor.ui.element.LsidWithExceptionLabelElement; |
27 |
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement; |
|
26 | 28 |
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection; |
27 | 29 |
import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement; |
28 | 30 |
|
... | ... | |
38 | 40 |
private EnumComboElement<NomenclaturalCode> combo_nomenclaturalCode; |
39 | 41 |
private HybridDetailSection section_hybrid; |
40 | 42 |
private LsidWithExceptionLabelElement textLsid; |
43 |
private TextWithLabelElement text_nameApprobation; |
|
41 | 44 |
|
42 | 45 |
|
43 | 46 |
public NonViralNameDetailElement(CdmFormFactory formFactory, |
... | ... | |
58 | 61 |
combo_nomenclaturalCode = formFactory.createEnumComboElement(NomenclaturalCode.class, formElement, style); |
59 | 62 |
combo_nomenclaturalCode.setSelection(entity.getNomenclaturalCode()); |
60 | 63 |
textLsid = formFactory.createLsidWithExceptionLabelElement(formElement, "Lsid", entity.getLsid(), style); |
64 |
if (entity.getNameType().equals(NomenclaturalCode.ICNB)){ |
|
65 |
text_nameApprobation = formFactory.createTextWithLabelElement(formElement, "Name Approbation", entity.getNameApprobation(),style); |
|
66 |
} |
|
61 | 67 |
|
62 | 68 |
}else{ |
63 | 69 |
if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_CACHE)){ |
... | ... | |
72 | 78 |
textLsid = formFactory.createLsidWithExceptionLabelElement(formElement, "Lsid", entity.getLsid(), style); |
73 | 79 |
|
74 | 80 |
} |
75 |
|
|
81 |
|
|
82 |
if (entity.getNameType().equals(NomenclaturalCode.ICNB)){ |
|
83 |
if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_APPROBATION)){ |
|
84 |
text_nameApprobation = formFactory.createTextWithLabelElement(formElement, "Name Approbation", entity.getNameApprobation(),style); |
|
85 |
} |
|
86 |
} |
|
76 | 87 |
|
77 | 88 |
} |
78 | 89 |
|
... | ... | |
112 | 123 |
if(toggleable_cache!=null){ |
113 | 124 |
toggleable_cache.setEnabled(getEntity().isProtectedTitleCache() || getEntity().isProtectedFullTitleCache()); |
114 | 125 |
setIrrelevant(toggleable_cache.getState(), |
115 |
Arrays.asList(new Object[] { toggleable_cache, textLsid })); |
|
126 |
Arrays.asList(new Object[] { toggleable_cache, textLsid, text_nameApprobation }));
|
|
116 | 127 |
} |
117 | 128 |
} |
118 | 129 |
|
... | ... | |
167 | 178 |
toggleable_cache.setText(getEntity().getTitleCache()); |
168 | 179 |
} |
169 | 180 |
} |
170 |
} |
|
171 |
if (eventSource == section_name) { |
|
181 |
} else if (eventSource == section_name) { |
|
172 | 182 |
section_name.setEntity(getEntity()); |
173 | 183 |
getLayoutComposite().layout(); |
174 |
} |
|
175 |
else if(eventSource==textLsid){ |
|
184 |
} else if(eventSource==textLsid){ |
|
176 | 185 |
getEntity().setLsid(textLsid.parseText()); |
177 |
} |
|
178 |
|
|
179 |
if (eventSource == combo_nomenclaturalCode){ |
|
186 |
} else if (eventSource == combo_nomenclaturalCode){ |
|
180 | 187 |
getEntity().setNameType(combo_nomenclaturalCode.getSelection()); |
181 | 188 |
section_name.updateContent(); |
182 |
} |
|
189 |
} else if(eventSource == this.text_nameApprobation){ |
|
190 |
((IBacterialName)getEntity()).setNameApprobation(text_nameApprobation.getText()); |
|
191 |
} |
|
183 | 192 |
} |
184 | 193 |
@Override |
185 | 194 |
protected void handleToggleableCacheField() { |
186 | 195 |
boolean pushedState = toggleable_cache.getState(); |
187 | 196 |
|
188 | 197 |
getEntity().setTitleCache(toggleable_cache.getText(), pushedState); |
189 |
setIrrelevant(pushedState, Arrays.asList(new Object[] { toggleable_cache, textLsid })); |
|
198 |
setIrrelevant(pushedState, Arrays.asList(new Object[] { toggleable_cache, textLsid, text_nameApprobation }));
|
|
190 | 199 |
updateToggleableCacheField(); |
191 | 200 |
} |
192 | 201 |
|
Also available in: Unified diff
move name approbiation behind lsid in name details view