Project

General

Profile

« Previous | Next » 

Revision e00acade

Added by Katja Luther about 5 years ago

use same saving strategie for local name details pref as for db name details pref

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/NameDetailsViewAdminConfiguration.java
60 60
        CdmPreference pref = CdmPreference.NewTaxEditorInstance(EditorPreferencePredicate.NameDetailsView, value);
61 61
        pref.setAllowOverride(isAllowOverride);
62 62
        service.set(pref);
63
        PreferencesUtil.saveConfigToPrefernceStore(config);
63

  
64 64

  
65 65
        return true;
66 66
    }
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/IPreferenceKeys.java
130 130
    public static final String COMMON_NAME_AREA_VOCABULARIES = "eu.etaxonomy.taxeditor.commonNames.areaVocabularies";
131 131

  
132 132
//Taxon Details View
133
    public static final String SHOW_SEC_DETAILS = "eu.etaxonomy.taxeditor.taxon.showSecDetails";
134
    public static final String DISABLE_SEC = "eu.etaxonomy.taxeditor.taxon.disableSec";
133
//    public static final String SHOW_SEC_DETAILS = "eu.etaxonomy.taxeditor.taxon.showSecDetails";
134
//    public static final String DISABLE_SEC = "eu.etaxonomy.taxeditor.taxon.disableSec";
135 135
    //Name details view
136
    public static final String SHOW_SIMPLE_NAME_DETAILS_SECTION = "eu.etaxonomy.taxeditor.name.showSimpleName";
137
    public static final String SHOW_SIMPLE_NAME_DETAILS_TAXON = "eu.etaxonomy.taxeditor.name.showNameTaxon";
138
    public static final String SHOW_NAME_DETAILS_SECTION_LSID = "eu.etaxonomy.taxeditor.name.showNameLsid";
139
    public static final String SHOW_NAME_DETAILS_SECTION_NAME_APPROBATION = "eu.etaxonomy.taxeditor.name.showNameNameApprobiation";
140
    public static final String SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE = "eu.etaxonomy.taxeditor.name.showNameNomenclaturalCode";
141
    public static final String SHOW_NAME_DETAILS_SECTION_RANK = "eu.etaxonomy.taxeditor.name.showNameRank";
142
    public static final String SHOW_NAME_DETAILS_SECTION_NAMECACHE = "eu.etaxonomy.taxeditor.name.showNameNameCache";
143
    public static final String SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS = "eu.etaxonomy.taxeditor.name.showNameAtomisedEpithets";
144
    public static final String SHOW_NAME_DETAILS_SECTION_AUTHORSHIP = "eu.etaxonomy.taxeditor.name.showNameAuthorship";
145
    public static final String SHOW_NAME_DETAILS_SECTION_HYBRID = "eu.etaxonomy.taxeditor.name.showNameHybrid";
146
    public static final String SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE = "eu.etaxonomy.taxeditor.name.showNameNomenclaturalReference";
147
    public static final String SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS = "eu.etaxonomy.taxeditor.name.showNameNomenclaturalStatus";
148
    public static final String SHOW_NAME_DETAILS_SECTION_PROTOLOGUE = "eu.etaxonomy.taxeditor.name.showNameProtologue";
149
    public static final String SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION = "eu.etaxonomy.taxeditor.name.showNameTypeDesignation";
150
    public static final String SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP = "eu.etaxonomy.taxeditor.name.showNameNameRelationship";
151
	public static final String SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE = "eu.etaxonomy.taxeditor.name.showNameAppendedPhrase";
152
	public static final String SHOW_NAME_DETAILS_SECTION_CACHE = "eu.etaxonomy.taxeditor.name.showNameCache";
153
    public static final String SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE = "eu.etaxonomy.taxeditor.name.showAuthorCache";
136
//    public static final String SHOW_SIMPLE_NAME_DETAILS_SECTION = "eu.etaxonomy.taxeditor.name.showSimpleName";
137
//    public static final String SHOW_SIMPLE_NAME_DETAILS_TAXON = "eu.etaxonomy.taxeditor.name.showNameTaxon";
138
//    public static final String SHOW_NAME_DETAILS_SECTION_LSID = "eu.etaxonomy.taxeditor.name.showNameLsid";
139
//    public static final String SHOW_NAME_DETAILS_SECTION_NAME_APPROBATION = "eu.etaxonomy.taxeditor.name.showNameNameApprobiation";
140
//    public static final String SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE = "eu.etaxonomy.taxeditor.name.showNameNomenclaturalCode";
141
//    public static final String SHOW_NAME_DETAILS_SECTION_RANK = "eu.etaxonomy.taxeditor.name.showNameRank";
142
//    public static final String SHOW_NAME_DETAILS_SECTION_NAMECACHE = "eu.etaxonomy.taxeditor.name.showNameNameCache";
143
//    public static final String SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS = "eu.etaxonomy.taxeditor.name.showNameAtomisedEpithets";
144
//    public static final String SHOW_NAME_DETAILS_SECTION_AUTHORSHIP = "eu.etaxonomy.taxeditor.name.showNameAuthorship";
145
//    public static final String SHOW_NAME_DETAILS_SECTION_HYBRID = "eu.etaxonomy.taxeditor.name.showNameHybrid";
146
//    public static final String SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE = "eu.etaxonomy.taxeditor.name.showNameNomenclaturalReference";
147
//    public static final String SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS = "eu.etaxonomy.taxeditor.name.showNameNomenclaturalStatus";
148
//    public static final String SHOW_NAME_DETAILS_SECTION_PROTOLOGUE = "eu.etaxonomy.taxeditor.name.showNameProtologue";
149
//    public static final String SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION = "eu.etaxonomy.taxeditor.name.showNameTypeDesignation";
150
//    public static final String SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP = "eu.etaxonomy.taxeditor.name.showNameNameRelationship";
151
//	public static final String SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE = "eu.etaxonomy.taxeditor.name.showNameAppendedPhrase";
152
//	public static final String SHOW_NAME_DETAILS_SECTION_CACHE = "eu.etaxonomy.taxeditor.name.showNameCache";
153
//    public static final String SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE = "eu.etaxonomy.taxeditor.name.showAuthorCache";
154 154
    public static final String ALLOW_OVERRIDE_NAME_DETAILS = "eu.etaxonomy.taxeditor.name.allowOverride";
