Project

General

Profile

« Previous | Next » 

Revision fbd932cc

Added by Katja Luther over 3 years ago

ref #7849: disable apply button until something was changed in preference page

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/AbcdImportPreference.java
135 135
            @Override
136 136
            public void widgetSelected(SelectionEvent e) {
137 137
                configurator.setAddMediaAsMediaSpecimen(!configurator.isAddMediaAsMediaSpecimen());
138
                setApply(true);
138 139
            }
139 140
        });
140 141

  
......
147 148
            @Override
148 149
            public void widgetSelected(SelectionEvent e) {
149 150
                configurator.setIgnoreImportOfExistingSpecimen(!configurator.isIgnoreImportOfExistingSpecimen());
151
                setApply(true);
150 152
            }
151 153
        });
152 154

  
......
159 161
            @Override
160 162
            public void widgetSelected(SelectionEvent e) {
161 163
                configurator.setIgnoreAuthorship(!configurator.isIgnoreAuthorship());
164
                setApply(true);
162 165
            }
163 166
        });
164 167

  
......
171 174
            @Override
172 175
            public void widgetSelected(SelectionEvent e) {
173 176
                configurator.setMapUnitIdToCatalogNumber(!configurator.isMapUnitIdToCatalogNumber());
177
                setApply(true);
174 178
            }
175 179
        });
176 180
//TODO: only one of the mappings can be checked!
......
183 187
            @Override
184 188
            public void widgetSelected(SelectionEvent e) {
185 189
                configurator.setMapUnitIdToAccessionNumber(!configurator.isMapUnitIdToAccessionNumber());
190
                setApply(true);
186 191
            }
187 192
        });
188 193

  
......
195 200
            @Override
196 201
            public void widgetSelected(SelectionEvent e) {
197 202
                configurator.setMapUnitIdToBarcode(!configurator.isMapUnitIdToBarcode());
203
                setApply(true);
198 204
            }
199 205
        });
200 206

  
......
207 213
            @Override
208 214
            public void widgetSelected(SelectionEvent e) {
209 215
                configurator.setRemoveCountryFromLocalityText(!configurator.isRemoveCountryFromLocalityText());
216
                setApply(true);
210 217
            }
211 218
        });
212 219

  
......
219 226
            @Override
220 227
            public void widgetSelected(SelectionEvent e) {
221 228
                configurator.setMoveNewTaxaToDefaultClassification(!configurator.isMoveNewTaxaToDefaultClassification());
229
                setApply(true);
222 230
            }
223 231
        });
224 232

  
......
231 239
            @Override
232 240
            public void widgetSelected(SelectionEvent e) {
233 241
                configurator.setGetSiblings(!configurator.isGetSiblings());
242
                setApply(true);
234 243
            }
235 244
        });
236 245

  
......
243 252
            @Override
244 253
            public void widgetSelected(SelectionEvent e) {
245 254
                configurator.setAddIndividualsAssociationsSuchAsSpecimenAndObservations(!configurator.isAddIndividualsAssociationsSuchAsSpecimenAndObservations());
255
                setApply(true);
246 256
            }
247 257
        });
248 258

  
......
255 265
            @Override
256 266
            public void widgetSelected(SelectionEvent e) {
257 267
                configurator.setReuseExistingDescriptiveGroups(!configurator.isReuseExistingDescriptiveGroups());
268
                setApply(true);
258 269
            }
259 270
        });
260 271

  
......
267 278
            @Override
268 279
            public void widgetSelected(SelectionEvent e) {
269 280
                configurator.setReuseExistingTaxaWhenPossible(!configurator.isReuseExistingTaxaWhenPossible());
281
                setApply(true);
270 282
            }
271 283
        });
272 284

  
......
285 297
            for (String label : nomenclaturalCodeSelectionCombo.getItems()){
286 298
                if (label.equals(configurator.getNomenclaturalCode().getKey())){
287 299
                    nomenclaturalCodeSelectionCombo.select(index);
300

  
288 301
                }
289 302
                index++;
290 303
            }
......
304 317
            @Override
305 318
            public void widgetSelected(SelectionEvent e) {
306 319
                allowOverride = !allowOverride;
320
                setApply(true);
307 321
            }
308 322
        });
309 323

  
......
313 327
    @Override
314 328
    public void widgetSelected(SelectionEvent e) {
315 329
        this.configurator.setNomenclaturalCode(NomenclaturalCode.getByKey(nomenclaturalCodeSelectionCombo.getText()));
316

  
330
        setApply(true);
317 331
    }
318 332

  
319 333
    @Override
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/AbcdImportProvider.java
45 45

  
46 46
        composite.setLayout(gridLayout);
47 47
        biocaseProviderList = new ListComponent(composite, SWT.SCROLL_LINE);
48

  
48
        setApply(true);
49 49
        return composite;
50 50
    }
