Project

General

Profile

« Previous | Next » 

Revision 5e3a2c94

Added by Patrick Plitzner over 5 years ago

ref #7849 Set override flag to true if no pref was found

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/SpecimenAdminPreferences.java
46 46
    boolean isShowLifeForm;
47 47
    boolean isUseLocalPreference;
48 48
    Composite composite;
49
    CdmPreference isShowSpecimenPref = null;
49
    CdmPreference showSpecimenPref = null;
50 50

  
51 51
    @Override
52 52
    protected Control createContents(Composite parent) {
......
161 161
        if (controller != null){
162 162
            IPreferenceService service = controller.getPreferenceService();
163 163
            PrefKey key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowSpecimen);
164
            isShowSpecimenPref = service.find(key);
165
            if (isShowSpecimenPref != null){
166
                this.isShowSpecimenRelatedIssues = Boolean.valueOf(isShowSpecimenPref.getValue());
164
            showSpecimenPref = service.find(key);
165
            if (showSpecimenPref != null){
166
                this.isShowSpecimenRelatedIssues = Boolean.valueOf(showSpecimenPref.getValue());
167
                this.isUseLocalPreference = showSpecimenPref.isAllowOverride();
167 168
            }else{
168
                isShowSpecimenPref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.ShowSpecimen, Boolean.toString(true));
169
                showSpecimenPref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.ShowSpecimen, Boolean.toString(true));
169 170
                this.isShowSpecimenRelatedIssues = true;
171
                this.isUseLocalPreference = true;
170 172
            }
171 173

  
172 174
            key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowCollectingAreasInGeneralSection);
......
197 199

  
198 200
    @Override
199 201
     public boolean performOk() {
200
        if (isShowSpecimenPref == null){
202
        if (showSpecimenPref == null){
201 203
            return true;
202 204
        }
203 205
        ICdmRepository controller = CdmStore.getCurrentApplicationConfiguration();

Also available in: Unified diff