import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
import eu.etaxonomy.cdm.model.name.NonViralName;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
toggleable_cache = formFactory.createToggleableTextField(formElement, "Cache", entity.getTitleCache(), entity.isProtectedTitleCache() || entity.isProtectedFullTitleCache(), style);
- combo_nomenclaturalCode = formFactory.createEnumComboElement(NomenclaturalCode.class, formElement, style);
- combo_nomenclaturalCode.setSelection(entity.getNomenclaturalCode());
-
+ combo_nomenclaturalCode = formFactory.createEnumComboElement(NomenclaturalCode.class, formElement, style);
+ combo_nomenclaturalCode.setSelection(entity.getNomenclaturalCode());
+
+ //TODO RL
+ if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
+ toggleable_cache.setVisible(false);
+ combo_nomenclaturalCode.setVisible(false);
+ }
+
section_name = formFactory.createNameDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
section_name.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
addControl(section_name);
addControl(section_author);
addElement(section_author);
- section_hybrid = formFactory.createHybridDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
- section_hybrid.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
- addControl(section_hybrid);
- addElement(section_hybrid);
+ //TODO RL
+ if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
+ section_hybrid = formFactory.createHybridDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
+ section_hybrid.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+ addControl(section_hybrid);
+ addElement(section_hybrid);
+ }
}
/** {@inheritDoc} */
@Override
public void setEntity(NonViralName entity) {
super.setEntity(entity);
- section_name.setEntity(entity);
- section_author.setEntity(entity);
- section_hybrid.setEntity(entity);
+ if (section_name!=null) section_name.setEntity(entity);
+ if (section_author!=null) section_author.setEntity(entity);
+ if (section_hybrid!=null) section_hybrid.setEntity(entity);
}
/** {@inheritDoc} */