51 51

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/DistributionAdminPreferences.java
60 60
        allowOverrideAreasCheckButton.addSelectionListener(new SelectionAdapter(){
61 61
            @Override
62 62
            public void widgetSelected(SelectionEvent e) {
63
                setApply(true);
63 64
                allowOverrideAreas = allowOverrideAreasCheckButton.getSelection();
64 65

  
65 66
            }
......
86 87
        allowOverrideStatusCheckButton.addSelectionListener(new SelectionAdapter(){
87 88
            @Override
88 89
            public void widgetSelected(SelectionEvent e) {
90
                setApply(true);
89 91
                allowOverrideStatus = allowOverrideStatusCheckButton.getSelection();
90 92

  
91 93
            }
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/NomenclaturalCodePreferences.java
97 97
        nomenclaturalCode.addSelectionListener(new SelectionAdapter() {
98 98
            @Override
99 99
            public void widgetSelected(SelectionEvent evt) {
100
                setApply(true);
100 101
                String name = nomenclaturalCode.getText();
101 102
                for (Entry<String, String> label:labelAndValues.entrySet()){
102 103
                    if (label.getValue().equals(name)){
103 104
                        actualCode = label.getKey();
104 105
                    }
105 106
                }
106
//                actualCode = labelAndValues.get(name);;
107

  
108

  
109 107
            }
110 108
        });
111 109
        Button allowOverrideButton = createAllowOverrideButton(composite);
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/PublishFlagPreference.java
10 10

  
11 11
import org.eclipse.swt.SWT;
12 12
import org.eclipse.swt.custom.CLabel;
13
import org.eclipse.swt.events.SelectionEvent;
14
import org.eclipse.swt.events.SelectionListener;
13 15
import org.eclipse.swt.layout.GridData;
14 16
import org.eclipse.swt.layout.GridLayout;
15 17
import org.eclipse.swt.widgets.Combo;
......
67 69
        gridData.horizontalIndent = 5;
68 70

  
69 71
        publishFlagBehaviour = new Combo(composite, SWT.BORDER| SWT.READ_ONLY);
72
        publishFlagBehaviour.addSelectionListener(new SelectionListener() {
73

  
74
            @Override
75
            public void widgetSelected(SelectionEvent e) {
76
                setApply(true);
77
            }
78

  
79
            @Override
80
            public void widgetDefaultSelected(SelectionEvent e) {
81
                // TODO Auto-generated method stub
82

  
83
            }
84
        });
70 85
        publishFlagBehaviour.setLayoutData(gridData);
71 86

  
72 87
        for(PublishEnum display: PublishEnum.values()){
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/SpecimenAdminPreferences.java
32 32
    Composite composite;
33 33
    CdmPreference showSpecimenPref = null;
34 34

  
35
//    @Override
36
//    protected Control createContents(Composite parent) {
37
//
38
//        getValues();
39
//        composite = createComposite(parent);
40
//        composite.setEnabled(isShowSpecimenRelatedIssues);
41
//        final Button showSpecimenButton = new Button(parent, SWT.CHECK);
42
//
43
//        showSpecimenButton.setText(Messages.DatabasePreferncesPage_Show_Specimen);
44
//
45
//        showSpecimenButton.setSelection(isShowSpecimenRelatedIssues);
46
//        showSpecimenButton.addSelectionListener(new SelectionAdapter(){
47
//             @Override
48
//             public void widgetSelected(SelectionEvent e) {
49
//                 isShowSpecimenRelatedIssues = showSpecimenButton.getSelection();
50
//                 if(isShowSpecimenRelatedIssues){
51
//                     composite.setVisible(true);
52
//                     composite.setEnabled(true);
53
//                 }else{
54
//                     composite.setVisible(false);
55
//                     composite.setEnabled(false);
56
//                 }
57
//              }
58
//         });
59
//        if (isAdminPreference){
60
//            createAllowOverrideButton(parent);
61
//        }
62
//
63
//        GridData gridData = createTextGridData();
64
//
65
//        Label separator= new Label(composite, SWT.HORIZONTAL | SWT.SEPARATOR);
66
//        separator.setLayoutData(gridData);
67
//
68
//        final Button showCollectingAreaInGeneralSectionButton = new Button(composite, SWT.CHECK);
69
//
70
//        showCollectingAreaInGeneralSectionButton.setText(Messages.DatabasePreferncesPage_Show_Collecting_Areas_in_general_section);
71
//
72
//        showCollectingAreaInGeneralSectionButton.setSelection(isShowCollectingAreaInGeneralSection);
73
//        showCollectingAreaInGeneralSectionButton.addSelectionListener(new SelectionAdapter(){
74
//             @Override
75
//             public void widgetSelected(SelectionEvent e) {
76
//                 isShowCollectingAreaInGeneralSection = showCollectingAreaInGeneralSectionButton.getSelection();
77
//
78
//              }
79
//         });
80
//
81
//        if (isAdminPreference){
82
//            createAllowOverrideButton(composite);
83
//        }
84
//        final Button determinationOnlyForFieldUnitsButton = new Button(composite, SWT.CHECK);
85
//
86
//        determinationOnlyForFieldUnitsButton.setText(Messages.DatabasePreferncesPage_Determination_only_for_field_unnits);
87
//
88
//        determinationOnlyForFieldUnitsButton.setSelection(isDeterminationOnlyForFieldUnits);
89
//        determinationOnlyForFieldUnitsButton.addSelectionListener(new SelectionAdapter(){
90
//             @Override
91
//             public void widgetSelected(SelectionEvent e) {
92
//                 isDeterminationOnlyForFieldUnits = determinationOnlyForFieldUnitsButton.getSelection();
93
//             }
94
//         });
95
//        if (isAdminPreference){
96
//            createAllowOverrideButton(composite);
97
//        }
98
//
99
//        final Button showTaxonAssociationButton = new Button(composite, SWT.CHECK);
100
//
101
//        showTaxonAssociationButton.setText(Messages.DatabasePreferncesPage_Taxon_Associations);
102
//
103
//        showTaxonAssociationButton.setSelection(isShowTaxonAssociation);
104
//        showTaxonAssociationButton.addSelectionListener(new SelectionAdapter(){
105
//             @Override
106
//             public void widgetSelected(SelectionEvent e) {
107
//                 isShowTaxonAssociation = showTaxonAssociationButton.getSelection();
108
//
109
//              }
110
//         });
111
//
112
//        if (isAdminPreference){
113
//            createAllowOverrideButton(composite);
114
//        }
115
//
116
//        final Button showLifeFormButton = new Button(composite, SWT.CHECK);
117
//        showLifeFormButton.setText(Messages.DatabasePreferncesPage_Life_Form);
118
//        showLifeFormButton.setSelection(isShowLifeForm);
119
//        showLifeFormButton.addSelectionListener(new SelectionAdapter(){
120
//             @Override
121
//             public void widgetSelected(SelectionEvent e) {
122
//                 isShowLifeForm = showLifeFormButton.getSelection();
123
//
124
//              }
125
//         });
126
//        if (isAdminPreference){
127
//            createAllowOverrideButton(composite);
128
//        }
129
//
130
//
131
//        return composite;
132
//    }
133

  
134 35
    @Override
135 36
    public void init() {
136 37
        super.init();
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/VocabularyAdminPreferences.java
68 68
        allowOverrideCommonNameAreaCheckButton.addSelectionListener(new SelectionAdapter(){
69 69
            @Override
70 70
            public void widgetSelected(SelectionEvent e) {
71
                setApply(true);
71 72
                allowOverride = allowOverrideCommonNameAreaCheckButton.getSelection();
72 73

  
73 74
            }
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/ChecklistEditorGeneralPreference.java
19 19
import org.eclipse.swt.widgets.Combo;
20 20
import org.eclipse.swt.widgets.Composite;
21 21
import org.eclipse.swt.widgets.Control;
22
import org.eclipse.swt.widgets.Event;
22 23
import org.eclipse.swt.widgets.Label;
24
import org.eclipse.swt.widgets.Listener;
23 25

  
24 26
import eu.etaxonomy.cdm.model.metadata.CdmPreference;
25 27
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
......
84 86
            activateCheckButton.addSelectionListener(new SelectionAdapter(){
85 87
                @Override
86 88
                public void widgetSelected(SelectionEvent e) {
89
                    setApply(true);
87 90
                    isEditorActivated = activateCheckButton.getSelection();
88 91
                    if(!isAdminPreference){
89 92
                        overrideActivated = true;
......
105 108
                allowOverrideActivatedButton.addSelectionListener(new SelectionAdapter(){
106 109
                    @Override
107 110
                    public void widgetSelected(SelectionEvent e) {
111
                        setApply(true);
108 112
                        allowOverrideActivated = allowOverrideActivatedButton.getSelection();
109 113
                    }
110 114
                });
......
113 117
                allowOverrideActivatedButton.addSelectionListener(new SelectionAdapter(){
114 118
                    @Override
115 119
                    public void widgetSelected(SelectionEvent e) {
120
                        setApply(true);
116 121
                        overrideActivated = allowOverrideActivatedButton.getSelection();
117 122
                    }
118 123
                });
......
136 141
            activateRankButton.addSelectionListener(new SelectionAdapter(){
137 142
                @Override
138 143
                public void widgetSelected(SelectionEvent e) {
144
                    setApply(true);
139 145
                    isShowRank = activateRankButton.getSelection();
140 146
                }
141 147
            });
......
145 151
                allowOverrideRankButton.addSelectionListener(new SelectionAdapter(){
146 152
                    @Override
147 153
                    public void widgetSelected(SelectionEvent e) {
154
                        setApply(true);
148 155
                        allowOverrideRank = allowOverrideRankButton.getSelection();
149 156
                    }
150 157
                });
......
153 160
                allowOverrideRankButton.addSelectionListener(new SelectionAdapter(){
154 161
                    @Override
155 162
                    public void widgetSelected(SelectionEvent e) {
163
                        setApply(true);
156 164
                        overrideRank = allowOverrideRankButton.getSelection();
157 165
                    }
158 166
                });
......
169 177
            sortNamedAreaByVocabularyOrder.addSelectionListener(new SelectionAdapter(){
170 178
                @Override
171 179
                public void widgetSelected(SelectionEvent e) {
180
                    setApply(true);
172 181
                    isSortByVocabularyOrder = sortNamedAreaByVocabularyOrder.getSelection();
173 182
                 }
174 183
            });
......
178 187
                allowOverrideOrderAreasButton.addSelectionListener(new SelectionAdapter(){
179 188
                    @Override
180 189
                    public void widgetSelected(SelectionEvent e) {
190
                        setApply(true);
181 191
                        allowOverrideOrderAreas = allowOverrideOrderAreasButton.getSelection();
182 192
                    }
183 193
                });
......
186 196
                allowOverrideOrderAreasButton.addSelectionListener(new SelectionAdapter(){
187 197
                    @Override
188 198
                    public void widgetSelected(SelectionEvent e) {
199
                        setApply(true);
189 200
                        overrideOrderAreas = allowOverrideOrderAreasButton.getSelection();
190 201
                    }
191 202
                });
......
202 213
            ownDescription.addSelectionListener(new SelectionAdapter(){
203 214
                @Override
204 215
                public void widgetSelected(SelectionEvent e) {
205

  
216
                    setApply(true);
206 217
                    ownDescriptionForDistributionEditor = ownDescription.getSelection();
207 218
                 }
208 219
            });
......
212 223
                allowOverrideDescription.addSelectionListener(new SelectionAdapter(){
213 224
                    @Override
214 225
                    public void widgetSelected(SelectionEvent e) {
226
                        setApply(true);
215 227
                        allowOverrideOwnDescriptionForDistributionEditor = allowOverrideDescription.getSelection();
216 228
                    }
217 229
                });
......
220 232
                allowOverrideDescription.addSelectionListener(new SelectionAdapter(){
221 233
                    @Override
222 234
                    public void widgetSelected(SelectionEvent e) {
235
                        setApply(true);
223 236
                        overrideOwnDescriptionForDistributionEditor = allowOverrideDescription.getSelection();
224 237
                    }
225 238
                });
......
273 286
                allowOverrideOrderAreaDisplayButton.addSelectionListener(new SelectionAdapter(){
274 287
                    @Override
275 288
                    public void widgetSelected(SelectionEvent e) {
289
                        setApply(true);
276 290
                        allowOverrideAreaDisplay = allowOverrideOrderAreaDisplayButton.getSelection();
277 291
                    }
278 292
                });
......
281 295
                allowOverrideOrderAreaDisplayButton.addSelectionListener(new SelectionAdapter(){
282 296
                    @Override
283 297
                    public void widgetSelected(SelectionEvent e) {
298
                        setApply(true);
284 299
                        overrideAreaDisplay = allowOverrideOrderAreaDisplayButton.getSelection();
285 300
                    }
286 301
                });
......
321 336
                allowOverrideOrderStatusDisplayButton.addSelectionListener(new SelectionAdapter(){
322 337
                    @Override
323 338
                    public void widgetSelected(SelectionEvent e) {
339
                        setApply(true);
324 340
                        allowOverrideStatusDisplay = allowOverrideOrderStatusDisplayButton.getSelection();
325 341
                    }
326 342
                });
......
329 345
                allowOverrideOrderStatusDisplayButton.addSelectionListener(new SelectionAdapter(){
330 346
                    @Override
331 347
                    public void widgetSelected(SelectionEvent e) {
348
                        setApply(true);
332 349
                        overrideStatusDisplay = allowOverrideOrderStatusDisplayButton.getSelection();
333 350
                    }
334 351
                });
......
347 364
                    commandHandlerStringStatus);
348 365

  
349 366
            button_openStatusWizard.setText(Messages.Distribution_status_selection);
367
            button_openStatusWizard.addListener(SWT.Selection, new Listener() {
368
                @Override
369
                public void handleEvent(Event e) {
370
                  switch (e.type) {
371
                  case SWT.Selection:
372
                    setApply(true);
373
                    break;
374
                  }
375
                }
376
              });
377

  
350 378

  
351 379
            final CLabel label = new CLabel(child, SWT.NULL);
352 380
            label.setText(Messages.ChecklistEditorGeneralPreference_open_wizard);
......
418 446
     */
419 447
    @Override
420 448
    public void widgetSelected(SelectionEvent e) {
421

  
449
        setApply(true);
422 450
        if (e.getSource().equals(statusDisplaySelectionCombo)){
423 451
            String text = statusDisplaySelectionCombo.getText();
424 452
            for (TermDisplayEnum display: TermDisplayEnum.values()){
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/DefaultFeatureTreePreferenecs.java
75 75

  
76 76
			@Override
77 77
			public void selectionChanged(SelectionChangedEvent arg0) {
78
			    setApply(true);
78 79
				IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
79 80

  
80 81
				defaultFeatureTreeForTextualDescription = (FeatureTree) selection.getFirstElement();
......
105 106

  
106 107
			@Override
107 108
			public void selectionChanged(SelectionChangedEvent arg0) {
109
			    setApply(true);
108 110
				IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
109 111

  
110 112
				defaultFeatureTreeForStructuredDescription = (FeatureTree) selection.getFirstElement();
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/DescriptionPreferences.java
27 27

  
28 28
	@Override
29 29
	protected void createFieldEditors() {
30

  
30 31
	    addField(new BooleanFieldEditor(PreferencesUtil.createPreferenceString(IPreferenceKeys.SHOW_VOCABULARY_ID_FOR_TERM_LABELS),
31 32
	            "Show vocabulary id for term labels.",
32 33
                getFieldEditorParent()));
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/GeneralPreferencePage.java
48 48
        getValues();
49 49
        final Composite composite = createComposite(parent);
50 50

  
51

  
51 52
        final Button showIOMenuButton = new Button(composite, SWT.CHECK);
52 53
        showIOMenuButton.setText(Messages.DatabasePreferncesPage_Show_IOMenu);
53 54
        showIOMenuButton.setSelection(isShowIOMenu);
......
55 56
             @Override
56 57
             public void widgetSelected(SelectionEvent e) {
57 58
                 isShowIOMenu = showIOMenuButton.getSelection();
59
                 setApply(true);
58 60
              }
59 61
         });
60 62
        Button allowOverrideShowIOMenuButton = createAllowOverrideButton(composite);
......
64 66
                @Override
65 67
                public void widgetSelected(SelectionEvent e) {
66 68
                    isAllowOverrideShowIOMenu = allowOverrideShowIOMenuButton.getSelection();
69
                    setApply(true);
67 70
                }
68 71
            });
69 72
        }else{
......
72 75
                @Override
73 76
                public void widgetSelected(SelectionEvent e) {
74 77
                    isOverrideShowIOMenu = allowOverrideShowIOMenuButton.getSelection();
78
                    setApply(true);
75 79
                }
76 80
            });
77 81
            if (!isAllowOverrideShowIOMenu){
......
120 124
             @Override
121 125
             public void widgetSelected(SelectionEvent e) {
122 126
                 isShowCheckListPerspective = showChecklistPerspectiveButton.getSelection();
127
                 setApply(true);
123 128
              }
124 129
         });
125 130

  
......
130 135
                @Override
131 136
                public void widgetSelected(SelectionEvent e) {
132 137
                    isAllowOverrideShowCheckListPerspective = allowOverrideShowChecklistButton.getSelection();
138
                    setApply(true);
133 139
                }
134 140
            });
135 141
        }else{
......
138 144
                @Override
139 145
                public void widgetSelected(SelectionEvent e) {
140 146
                    isOverrideShowCheckListPerspective = allowOverrideShowChecklistButton.getSelection();
147
                    setApply(true);
141 148
                }
142 149
            });
143 150
            if (!isAllowOverrideShowCheckListPerspective){
......
153 160
             @Override
154 161
             public void widgetSelected(SelectionEvent e) {
155 162
                 isShowTaxonNodeWizard = showTaxonNodeWizardButton.getSelection();
163
                 setApply(true);
156 164
              }
157 165
         });
158 166

  
......
163 171
                @Override
164 172
                public void widgetSelected(SelectionEvent e) {
165 173
                    isAllowOverrideShowTaxonNodeWizard = allowOverrideShowTaxonNodeWizardButton.getSelection();
174
                    setApply(true);
166 175
                }
167 176
            });
168 177
        }else{
......
171 180
                @Override
172 181
                public void widgetSelected(SelectionEvent e) {
173 182
                    isOverrideShowTaxonNodeWizard = allowOverrideShowTaxonNodeWizardButton.getSelection();
183
                    setApply(true);
174 184
                }
175 185
            });
176 186
            if (!isAllowOverrideShowTaxonNodeWizard){
......
183 193
        return composite;
184 194
    }
185 195

  
186
    @Override
187
    public void createControl(Composite parent){
188
        super.createControl(parent);
189
        getControl().setVisible(false);
190
    }
196

  
191 197

  
192 198
    @Override
193 199
    public boolean performOk() {
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/LanguageEditorPreferencePage.java
75 75

  
76 76
            @Override
77 77
            public void widgetSelected(SelectionEvent e) {
78
                setApply(true);
78 79
//                try {
79 80
//                    preferencesUtil.writePropertyToConfigFile(combo.getSelectionIndex());
80 81
                    if(initalSelectionIndex != combo.getSelectionIndex()) {
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/LanguageRepresentationPreferencePage.java
93 93
			 */
94 94
			@Override
95 95
			public void widgetSelected(SelectionEvent e) {
96
			    setApply(true);
96 97
				int selectionIndex = combo_globalLanguage.getSelectionIndex();
97 98
				globalLanguage = CdmStore.getCurrentApplicationConfiguration().getTermService().getLanguageByLabel(combo_globalLanguage.getItem(selectionIndex));
98 99
			}
......
118 119
			 */
119 120
			@Override
120 121
			public void widgetSelected(SelectionEvent e) {
122
			    setApply(true);
121 123
				isMultilanguageTextEditingCapability = button_toggle.getSelection();
122 124
			}
123 125
		});
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/NameDetailsViewConfiguration.java
72 72
            activateCheckButton.addSelectionListener(new SelectionAdapter(){
73 73
                @Override
74 74
                public void widgetSelected(SelectionEvent e) {
75
                    setApply(true);
75 76
                    isSimpleDetailsViewActivated = activateCheckButton.getSelection();
76 77

  
77 78
                    dbSettings.setEnabled(isSimpleDetailsViewActivated);
......
87 88
            allowLocalPreference.addSelectionListener(new SelectionAdapter(){
88 89
                @Override
89 90
                public void widgetSelected(SelectionEvent e) {
91
                    setApply(true);
90 92
                    if (isAdminPreference){
91 93
                        isAllowOverride = allowLocalPreference.getSelection();
92 94
                    }else{
......
109 111
            showTaxon.addSelectionListener(new SelectionAdapter(){
110 112
                 @Override
111 113
                 public void widgetSelected(SelectionEvent e) {
114
                     setApply(true);
112 115
                     isShowTaxon = showTaxon.getSelection();
113 116

  
114 117
                  }
......
121 124
            showSecDetail.addSelectionListener(new SelectionAdapter(){
122 125
                 @Override
123 126
                 public void widgetSelected(SelectionEvent e) {
127
                     setApply(true);
124 128
                     isSecDetailsActivated = showSecDetail.getSelection();
125 129

  
126 130
                  }
......
133 137
            secEnabled.addSelectionListener(new SelectionAdapter(){
134 138
                 @Override
135 139
                 public void widgetSelected(SelectionEvent e) {
140
                     setApply(true);
136 141
                     isSecEnabled = secEnabled.getSelection();
137 142

  
138 143
                  }
......
146 151
            showLsid.addSelectionListener(new SelectionAdapter(){
147 152
                 @Override
148 153
                 public void widgetSelected(SelectionEvent e) {
154
                     setApply(true);
149 155
                     isShowLSID = showLsid.getSelection();
150 156

  
151 157
                  }
......
158 164
            showNomenclaturalCode.addSelectionListener(new SelectionAdapter(){
159 165
                 @Override
160 166
                 public void widgetSelected(SelectionEvent e) {
167
                     setApply(true);
161 168
                     isShowNomenclaturalCode = showNomenclaturalCode.getSelection();
162 169

  
163 170
                  }
......
170 177
            showNameCache.addSelectionListener(new SelectionAdapter(){
171 178
                 @Override
172 179
                 public void widgetSelected(SelectionEvent e) {
173
                    isShowNameCache = showNameCache.getSelection();
174

  
180
                     setApply(true);
181
                     isShowNameCache = showNameCache.getSelection();
175 182
                  }
176 183
             });
177 184
            final Button showAppendedPhrase = new Button(dbSettings, SWT.CHECK);
......
181 188
            showAppendedPhrase.addSelectionListener(new SelectionAdapter(){
182 189
                 @Override
183 190
                 public void widgetSelected(SelectionEvent e) {
184
                    isShowAppendedPhrase = showAppendedPhrase.getSelection();
185

  
191
                     setApply(true);
192
                     isShowAppendedPhrase = showAppendedPhrase.getSelection();
186 193
                  }
187 194
             });
188 195

  
......
193 200
            showRank.addSelectionListener(new SelectionAdapter(){
194 201
                 @Override
195 202
                 public void widgetSelected(SelectionEvent e) {
203
                     setApply(true);
196 204
                     isShowRank = showRank.getSelection();
197

  
198 205
                  }
199 206
             });
200 207
            final Button showEpithets = new Button(dbSettings, SWT.CHECK);
......
204 211
            showEpithets.addSelectionListener(new SelectionAdapter(){
205 212
                 @Override
206 213
                 public void widgetSelected(SelectionEvent e) {
214
                     setApply(true);
207 215
                     isShowEpithets = showEpithets.getSelection();
208

  
209 216
                  }
210 217
             });
211 218

  
......
216 223
            showAuthorCache.addSelectionListener(new SelectionAdapter(){
217 224
                 @Override
218 225
                 public void widgetSelected(SelectionEvent e) {
226
                     setApply(true);
219 227
                     isShowAuthorCache = showAuthorCache.getSelection();
220

  
221 228
                  }
222 229
             });
223 230

  
......
228 235
            showAuthorship.addSelectionListener(new SelectionAdapter(){
229 236
                 @Override
230 237
                 public void widgetSelected(SelectionEvent e) {
238
                     setApply(true);
231 239
                     isShowAuthorship = showAuthorship.getSelection();
232

  
233 240
                  }
234 241
             });
235 242

  
......
240 247
            showNomenclaturalRef.addSelectionListener(new SelectionAdapter(){
241 248
                 @Override
242 249
                 public void widgetSelected(SelectionEvent e) {
250
                     setApply(true);
243 251
                     isShowNomenclaturalRef = showNomenclaturalRef.getSelection();
244

  
245 252
                  }
246 253
             });
247 254

  
......
252 259
            showNomenclaturalStatus.addSelectionListener(new SelectionAdapter(){
253 260
                 @Override
254 261
                 public void widgetSelected(SelectionEvent e) {
262
                     setApply(true);
255 263
                     isShowNomenclaturalStatus = showNomenclaturalStatus.getSelection();
256

  
257 264
                  }
258 265
             });
259 266

  
......
264 271
            showProtologue.addSelectionListener(new SelectionAdapter(){
265 272
                 @Override
266 273
                 public void widgetSelected(SelectionEvent e) {
274
                     setApply(true);
267 275
                     isShowProtologue = showProtologue.getSelection();
268

  
269 276
                  }
270 277
             });
271 278

  
......
276 283
            showTypeDesignation.addSelectionListener(new SelectionAdapter(){
277 284
                 @Override
278 285
                 public void widgetSelected(SelectionEvent e) {
286
                     setApply(true);
279 287
                     isShowTypeDesignation = showTypeDesignation.getSelection();
280

  
281 288
                  }
282 289
             });
283 290

  
......
289 296
            showNameRelationship.addSelectionListener(new SelectionAdapter(){
290 297
                 @Override
291 298
                 public void widgetSelected(SelectionEvent e) {
299
                     setApply(true);
292 300
                     isShowNameRelationship = showNameRelationship.getSelection();
293

  
294 301
                  }
295 302
             });
296 303

  
......
301 308
            showHybrid.addSelectionListener(new SelectionAdapter(){
302 309
                 @Override
303 310
                 public void widgetSelected(SelectionEvent e) {
311
                     setApply(true);
304 312
                     isShowHybrid = showHybrid.getSelection();
305

  
306 313
                  }
307 314
             });
308 315
            final Button showNameApprobiation = new Button(dbSettings, SWT.CHECK);
......
312 319
            showNameApprobiation.addSelectionListener(new SelectionAdapter(){
313 320
                 @Override
314 321
                 public void widgetSelected(SelectionEvent e) {
322
                     setApply(true);
315 323
                     isShowNameApprobiation = showNameApprobiation.getSelection();
316
                    //PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_APPROBATION, isShowNameApprobiation);
317 324
                  }
318 325
             });
319 326
            PreferencesUtil.recursiveSetEnabled(dbSettings, isSimpleDetailsViewActivated);
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/SpecimenOrObservationPreferences.java
94 94
        showSpecimenButton.addSelectionListener(new SelectionAdapter(){
95 95
             @Override
96 96
             public void widgetSelected(SelectionEvent e) {
97
                 setApply(true);
97 98
                 isShowSpecimenRelatedIssues = showSpecimenButton.getSelection();
98 99
                 if(isShowSpecimenRelatedIssues){
99 100
                     composite.setVisible(true);
......
110 111
            allowOverrideIsShowSpecimenRelatedIssuesButton.addSelectionListener(new SelectionAdapter(){
111 112
                @Override
112 113
                public void widgetSelected(SelectionEvent e) {
114
                    setApply(true);
113 115
                    allowOverrideShowSpecimenRelatedIssues = allowOverrideIsShowSpecimenRelatedIssuesButton.getSelection();
114 116
                }
115 117
            });
......
118 120
            allowOverrideIsShowSpecimenRelatedIssuesButton.addSelectionListener(new SelectionAdapter(){
119 121
                @Override
120 122
                public void widgetSelected(SelectionEvent e) {
123
                    setApply(true);
121 124
                    overrideShowSpecimenRelatedIssues = allowOverrideIsShowSpecimenRelatedIssuesButton.getSelection();
122 125
                }
123 126
            });
......
141 144
        showCollectingAreaInGeneralSectionButton.addSelectionListener(new SelectionAdapter(){
142 145
             @Override
143 146
             public void widgetSelected(SelectionEvent e) {
147
                 setApply(true);
144 148
                 isShowCollectingAreaInGeneralSection = showCollectingAreaInGeneralSectionButton.getSelection();
145 149

  
146 150
              }
......
151 155
            allowOverrideShowCollectingAreaButton.addSelectionListener(new SelectionAdapter(){
152 156
                @Override
153 157
                public void widgetSelected(SelectionEvent e) {
158
                    setApply(true);
154 159
                    allowOverrideShowCollectingAreaInGeneralSection = allowOverrideShowCollectingAreaButton.getSelection();
155 160
                }
156 161
            });
......
159 164
            allowOverrideShowCollectingAreaButton.addSelectionListener(new SelectionAdapter(){
160 165
                @Override
161 166
                public void widgetSelected(SelectionEvent e) {
167
                    setApply(true);
162 168
                    overrideShowCollectionAreaInGeneralSection = allowOverrideShowCollectingAreaButton.getSelection();
163 169
                }
164 170
            });
......
174 180
        determinationOnlyForFieldUnitsButton.addSelectionListener(new SelectionAdapter(){
175 181
             @Override
176 182
             public void widgetSelected(SelectionEvent e) {
183
                 setApply(true);
177 184
                 isDeterminationOnlyForFieldUnits = determinationOnlyForFieldUnitsButton.getSelection();
178 185
             }
179 186
         });
......
184 191
            allowOverridesDeterminationOnlyForFieldUnitsButton.addSelectionListener(new SelectionAdapter(){
185 192
                @Override
186 193
                public void widgetSelected(SelectionEvent e) {
194
                    setApply(true);
187 195
                    allowOverrideDeterminationOnlyForFieldUnits = allowOverridesDeterminationOnlyForFieldUnitsButton.getSelection();
188 196
                }
189 197
            });
......
192 200
            allowOverridesDeterminationOnlyForFieldUnitsButton.addSelectionListener(new SelectionAdapter(){
193 201
                @Override
194 202
                public void widgetSelected(SelectionEvent e) {
203
                    setApply(true);
195 204
                    overrideDeterminationOnlyForFieldUnits = allowOverridesDeterminationOnlyForFieldUnitsButton.getSelection();
196 205
                }
197 206
            });
......
209 218
        showTaxonAssociationButton.addSelectionListener(new SelectionAdapter(){
210 219
             @Override
211 220
             public void widgetSelected(SelectionEvent e) {
221
                 setApply(true);
212 222
                 isShowTaxonAssociation = showTaxonAssociationButton.getSelection();
213 223

  
214 224
              }
......
219 229
            allowOverrideIsShowTaxonAssociationButton.addSelectionListener(new SelectionAdapter(){
220 230
                @Override
221 231
                public void widgetSelected(SelectionEvent e) {
232
                    setApply(true);
222 233
                    allowOverrideShowTaxonAssociation = allowOverrideIsShowTaxonAssociationButton.getSelection();
223 234
                }
224 235
            });
......
227 238
            allowOverrideIsShowTaxonAssociationButton.addSelectionListener(new SelectionAdapter(){
228 239
                @Override
229 240
                public void widgetSelected(SelectionEvent e) {
241
                    setApply(true);
230 242
                    overrideShowTaxonAssociation = allowOverrideIsShowTaxonAssociationButton.getSelection();
231 243
                }
232 244
            });
......
242 254
        showLifeFormButton.addSelectionListener(new SelectionAdapter(){
243 255
             @Override
244 256
             public void widgetSelected(SelectionEvent e) {
257
                 setApply(true);
245 258
                 isShowLifeForm = showLifeFormButton.getSelection();
246 259

  
247 260
              }
......
253 266
            allowOverrideShowLifeFormButton.addSelectionListener(new SelectionAdapter(){
254 267
                @Override
255 268
                public void widgetSelected(SelectionEvent e) {
269
                    setApply(true);
256 270
                    allowOverrideShowLifeForm = allowOverrideShowLifeFormButton.getSelection();
257 271
                }
258 272
            });
......
261 275
            allowOverrideShowLifeFormButton.addSelectionListener(new SelectionAdapter(){
262 276
                @Override
263 277
                public void widgetSelected(SelectionEvent e) {
278
                    setApply(true);
264 279
                    overrideShowLifeForm = allowOverrideShowLifeFormButton.getSelection();
265 280
                }
266 281
            });
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/AbstractMenuPreferences.java
119 119
			@Override
120 120
			public void checkStateChanged(CheckStateChangedEvent arg0) {
121 121
				checkNoneChecked();
122
				setApply(true);
122 123
			}
123 124
		});
124 125

  
126

  
125 127
		Composite buttonContainer = new Composite(container, SWT.NULL);
126 128
		GridData buttonContainerLayoutData = new GridData();
127 129
		buttonContainerLayoutData.verticalAlignment = SWT.TOP;
......
140 142
				state = state ? false : true;
141 143
				tableViewer.setAllChecked(state);
142 144
				checkNoneChecked();
145
				setApply(true);
143 146
			}
144 147
		});
145 148

  
......
176 179
		editButton.addSelectionListener(new SelectionAdapter(){
177 180
			@Override
178 181
			public void widgetSelected(SelectionEvent event) {
179

  
182
			    setApply(true);
180 183
				ICommandService commandService = (ICommandService)  AbstractUtility.getService(ICommandService.class);
181 184

  
182 185
				Command command = commandService.getCommand(DefinedTermEditorE4.OPEN_COMMAND_ID);
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/CdmPreferencePage.java
27 27
 */
28 28
public abstract class CdmPreferencePage extends PreferencePage implements IE4PreferencePage {
29 29

  
30
    private boolean isApply;
30
    private boolean isApply = false;
31 31

  
32 32
    protected boolean isAdminPreference;
33 33

  
......
46 46
        init();
47 47
    }
48 48

  
49

  
50

  
49 51
    public void init() {
50 52
        setPreferenceStore(PreferencesUtil.getPreferenceStore());
51 53
    }
52 54

  
53 55
    @Override
56
    public void createControl(Composite parent){
57
        super.createControl(parent);
58
        if (getApplyButton() != null){
59
            this.getApplyButton().setEnabled(false);
60
        }
61

  
62
    }
63

  
64
    @Override
54 65
    public boolean performOk() {
55 66
        if (isValid()){
56 67
            return super.performOk();
......
65 76

  
66 77
    @Override
67 78
    public void performApply() {
68
        isApply = true;
79
        setApply(true);
69 80
        super.performApply();
70
        isApply = false;
81
        setApply(false);
71 82
    }
72 83

  
73 84
    protected Composite createComposite(Composite composite) {
......
108 119
        return allowOverrideCheckButton;
109 120
    }
110 121

  
122
    public boolean isApply() {
123
        return isApply;
124
    }
125

  
126
    public void setApply(boolean isApply) {
127
        this.isApply = isApply;
128
        this.getApplyButton().setEnabled(this.isApply);
129
    }
130

  
111 131

  
112 132

  
113 133
}

Also available in: Unified diff