155 155
    public static final String OVERRIDE_NAME_DETAILS = "eu.etaxonomy.taxeditor.name.override";
156 156

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/NameDetailsViewConfiguration.java
46 46

  
47 47
    protected boolean isAllowOverride;
48 48
    private boolean isOverride;
49
    private Button showSecDetail;
50
    private Button secEnabled;
49 51

  
50 52
    @Override
51 53
    protected Control createContents(Composite parent) {
......
74 76
                public void widgetSelected(SelectionEvent e) {
75 77
                    setApply(true);
76 78
                    isSimpleDetailsViewActivated = activateCheckButton.getSelection();
77

  
79
                    nameDetailsConfig.setSimpleDetailsViewActivated(isSimpleDetailsViewActivated);
78 80
                    dbSettings.setEnabled(isSimpleDetailsViewActivated);
79 81
                    PreferencesUtil.recursiveSetEnabled(dbSettings, isSimpleDetailsViewActivated);
82
                    showSecDetail.setEnabled(isShowTaxon);
83
                    secEnabled.setEnabled(isShowTaxon);
80 84
                 }
81 85
             });
82 86

  
......
113 117
                 public void widgetSelected(SelectionEvent e) {
114 118
                     setApply(true);
115 119
                     isShowTaxon = showTaxon.getSelection();
116

  
120
                     nameDetailsConfig.setTaxonSectionActivated(isShowTaxon);
121
                     showSecDetail.setEnabled(isShowTaxon);
122
                     secEnabled.setEnabled(isShowTaxon);
117 123
                  }
118 124
             });
119 125

  
120
            final Button showSecDetail = new Button(dbSettings, SWT.CHECK);
126
            showSecDetail = new Button(dbSettings, SWT.CHECK);
121 127
            showSecDetail.setText(Messages.NameDetailsViewComposite_Show_SecDetail);
128

  
122 129
            isSecDetailsActivated = nameDetailsConfig.isSecDetailsActivated();
123 130
            showSecDetail.setSelection(isSecDetailsActivated);
124 131
            showSecDetail.addSelectionListener(new SelectionAdapter(){
......
126 133
                 public void widgetSelected(SelectionEvent e) {
127 134
                     setApply(true);
128 135
                     isSecDetailsActivated = showSecDetail.getSelection();
129

  
136
                     nameDetailsConfig.setSecDetailsActivated(isSecDetailsActivated);
130 137
                  }
131 138
             });
132 139

  
133
            final Button secEnabled = new Button(dbSettings, SWT.CHECK);
140
            secEnabled = new Button(dbSettings, SWT.CHECK);
134 141
            secEnabled.setText(Messages.NameDetailsViewComposite_SecEnabled);
142

  
135 143
            isSecEnabled = nameDetailsConfig.isSecEnabled();
136 144
            secEnabled.setSelection(isSecEnabled);
137 145
            secEnabled.addSelectionListener(new SelectionAdapter(){
......
139 147
                 public void widgetSelected(SelectionEvent e) {
140 148
                     setApply(true);
141 149
                     isSecEnabled = secEnabled.getSelection();
142

  
150
                     nameDetailsConfig.setSecEnabled(isSecEnabled);
143 151
                  }
144 152
             });
145 153

  
......
153 161
                 public void widgetSelected(SelectionEvent e) {
154 162
                     setApply(true);
155 163
                     isShowLSID = showLsid.getSelection();
156

  
164
                     nameDetailsConfig.setLSIDActivated(isShowLSID);
157 165
                  }
158 166
             });
159 167

  
......
166 174
                 public void widgetSelected(SelectionEvent e) {
167 175
                     setApply(true);
168 176
                     isShowNomenclaturalCode = showNomenclaturalCode.getSelection();
169

  
177
                     nameDetailsConfig.setNomenclaturalCodeActived(isShowNomenclaturalCode);
170 178
                  }
171 179
             });
172 180

  
......
179 187
                 public void widgetSelected(SelectionEvent e) {
180 188
                     setApply(true);
181 189
                     isShowNameCache = showNameCache.getSelection();
190
                     nameDetailsConfig.setNameCacheActivated(isShowNameCache);
182 191
                  }
183 192
             });
184 193
            final Button showAppendedPhrase = new Button(dbSettings, SWT.CHECK);
......
190 199
                 public void widgetSelected(SelectionEvent e) {
191 200
                     setApply(true);
192 201
                     isShowAppendedPhrase = showAppendedPhrase.getSelection();
202
                     nameDetailsConfig.setAppendedPhraseActivated(isShowAppendedPhrase);
193 203
                  }
194 204
             });
195 205

  
......
202 212
                 public void widgetSelected(SelectionEvent e) {
203 213
                     setApply(true);
204 214
                     isShowRank = showRank.getSelection();
215
                     nameDetailsConfig.setRankActivated(isShowRank);
205 216
                  }
206 217
             });
207 218
            final Button showEpithets = new Button(dbSettings, SWT.CHECK);
