fix #6050: add the possibility to configure which fields should be displayed in name...
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / name / NonViralNameDetailElement.java
index e88a143db4d1b1640508c9a41a6ef9b74b1b4ba2..23fe4db93d8564c53a15e1016e5cd33ae05b022e 100644 (file)
@@ -64,6 +64,26 @@ public class NonViralNameDetailElement extends
                 toggleable_cache.setVisible(false);
                 combo_nomenclaturalCode.setVisible(false);
             }
+        }else{
+               if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_CACHE)){
+                       toggleable_cache = formFactory.createToggleableTextField(formElement, "Cache", entity.getTitleCache(), entity.isProtectedTitleCache() || entity.isProtectedFullTitleCache(), style);
+                if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
+                    toggleable_cache.setVisible(false);
+                }
+               }
+               if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE)){
+                       combo_nomenclaturalCode = formFactory.createEnumComboElement(NomenclaturalCode.class, formElement, style);
+                       combo_nomenclaturalCode.setSelection(entity.getNomenclaturalCode());
+                        if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
+                                 combo_nomenclaturalCode.setVisible(false);
+                 } 
+               }
+               if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_LSID)){
+                       textLsid = formFactory.createLsidWithExceptionLabelElement(formElement, "Lsid", entity.getLsid(), style);
+                       
+               }
+                       
+               
         }
 
 
@@ -84,7 +104,16 @@ public class NonViralNameDetailElement extends
                addControl(section_hybrid);
                addElement(section_hybrid);
            }
-           }
+        }else{
+                if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
+                        if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_HYBRID)){
+                       section_hybrid = formFactory.createHybridDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
+                       section_hybrid.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+                       addControl(section_hybrid);
+                       addElement(section_hybrid);
+                        }
+           }
+        }
 
 
     }