Project

General

Profile

Revision 57d3d692

ID57d3d692b85d236c70138e845b26c80e25d4701b
Parent e4a9f18a
Child e398666b

Added by Katja Luther about 1 year ago

ref bug #7999: fix NPEs in preferences pages

View differences:

eu.etaxonomy.taxeditor.store/plugin.xml
577 577
         id="eu.etaxonomy.taxeditor.preferences.generalPreferences"
578 578
         name="%page.name.50">
579 579
   </page>
580
   <page
580
 <!--  <page
581 581
         category="eu.etaxonomy.taxeditor.preferences.namePreferences"
582 582
         class="eu.etaxonomy.taxeditor.preference.NameDetailsViewConfiguration"
583 583
         id="eu.etaxonomy.taxeditor.preferences.nameDetails"
584 584
         name="%page.name.36">
585
   </page>
585
   </page>-->
586 586
   <page
587 587
         category="eu.etaxonomy.taxeditor.preference.UIPreferences"
588 588
         class="eu.etaxonomy.taxeditor.preference.NameDetailsViewConfiguration"
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/ChecklistEditorGeneralPreference.java
519 519
        if (pref != null){
520 520
            this.allowOverrideAreaDisplay = pref.isAllowOverride();
521 521
            if (allowOverrideAreaDisplay){
522
                displayArea = PreferencesUtil.getStringValue(EditorPreferencePredicate.DisplayOfAreasInDistributionEditor.getKey());
522
                displayArea = PreferencesUtil.displayAreaInChecklistEditor();
523 523
            }else{
524 524
                displayArea = pref.getValue();
525 525
            }
526 526
        }else{
527
            displayArea = PreferencesUtil.getStringValue(EditorPreferencePredicate.DisplayOfAreasInDistributionEditor.getKey());
527
            displayArea = PreferencesUtil.displayAreaInChecklistEditor();;
528 528
            this.allowOverrideAreaDisplay = true;
529 529
        }
530 530

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java
1359 1359
    /**
1360 1360
     * @return
1361 1361
     */
1362
    public static String displayAreaInChecklistEditor() {
1363
        String result = getStringValue(EditorPreferencePredicate.DisplayOfAreasInDistributionEditor.getKey());
1364
        if (result == null){
1365
            return (String) EditorPreferencePredicate.DisplayOfAreasInDistributionEditor.getDefaultValue();
1366
        }
1367
       return result;
1368
    }
1369

  
1370
    /**
1371
     * @return
1372
     */
1362 1373
    public static String displayStatusInChecklistEditor() {
1363
       return getStringValue(EditorPreferencePredicate.DisplayOfStatus.getKey());
1374
        String result = getStringValue(EditorPreferencePredicate.DisplayOfStatus.getKey());
1375
        if (result == null){
1376
            return (String) EditorPreferencePredicate.DisplayOfStatus.getDefaultValue();
1377
        }
1378
       return result;
1364 1379
    }
1365 1380
    public static void setDisplayStatusInChecklistEditor(String selection) {
1366 1381
        setStringValue(EditorPreferencePredicate.DisplayOfStatus.getKey(), selection);
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AbstractAdminTermSelectionWizardPage.java
34 34
        super(pageName, type);
35 35
        this.pref = pref;
36 36

  
37
        this.override = this.pref.isAllowOverride();
37
        this.override = pref != null? this.pref.isAllowOverride(): true;
38 38
    }
39 39

  
40 40
    CdmPreference pref;

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)