......
213 224
                 public void widgetSelected(SelectionEvent e) {
214 225
                     setApply(true);
215 226
                     isShowEpithets = showEpithets.getSelection();
227
                     nameDetailsConfig.setAtomisedEpithetsActivated(isShowEpithets);
216 228
                  }
217 229
             });
218 230

  
......
225 237
                 public void widgetSelected(SelectionEvent e) {
226 238
                     setApply(true);
227 239
                     isShowAuthorCache = showAuthorCache.getSelection();
240
                     nameDetailsConfig.setAuthorCacheActivated(isShowAuthorCache);
228 241
                  }
229 242
             });
230 243

  
......
237 250
                 public void widgetSelected(SelectionEvent e) {
238 251
                     setApply(true);
239 252
                     isShowAuthorship = showAuthorship.getSelection();
253
                     nameDetailsConfig.setAuthorshipSectionActivated(isShowAuthorship);
240 254
                  }
241 255
             });
242 256

  
......
249 263
                 public void widgetSelected(SelectionEvent e) {
250 264
                     setApply(true);
251 265
                     isShowNomenclaturalRef = showNomenclaturalRef.getSelection();
266
                     nameDetailsConfig.setNomenclaturalReferenceSectionActivated(isShowNomenclaturalRef);
252 267
                  }
253 268
             });
254 269

  
......
261 276
                 public void widgetSelected(SelectionEvent e) {
262 277
                     setApply(true);
263 278
                     isShowNomenclaturalStatus = showNomenclaturalStatus.getSelection();
279
                     nameDetailsConfig.setNomenclaturalStatusSectionActivated(isShowNomenclaturalStatus);
264 280
                  }
265 281
             });
266 282

  
......
273 289
                 public void widgetSelected(SelectionEvent e) {
274 290
                     setApply(true);
275 291
                     isShowProtologue = showProtologue.getSelection();
292
                     nameDetailsConfig.setProtologueActivated(isShowProtologue);
276 293
                  }
277 294
             });
278 295

  
......
285 302
                 public void widgetSelected(SelectionEvent e) {
286 303
                     setApply(true);
287 304
                     isShowTypeDesignation = showTypeDesignation.getSelection();
305
                     nameDetailsConfig.setTypeDesignationSectionActivated(isShowTypeDesignation);
288 306
                  }
289 307
             });
290 308

  
......
298 316
                 public void widgetSelected(SelectionEvent e) {
299 317
                     setApply(true);
300 318
                     isShowNameRelationship = showNameRelationship.getSelection();
319
                     nameDetailsConfig.setNameRelationsSectionActivated(isShowNameRelationship);
301 320
                  }
302 321
             });
303 322

  
......
310 329
                 public void widgetSelected(SelectionEvent e) {
311 330
                     setApply(true);
312 331
                     isShowHybrid = showHybrid.getSelection();
332
                     nameDetailsConfig.setHybridActivated(isShowHybrid);
313 333
                  }
314 334
             });
315 335
            final Button showNameApprobiation = new Button(dbSettings, SWT.CHECK);
......
321 341
                 public void widgetSelected(SelectionEvent e) {
322 342
                     setApply(true);
323 343
                     isShowNameApprobiation = showNameApprobiation.getSelection();
344
                     nameDetailsConfig.setNameApprobiationActivated(isShowNameApprobiation);
324 345
                  }
325 346
             });
326 347
            PreferencesUtil.recursiveSetEnabled(dbSettings, isSimpleDetailsViewActivated);
348
            showSecDetail.setEnabled(isShowTaxon);
349
            secEnabled.setEnabled(isShowTaxon);
327 350
        }else{
328 351
            final CLabel description = new CLabel(parent, SWT.NULL);
329 352
            description.setText(Messages.NameDetailsViewConfiguration_description_not_available);
......
337 360

  
338 361
    @Override
339 362
    public boolean performOk() {
340
        PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_TAXON, isShowTaxon);
341
        PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_SEC_DETAILS, isSecDetailsActivated);
342
        PreferencesUtil.setBooleanValue(IPreferenceKeys.DISABLE_SEC, isSecEnabled);
343
        PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION, isSimpleDetailsViewActivated);
344
        PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_APPROBATION, isShowNameApprobiation);
345
        PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_HYBRID, isShowHybrid);
346
        PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP, isShowNameRelationship);
347
        PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION, isShowTypeDesignation);
348
        PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_PROTOLOGUE, isShowProtologue);
349
        PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS, isShowNomenclaturalStatus);
350
        PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE, isShowNomenclaturalRef);
351
        PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP, isShowAuthorship);
352
        PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE, isShowAuthorCache);
353
        PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS, isShowEpithets);
354
        PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_RANK, isShowRank);
355
        PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE, isShowAppendedPhrase);
356
        PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAMECACHE, isShowNameCache);
357
        PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE, isShowNomenclaturalCode);
358
        PreferencesUtil.setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_LSID, isShowLSID);
363
        if (nameDetailsConfig != null){
364
            PreferencesUtil.setStringValue(EditorPreferencePredicate.NameDetailsView.getKey(), nameDetailsConfig.toString());
365
        }
366

  
359 367

  
360 368
        PreferencesUtil.setBooleanValue(IPreferenceKeys.OVERRIDE_NAME_DETAILS, isOverride);
361 369
        return true;
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java
840 840

  
841 841

  
842 842
		//Name Details
843
		getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS), true);
844
		getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE), true);
845
		getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_AUTHORSHIP), true);
846
		getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_HYBRID), true);
847
		getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_LSID), true);
848
		getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP), true);
849
		getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_NAMECACHE), true);
850
		getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE), true);
851
		getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE), true);
852
		getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS), true);
853
		getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_PROTOLOGUE), true);
854
		getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_RANK), true);
