Project

General

Profile

« Previous | Next » 

Revision 76e5b1e4

Added by Katja Luther over 5 years ago

correct handling of default values when fieldEditor is used

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/ExternalServicesPreferences.java
102 102

  
103 103
    }
104 104

  
105
    @Override
106
    public void createControl(Composite parent){
107
        super.createControl(parent);
108
        if (getApplyButton() != null){
109
            this.getApplyButton().setEnabled(true);
110
        }
111
    }
112

  
105 113
    @Override
106 114
    protected void performDefaults() {
107
        openUrl.presentsDefaultValue();
108
        maxHeight.presentsDefaultValue();
109
        maxWidth.presentsDefaultValue();
110
        mapService.presentsDefaultValue();
115
        openUrl.loadDefault();
116
        maxHeight.loadDefault();
117
        maxWidth.loadDefault();
118
        mapService.loadDefault();
111 119
        super.performDefaults();
112 120
    }
113 121

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/MediaPreferences.java
41 41
                top);
42 42
       advanced.setPreferenceStore(getPreferenceStore());
43 43
       advanced.load();
44

  
44 45
       Label mediaView = new Label(top, SWT.NULL);
45 46
       mediaView.setText("Media View");
46 47
       preview = new BooleanFieldEditor(PreferencesUtil.createPreferenceString(IPreferenceKeys.SHOW_MEDIA_PREVIEW),
......
48 49
                top);
49 50
       preview.setPreferenceStore(getPreferenceStore());
50 51
       preview.load();
52

  
51 53
       return top;
52 54

  
53 55
    }
54 56

  
57
    @Override
58
    public void createControl(Composite parent){
59
        super.createControl(parent);
60
        if (getApplyButton() != null){
61
            this.getApplyButton().setEnabled(true);
62
        }
63
    }
64

  
65
    @Override
66
    public boolean performOk() {
67
       advanced.store();
68
       preview.store();
69
       return super.performOk();
70

  
71
    }
55 72
    @Override
56 73
    protected void performDefaults() {
57
        advanced.presentsDefaultValue();
58
        preview.presentsDefaultValue();
74
        advanced.loadDefault();
75
        preview.loadDefault();
59 76
        super.performDefaults();
60 77
    }
61 78

  

Also available in: Unified diff