Project

General

Profile

« Previous | Next » 

Revision e1dfd329

Added by Katja Luther over 4 years ago

ref #8389: disable allowOverride when 'use default' is selected

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/SupplementalDataSourcePreferences.java
75 75
        if (isAdminPreference){
76 76
            allowOverrideIDSourceButton = createAllowOverrideButton(composite);
77 77
            allowOverrideIDSourceButton.setSelection(isAllowOverrideShowIDSource);
78
            allowOverrideIDSourceButton.setEnabled(isShowIDSource != null);
78 79
            allowOverrideIDSourceButton.addSelectionListener(new SelectionAdapter(){
79 80
                @Override
80 81
                public void widgetSelected(SelectionEvent e) {
......
100 101
            allowOverrideShowIDNamespaceButton = createAllowOverrideButton(composite);
101 102

  
102 103
            allowOverrideShowIDNamespaceButton.setSelection(isAllowOverrideShowIDNamespace);
104
            allowOverrideShowIDNamespaceButton.setEnabled(isShowIDNamespace != null);
103 105
            allowOverrideShowIDNamespaceButton.addSelectionListener(new SelectionAdapter(){
104 106
                @Override
105 107
                public void widgetSelected(SelectionEvent e) {
......
165 167
        if (e.getSource().equals(this.showIDNamespaceButton)) {
166 168
            String text = showIDNamespaceButton.getText();
167 169
           // text = text.replace(Messages.Preference_Use_Default, "");
168
            if (text.equals(Messages.Preference_Use_Default)){
170
            if (text.startsWith(Messages.Preference_Use_Default)){
171
                isShowIDNamespace = null;
169 172
                isOverrideShowIDNamespace = false;
170 173
            }else{
171 174
                isOverrideShowIDNamespace = true;
172
            }
173
            if (text.equals(SHOW)){
174
                isShowIDNamespace = true;
175
                if (text.equals(SHOW)){
176
                    isShowIDNamespace = true;
175 177

  
176
            }else{
177
                isShowIDNamespace = false;
178
                }else{
179
                    isShowIDNamespace = false;
180
                }
178 181
            }
182

  
183
            allowOverrideShowIDNamespaceButton.setEnabled(isShowIDNamespace != null);
179 184
        }
180 185
        if (e.getSource().equals(this.showIDSourceButton)) {
181 186
            String text = showIDSourceButton.getText();
182
            if (text.equals(Messages.Preference_Use_Default)){
187
            if (text.startsWith(Messages.Preference_Use_Default)){
188
                isShowIDSource = null;
183 189
                isOverrideShowIDSource = false;
184 190
            }else{
185 191
                isOverrideShowIDSource = true;
192
                if (text.equals(SHOW)){
193
                    isShowIDSource = true;
194
                }else{
195
                    isShowIDSource = false;
196
                }
186 197
            }
187
            if (text.equals(SHOW)){
188
                isShowIDSource = true;
189
            }else{
190
                isShowIDSource = false;
191
            }
198

  
199
            allowOverrideIDSourceButton.setEnabled(isShowIDSource != null);
192 200
        }
193 201

  
194 202
        this.setApply(true);
......
208 216
        if (isAdminPreference){
209 217
            allowOverrideIDSourceButton.setSelection(true);
210 218
            allowOverrideShowIDNamespaceButton.setSelection(true);
219
            allowOverrideIDSourceButton.setEnabled(false);
220
            allowOverrideShowIDNamespaceButton.setEnabled(false);
211 221
        }
212 222

  
213 223
        showIDSourceButton.select(0);

Also available in: Unified diff