855
		getPreferenceStore().setDefault(createPreferenceString(SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION), true);
843
		getPreferenceStore().setDefault(createPreferenceString(EditorPreferencePredicate.NameDetailsView.getKey()), new NameDetailsConfigurator(false).toString());
844

  
856 845
		//Navigator preferences
857 846
		getPreferenceStore().setDefault(createPreferenceString(SORT_NODES), NavigatorOrderEnum.RankAndNameOrder.getKey());
858 847

  
......
868 857
		getPreferenceStore().setDefault(createPreferenceString(EditorPreferencePredicate.ShowNamespaceInSource.getKey()), Boolean.valueOf(EditorPreferencePredicate.ShowNamespaceInSource.getDefaultValue().toString()));
869 858
		getPreferenceStore().setDefault(createPreferenceString(EditorPreferencePredicate.ShowIdInSource.getKey()), Boolean.valueOf(EditorPreferencePredicate.ShowIdInSource.getDefaultValue().toString()));
870 859
		getPreferenceStore().setDefault(createPreferenceString(EditorPreferencePredicate.DisableMultiClassification.getKey()), Boolean.valueOf(EditorPreferencePredicate.DisableMultiClassification.getDefaultValue().toString()));
871
		getPreferenceStore().setDefault(createPreferenceString(DISABLE_SEC), false);
872
		getPreferenceStore().setDefault(createPreferenceString(SHOW_SEC_DETAILS), true);
860

  
873 861
	}
