Project

General

Profile

« Previous | Next » 

Revision 4db49a38

Added by Alexander Oppermann over 9 years ago

reintegrated redlist branch into trunk

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameDetailElement.java
16 16

  
17 17
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
18 18
import eu.etaxonomy.cdm.model.name.NonViralName;
19
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
20
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
19 21
import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
20 22
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
21 23
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
......
71 73

  
72 74
        toggleable_cache = formFactory.createToggleableTextField(formElement, "Cache", entity.getTitleCache(), entity.isProtectedTitleCache() || entity.isProtectedFullTitleCache(), style);
73 75

  
74
        combo_nomenclaturalCode = formFactory.createEnumComboElement(NomenclaturalCode.class, formElement, style);
75
        combo_nomenclaturalCode.setSelection(entity.getNomenclaturalCode());
76

  
76
       	combo_nomenclaturalCode = formFactory.createEnumComboElement(NomenclaturalCode.class, formElement, style);
77
       	combo_nomenclaturalCode.setSelection(entity.getNomenclaturalCode());
78
       	
79
        //TODO RL
80
       	if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
81
        	toggleable_cache.setVisible(false);
82
        	combo_nomenclaturalCode.setVisible(false);
83
        }
84
        
77 85
        section_name = formFactory.createNameDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
78 86
        section_name.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
79 87
        addControl(section_name);
......
83 91
        addControl(section_author);
84 92
        addElement(section_author);
85 93

  
86
        section_hybrid = formFactory.createHybridDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
87
        section_hybrid.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
88
        addControl(section_hybrid);
89
        addElement(section_hybrid);
94
        //TODO RL
95
        if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
96
	        section_hybrid = formFactory.createHybridDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
97
	        section_hybrid.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
98
	        addControl(section_hybrid);
99
	        addElement(section_hybrid);
100
        }       
90 101
    }
91 102

  
92 103
	/** {@inheritDoc} */
......
106 117
	@Override
107 118
	public void setEntity(NonViralName entity) {
108 119
		super.setEntity(entity);
109
		section_name.setEntity(entity);
110
		section_author.setEntity(entity);
111
		section_hybrid.setEntity(entity);
120
		if (section_name!=null) section_name.setEntity(entity);
121
		if (section_author!=null) section_author.setEntity(entity);
122
		if (section_hybrid!=null) section_hybrid.setEntity(entity);
112 123
	}
113 124

  
114 125
	/** {@inheritDoc} */

Also available in: Unified diff