874 862

  
875 863
	/**
......
1399 1387
        NameDetailsConfigurator config = new NameDetailsConfigurator(true);
1400 1388
        CdmPreferenceCache cache = CdmPreferenceCache.instance();
1401 1389
        CdmPreference preference = null;
1402

  
1390
        String value;
1403 1391
        if (!local) {
1404 1392
            preference = cache.get(EditorPreferencePredicate.NameDetailsView.getKey());
1405 1393
            if (preference == null){
......
1407 1395
            }
1408 1396

  
1409 1397
            setBooleanValue(ALLOW_OVERRIDE_NAME_DETAILS, preference.isAllowOverride());
1410

  
1398
            value = preference.getValue();
1399
            config.setAllowOverride(preference.isAllowOverride());
1411 1400
            //the preference value is build like this:
1412 1401
            //<section1>:true;<section2>:false....
1402
        }else{
1403
            value = getStringValue(EditorPreferencePredicate.NameDetailsView.getKey(), local);
1404
        }
1405
        String [] sections = value.split(";");
1406
        Map<String, Boolean> sectionMap = new HashMap<String, Boolean>();
1407
        String[] sectionValues;
1408
        for (String sectionValue: sections){
1409
            sectionValues = sectionValue.split(":");
1410
            sectionMap.put(sectionValues[0], Boolean.valueOf(sectionValues[1]));
1411
        }
1413 1412

  
1414
            String value = preference.getValue();
1415
            String [] sections = value.split(";");
1416
            Map<String, Boolean> sectionMap = new HashMap<String, Boolean>();
1417
            String[] sectionValues;
1418
            for (String sectionValue: sections){
1419
                sectionValues = sectionValue.split(":");
1420
                sectionMap.put(sectionValues[0], Boolean.valueOf(sectionValues[1]));
1421
            }
1422
            config.setAllowOverride(preference.isAllowOverride());
1423
            config.setSimpleDetailsViewActivated(getValue(sectionMap, "simpleViewActivated"));
1413
        config.setSimpleDetailsViewActivated(getValue(sectionMap, "simpleViewActivated"));
1424 1414

  
1425
    //        getPreferenceStore().setValue(SHOW_SIMPLE_NAME_DETAILS_TAXON,
1426
    //                (getValue(sectionMap, "taxon")));
1427 1415
            config.setTaxonSectionActivated(getValue(sectionMap, "taxon"));
1428 1416

  
1429
            config.setSecDetailsActivated(getValue(sectionMap, "taxon.SecEnabled"));
1430
            config.setSecEnabled(getValue(sectionMap, "taxon.SecDetails"));
1431

  
1432
    //        getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_LSID,
1433
    //                (getValue(sectionMap, "lsid")));
1434
            config.setLSIDActivated(getValue(sectionMap, "lsid"));
1417
        config.setSecDetailsActivated(getValue(sectionMap, "taxon.SecEnabled"));
1418
        config.setSecEnabled(getValue(sectionMap, "taxon.SecDetails"));
1435 1419

  
1436
    //        getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE,
1437
    //                (getValue(sectionMap, "nc")));
1438
            config.setNomenclaturalCodeActived(getValue(sectionMap, "nc"));
1420
        config.setLSIDActivated(getValue(sectionMap, "lsid"));
1439 1421

  
1440
    //        getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE,
1441
    //                (getValue(sectionMap, "ap")));
1442
            config.setAppendedPhraseActivated(getValue(sectionMap, "ap"));
1422
        config.setNomenclaturalCodeActived(getValue(sectionMap, "nc"));
1443 1423

  
1444
    //        getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_RANK,
1445
    //                (getValue(sectionMap, "rank")));
1446
            config.setRankActivated(getValue(sectionMap, "rank"));
1424
        config.setAppendedPhraseActivated(getValue(sectionMap, "ap"));
1447 1425

  
1426
        config.setRankActivated(getValue(sectionMap, "rank"));
1448 1427

  
1449
    //        getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS,
1450
    //                (getValue(sectionMap, "atomisedEpithets")));
1451
            config.setAtomisedEpithetsActivated(getValue(sectionMap, "atomisedEpithets"));
1428
        config.setAtomisedEpithetsActivated(getValue(sectionMap, "atomisedEpithets"));
1452 1429

  
1453
    //        getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_AUTHORSHIP,
1454
    //                (getValue(sectionMap,"author")));
1455
            config.setAuthorshipSectionActivated(getValue(sectionMap,"author"));
1430
        config.setAuthorshipSectionActivated(getValue(sectionMap,"author"));
1456 1431

  
1457
    //        getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE,
1458
    //                (getValue(sectionMap, "nomRef")));
1459
            config.setNomenclaturalReferenceSectionActivated(sectionMap.get("nomRef"));
1432
        config.setNomenclaturalReferenceSectionActivated(sectionMap.get("nomRef"));
1460 1433

  
1461
    //        getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS,
1462
    //                (getValue(sectionMap, "nomStat")));
1463
            config.setNomenclaturalStatusSectionActivated(getValue(sectionMap, "nomStat"));
1434
        config.setNomenclaturalStatusSectionActivated(getValue(sectionMap, "nomStat"));
1464 1435

  
1436
        config.setProtologueActivated(getValue(sectionMap,"protologue"));
1465 1437

  
1466
    //        getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_PROTOLOGUE,
1467
    //                (getValue(sectionMap,"protologue")));
1468
            config.setProtologueActivated(getValue(sectionMap,"protologue"));
1438
        config.setTypeDesignationSectionActivated(getValue(sectionMap,"typeDes"));
1469 1439

  
1470
    //        getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION,
1471
    //                (getValue(sectionMap,"typeDes")));
1472
            config.setTypeDesignationSectionActivated(getValue(sectionMap,"typeDes"));
1440
        config.setNameRelationsSectionActivated(getValue(sectionMap,"nameRelation"));
1473 1441

  
1474
    //        getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP,
1475
    //                (getValue(sectionMap,"nameRelation")));
1476
            config.setNameRelationsSectionActivated(getValue(sectionMap,"nameRelation"));
1477

  
1478
    //        getPreferenceStore().setValue(SHOW_NAME_DETAILS_SECTION_HYBRID,
1479
    //                (getValue(sectionMap, "hybrid")));
1480 1442
            config.setHybridActivated(getValue(sectionMap,"hybrid"));
1481
        }else{
1482
            config.setSimpleDetailsViewActivated(getBooleanValue(SHOW_SIMPLE_NAME_DETAILS_SECTION));
1483
            config.setTaxonSectionActivated(getBooleanValue(SHOW_SIMPLE_NAME_DETAILS_TAXON));
1484
            config.setSecDetailsActivated(getBooleanValue(SHOW_SEC_DETAILS));
1485
            config.setSecEnabled(getBooleanValue(DISABLE_SEC));
1486
            config.setLSIDActivated(getBooleanValue(SHOW_NAME_DETAILS_SECTION_LSID));
1487
            config.setNomenclaturalCodeActived(getBooleanValue(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE));
1488
            config.setAppendedPhraseActivated(getBooleanValue(SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE));
1489
            config.setRankActivated(getBooleanValue(SHOW_NAME_DETAILS_SECTION_RANK));
1490
            config.setAtomisedEpithetsActivated(getBooleanValue(SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS));
1491
            config.setAuthorshipSectionActivated(getBooleanValue(SHOW_NAME_DETAILS_SECTION_AUTHORSHIP));
1492
            config.setNomenclaturalReferenceSectionActivated(getBooleanValue(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE));
1493
            config.setNomenclaturalStatusSectionActivated(getBooleanValue(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS));
1494
            config.setProtologueActivated(getBooleanValue(SHOW_NAME_DETAILS_SECTION_PROTOLOGUE));
1495
            config.setTypeDesignationSectionActivated(getBooleanValue(SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION));
1496
            config.setNameRelationsSectionActivated(getBooleanValue(SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP));
1497
            config.setHybridActivated(getBooleanValue(SHOW_NAME_DETAILS_SECTION_HYBRID));
1498
        }
1443

  
1499 1444
        return config;
1500 1445
    }
1501 1446

  
......
1508 1453
        CdmPreference preference = null;
1509 1454

  
1510 1455
        if (!local) {
1511
            preference = CdmPreference.NewInstance(PreferenceSubject.NewDatabaseInstance(), EditorPreferencePredicate.NameDetailsView, config.toString());
1456
            preference = CdmPreference.NewInstance(PreferenceSubject.NewTaxEditorInstance(), EditorPreferencePredicate.NameDetailsView, config.toString());
1512 1457

  
1513 1458
            setPreferenceToDB(preference);
1514 1459
        }
1515
        //also add to local preferences
1516
        setBooleanValue(SHOW_SIMPLE_NAME_DETAILS_SECTION, config.isSimpleDetailsViewActivated());
1517
        setBooleanValue(SHOW_SIMPLE_NAME_DETAILS_TAXON, config.isTaxonSectionActivated());
1518
        setBooleanValue(SHOW_SEC_DETAILS, config.isSecDetailsActivated());
1519
        setBooleanValue(DISABLE_SEC, config.isSecEnabled());
1520
        setBooleanValue(SHOW_NAME_DETAILS_SECTION_LSID, config.isLSIDActivated());
1521
        setBooleanValue(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE, config.isNomenclaturalCodeActived());
1522
        setBooleanValue(SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE, config.isAppendedPhraseActivated());
1523
        setBooleanValue(SHOW_NAME_DETAILS_SECTION_RANK, config.isRankActivated());
1524
        setBooleanValue(SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS, config.isAtomisedEpithetsActivated());
1525
        setBooleanValue(SHOW_NAME_DETAILS_SECTION_AUTHORSHIP, config.isAuthorshipSectionActivated());
1526
        setBooleanValue(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE, config.isNomenclaturalReferenceSectionActivated());
1527
        setBooleanValue(SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS, config.isNomenclaturalStatusSectionActivated());
1528
        setBooleanValue(SHOW_NAME_DETAILS_SECTION_PROTOLOGUE, config.isProtologueActivated());
1529
        setBooleanValue(SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION, config.isTypeDesignationSectionActivated());
1530
        setBooleanValue(SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP, config.isNameRelationsSectionActivated());
1531
        setBooleanValue(SHOW_NAME_DETAILS_SECTION_HYBRID, config.isHybridActivated());
1460
        else{
1461
            setStringValue(EditorPreferencePredicate.NameDetailsView.getKey(), config.toString());
1462
        }
1463

  
1532 1464

  
1533 1465
    }
1534 1466

  
......
1682 1614
    }
1683 1615

  
1684 1616

  
1685
    /**
1686
    *
1687
    */
1688
   public NameDetailsConfigurator createLocalNameDetailsViewConfig(boolean local) {
1689
       NameDetailsConfigurator config = new NameDetailsConfigurator(true);
1690
       if (local){
1691
          config.setSimpleDetailsViewActivated(getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION));
1692
          config.setAppendedPhraseActivated(getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE));
1693
          config.setAtomisedEpithetsActivated(getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS));
1694
          config.setAuthorshipSectionActivated(getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP));
1695
          config.setLSIDActivated(getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_LSID));
1696
          config.setNameApprobiationActivated(getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_APPROBATION));
1697
          config.setNameCacheActivated(getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_CACHE));
1698
          config.setNameRelationsSectionActivated(getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP));
1699
          config.setNomenclaturalCodeActived(getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE));
1700
          config.setNomenclaturalStatusSectionActivated(getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS));
1701
          config.setNomenclaturalReferenceSectionActivated(getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE));
1702
          config.setProtologueActivated(getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_PROTOLOGUE));
1703
          config.setRankActivated(getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_RANK));
1704
          config.setTaxonSectionActivated(getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_TAXON));
1705
          config.setTypeDesignationSectionActivated(getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION));
1706
          config.setHybridActivated(getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_HYBRID));
1707
       }else{
1708

  
1709
       }
1710

  
1711
      return config;
1712
   }
1713

  
1714

  
1715
   public static void saveConfigToPrefernceStore(NameDetailsConfigurator config) {
1716
       setBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION,
1717
               config.isSimpleDetailsViewActivated());
1718
       setBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_TAXON, config.isTaxonSectionActivated());
1719
       setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_LSID, config.isLSIDActivated());
1720
       setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE,
1721
               config.isNomenclaturalCodeActived());
1722
       setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAMECACHE,
1723
               config.isNameCacheActivated());
1724
       setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_APPENDED_PHRASE,
1725
               config.isAppendedPhraseActivated());
1726
       setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_RANK, config.isRankActivated());
1727
       setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_ATOMISED_EPITHETS,
1728
               config.isAtomisedEpithetsActivated());
1729
       setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE,
1730
               config.isAuthorCacheActivated());
1731
       setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP,
1732
               config.isAuthorshipSectionActivated());
1733
       setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE,
1734
               config.isNomenclaturalReferenceSectionActivated());
1735
       setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS,
1736
               config.isNomenclaturalStatusSectionActivated());
1737
       setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_PROTOLOGUE,
1738
               config.isProtologueActivated());
1739
       setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION,
1740
               config.isTypeDesignationSectionActivated());
1741
       setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP,
1742
               config.isNameRelationsSectionActivated());
1743
       setBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_HYBRID,
1744
               config.isHybridActivated());
1745

  
1746
   }
1617

  
1618

  
1619

  
1620

  
1747 1621

  
1748 1622
/**
1749 1623
 * @return
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractIdentifiableEntityDetailElement.java
9 9
import eu.etaxonomy.cdm.model.common.CdmBase;
10 10
import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
11 11
import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
12
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
13
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
14 12
import eu.etaxonomy.taxeditor.store.CdmStore;
15 13
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
16 14
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
......
28 26
     */
29 27
    private static final EnumSet<CRUD> UPDATE = EnumSet.of(CRUD.UPDATE);
30 28
    protected ToggleableTextElement toggleable_cache;
31
    protected boolean isAdvancedView ;
29

  
32 30

  
33 31
    public AbstractIdentifiableEntityDetailElement(CdmFormFactory formFactory, ICdmFormElement formElement) {
34 32
        super(formFactory, formElement);
35 33
        updateToggleableCacheState();
36
        initIsAdvancedDetailsView();
34

  
37 35

  
38 36
    }
39 37

  
......
67 65
            toggleable_cache.setEnabled(getEntity() != null && CdmStore.currentAuthentiationHasPermission((CdmBase) getEntity(), UPDATE));
68 66
        }
69 67
    }
70
    protected void initIsAdvancedDetailsView(){
71
        if(PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION)){
72
            isAdvancedView = false;
73
        } else{
74
            isAdvancedView = true;
75
        }
76
    }
68

  
77 69

  
78 70

  
79 71
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/AuthorshipDetailElement.java
18 18
import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
19 19
import eu.etaxonomy.taxeditor.event.EventUtility;
20 20
import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
21
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
21
import eu.etaxonomy.taxeditor.preference.NameDetailsConfigurator;
22 22
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
23 23
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
24 24
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
......
69 69
	@Override
70 70
	protected void createControls(ICdmFormElement formElement,
71 71
			INonViralName entity, int style) {
72
	    if (isAdvancedView || PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP_CACHE)){
72
	    NameDetailsConfigurator config = PreferencesUtil.getPreferredNameDetailsConfiguration(true);
73
	    if (!config.isSimpleDetailsViewActivated() || config.isAuthorCacheActivated()){
73 74
	        toggleable_cache = formFactory.createToggleableTextField(this,
74 75
				"Authorship Cache", entity.getAuthorshipCache(),
75 76
				entity.isProtectedAuthorshipCache(), style);
......
77 78
	   }
78 79
	    NomenclaturalCode code = entity.getNomenclaturalCode();
79 80

  
80
	    if (isAdvancedView || PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_AUTHORSHIP)){
81
	    if (!config.isSimpleDetailsViewActivated() || config.isAuthorshipSectionActivated()){
81 82
            selectionCombinationAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class,
82 83
    				getConversationHolder(),
83 84
    				formElement, "Author",
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameDetailElement.java
98 98

  
99 99
		};
100 100
		}
101
	    if (isAdvancedView){
101
	    if (!config.isSimpleDetailsViewActivated()){
102 102
	    	toggleable_cache = formFactory.createToggleableTextField(this, "Name Cache", nonViralName.getNameCache(), nonViralName.isProtectedNameCache(), style);
103 103

  
104 104
	    	combo_rank = formFactory.createDefinedTermComboElement(TermType.Rank, this, "Rank", nonViralName.getRank(), style, comparator);
......
158 158
		if (toggleable_cache != null){
159 159
		    toggleable_cache.setEnabled(getEntity().isProtectedNameCache());
160 160

  
161
    		if (isAdvancedView){
161
    		if (!config.isSimpleDetailsViewActivated()){
162 162
        		if(isIrrelevant()){
163 163
        			setIrrelevant(isIrrelevant());
164 164
        		}else{
......
179 179
				createBotanicalNameParts(formElement, nonViralName, style);
180 180
				break;
181 181
			case Fungi :
182
				if (isAdvancedView){
182
				if (!config.isSimpleDetailsViewActivated()){
183 183
					createFungusNameParts(formElement, nonViralName, style);
184 184
				}
185 185
				break;
......
230 230
	private void createZoologicalNameParts(ICdmFormElement formElement, INonViralName nonViralName, int style){
231 231
		IZoologicalName zoologicalName = (IZoologicalName) nonViralName;
232 232

  
233
		if (isAdvancedView){
233
		if (!config.isSimpleDetailsViewActivated()){
234 234
		    text_breed = formFactory.createTextWithLabelElement(formElement, "Breed", zoologicalName.getBreed(), style);
235 235
		}
236 236
	}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameDetailElement.java
18 18
import eu.etaxonomy.cdm.model.name.TaxonName;
19 19
import eu.etaxonomy.taxeditor.l10n.Messages;
20 20
import eu.etaxonomy.taxeditor.model.MessagingUtils;
21
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
21
import eu.etaxonomy.taxeditor.preference.NameDetailsConfigurator;
22 22
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
23 23
import eu.etaxonomy.taxeditor.store.StoreUtil;
24 24
import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
......
43 43
	private HybridDetailSection section_hybrid;
44 44
	private LsidWithExceptionLabelElement textLsid;
45 45
	private TextWithLabelElement text_nameApprobation;
46

  
46
	//protected boolean isAdvancedView ;
47 47

  
48 48
	public NonViralNameDetailElement(CdmFormFactory formFactory,
49 49
			ICdmFormElement formElement) {
50 50
		super(formFactory, formElement);
51
		initIsAdvancedDetailsView();
52 51

  
53 52
	}
54 53

  
55 54
	/** {@inheritDoc} */
56 55
	@Override
57 56
    protected void createControls(ICdmFormElement formElement, final TaxonName entity, int style) {
57
	    NameDetailsConfigurator config = PreferencesUtil.getPreferredNameDetailsConfiguration(true);
58 58

  
59

  
60
        if (isAdvancedView){
59
        if (!config.isSimpleDetailsViewActivated() ){
61 60
            toggleable_cache = formFactory.createToggleableTextField(formElement, "Cache", entity.getTitleCache(), entity.isProtectedTitleCache() || entity.isProtectedFullTitleCache(), style);
62 61

  
63 62
            combo_nomenclaturalCode = formFactory.createEnumComboElement(NomenclaturalCode.class, formElement, style);
......
69 68

  
70 69

  
71 70
        }else{
72
        	if (PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_CACHE)){
71
        	if (config.isNameCacheActivated()){
73 72
        		toggleable_cache = formFactory.createToggleableTextField(formElement, "Cache", entity.getTitleCache(), entity.isProtectedTitleCache() || entity.isProtectedFullTitleCache(), style);
74 73

  
75 74
          	}
76
        	if (PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_CODE)){
75
        	if (config.isNomenclaturalCodeActived()){
77 76
        		combo_nomenclaturalCode = formFactory.createEnumComboElement(NomenclaturalCode.class, formElement, style);
78 77
        		combo_nomenclaturalCode.setSelection(entity.getNomenclaturalCode());
79 78
        	}
80 79
        	if (entity.getNameType().equals(NomenclaturalCode.ICNB)){
81
        		if (PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_APPROBATION)){
80
        		if (config.isNameApprobiationActivated()){
82 81
    			 text_nameApprobation = formFactory.createTextWithLabelElement(formElement, "Name Approbation", entity.getNameApprobation(),style);
83 82
        		}
84 83
        	}
85 84

  
86
        	if (PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_LSID)){
85
        	if (config.isLSIDActivated()){
87 86
        		textLsid = formFactory.createLsidWithExceptionLabelElement(formElement, "Lsid", entity.getLsid(), style);
88 87

  
89 88
        	}
......
103 102
    	    addElement(section_author);
104 103
//	    }
105 104
	    //TODO RL
106
	    if (isAdvancedView || PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_HYBRID)){
105
	    if (config.isHybridActivated()){
107 106
    	   section_hybrid = formFactory.createHybridDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
108 107
    	   section_hybrid.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
109 108
    	   addControl(section_hybrid);
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonBaseDetailElement.java
20 20
import eu.etaxonomy.cdm.model.taxon.Taxon;
21 21
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
22 22
import eu.etaxonomy.cdm.persistence.hibernate.permission.Role;
23
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
23
import eu.etaxonomy.taxeditor.preference.NameDetailsConfigurator;
24 24
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
25 25
import eu.etaxonomy.taxeditor.store.CdmStore;
26 26
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
......
63 63
	@Override
64 64
	protected void createControls(ICdmFormElement formElement, TaxonBase entity, int style) {
65 65

  
66
	    NameDetailsConfigurator config = PreferencesUtil.getPreferredNameDetailsConfiguration(true);
66 67
		toggleable_cache = formFactory.createToggleableTextField(formElement,
67 68
					"Title Cache", entity.getTitleCache(),
68 69
					entity.isProtectedTitleCache(), style);
......
78 79
				 formElement, "Secundum",
79 80
				entity.getSec(), EntitySelectionElement.ALL,
80 81
				style);
81
		if (!PreferencesUtil.getBooleanValue(IPreferenceKeys.DISABLE_SEC)){
82
		if (!config.isSecEnabled() && config.isSimpleDetailsViewActivated()){
82 83
		    selection_secundum.setEnabled(false);
83 84
		}
84
		if (PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SEC_DETAILS)){
85
		if (config.isSecDetailsActivated() || !config.isSimpleDetailsViewActivated()){
85 86
    		text_secundum_microreference = formFactory.createTextWithLabelElement(
86 87
                    formElement, "Detail",
87 88
                   entity.getSecMicroReference(),null,
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/details/DetailsViewerE4.java
64 64
import eu.etaxonomy.taxeditor.model.IDerivedUnitFacadePart;
65 65
import eu.etaxonomy.taxeditor.model.MessagingUtils;
66 66
import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship;
67
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
67
import eu.etaxonomy.taxeditor.preference.NameDetailsConfigurator;
68 68
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
69 69
import eu.etaxonomy.taxeditor.store.UsageTermCollection;
70 70
import eu.etaxonomy.taxeditor.ui.element.RootElement;
......
423 423
    }
424 424

  
425 425
    private void createTaxonSections(RootElement parent) {
426
        NameDetailsConfigurator config = PreferencesUtil.getPreferredNameDetailsConfiguration(true);
426 427
        ParsingMessagesSection parsingMessagesSection = formFactory.createParsingMessagesSection(getConversationHolder(), parent, this,
427 428
                getSectionStyle(ParsingMessagesSection.class, true));
428
        if (!PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION)){
429
        if (!config.isSimpleDetailsViewActivated()){
429 430
            TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this,
430 431
                    getSectionStyle(TaxonBaseDetailSection.class, true));
431 432
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
432 433
            addPart(taxonBaseDetailSection);
433 434
        }else{
434
            if (PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_TAXON)){
435
            if (config.isTaxonSectionActivated()){
435 436
                TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this,
436 437
                        getSectionStyle(TaxonBaseDetailSection.class, true));
437 438
                formFactory.createHorizontalSeparator(parent, SWT.BORDER);
......
442 443
                .createNonViralNameDetailSection(getConversationHolder(), parent, this, true,
443 444
                        getSectionStyle(NonViralNameDetailSection.class, true));
444 445
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
445
        if (!PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) || (PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) && PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE))){
446
        if (!config.isSimpleDetailsViewActivated() || (config.isSimpleDetailsViewActivated() && config.isNomenclaturalReferenceSectionActivated())){
446 447
            NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
447 448
                    getSectionStyle(NomenclaturalReferenceDetailSection.class, true));
448 449
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
449 450
            addPart(referenceDetailSection);
450 451

  
451 452
        }
452
        if ( !PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) || (PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) && PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS))){
453
        if ( !config.isSimpleDetailsViewActivated() || (config.isSimpleDetailsViewActivated() && config.isNomenclaturalStatusSectionActivated())){
453 454
            NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
454 455
                    getSectionStyle(NomenclaturalStatusSection.class, true));
455 456
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
456 457
            addPart(nomenclaturalStatusSection);
457 458
        }
458 459

  
459
        if (!PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) || (PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) && PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_PROTOLOGUE))){
460
        if ( !config.isSimpleDetailsViewActivated() || (config.isSimpleDetailsViewActivated() && config.isProtologueActivated())){
460 461
            ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, getSectionStyle(ProtologueSection.class));
461 462
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
462 463
            addPart(protologSection);
463 464
        }
464 465

  
465
        if (!PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) || (PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) &&  PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION))){
466
        if (!config.isSimpleDetailsViewActivated() || (config.isSimpleDetailsViewActivated() && config.isTypeDesignationSectionActivated())){
466 467
            TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, getSectionStyle(TypeDesignationSection.class));
467 468
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
468 469
            addPart(typeDesignationSection);
469 470
        }
470 471

  
471
        if (!PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) || (PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) && PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP))){
472
        if (!config.isSimpleDetailsViewActivated() || (config.isSimpleDetailsViewActivated() &&config.isNameRelationsSectionActivated())){
472 473
            NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, getSectionStyle(NameRelationshipDetailSection.class));
473 474
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
474 475
            addPart(nameRelationshipSection);
......
877 878
        if(refresh){
878 879
            refresh();
879 880

  
880
//            setSelection(getSelection(), true);
881 881
        }
882 882
    }
883 883

  

Also available in: Unified diff