1
|
package eu.etaxonomy.taxeditor.preference;
|
2
|
|
3
|
|
4
|
import org.eclipse.jface.layout.GridLayoutFactory;
|
5
|
import org.eclipse.swt.SWT;
|
6
|
import org.eclipse.swt.custom.CLabel;
|
7
|
import org.eclipse.swt.events.SelectionAdapter;
|
8
|
import org.eclipse.swt.events.SelectionEvent;
|
9
|
import org.eclipse.swt.events.SelectionListener;
|
10
|
import org.eclipse.swt.layout.GridData;
|
11
|
import org.eclipse.swt.layout.GridLayout;
|
12
|
import org.eclipse.swt.widgets.Button;
|
13
|
import org.eclipse.swt.widgets.Combo;
|
14
|
import org.eclipse.swt.widgets.Composite;
|
15
|
import org.eclipse.swt.widgets.Control;
|
16
|
import org.eclipse.swt.widgets.Label;
|
17
|
|
18
|
import eu.etaxonomy.cdm.model.metadata.CdmPreference;
|
19
|
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
|
20
|
import eu.etaxonomy.taxeditor.l10n.Messages;
|
21
|
import eu.etaxonomy.taxeditor.preference.menu.CdmPreferencePage;
|
22
|
|
23
|
|
24
|
public class NameDetailsViewConfiguration extends CdmPreferencePage implements SelectionListener{
|
25
|
|
26
|
/**
|
27
|
*
|
28
|
*/
|
29
|
private static final String DISABLE = "Disable";
|
30
|
/**
|
31
|
*
|
32
|
*/
|
33
|
private static final String ENABLE = "Enable";
|
34
|
protected Boolean isSimpleDetailsViewActivated;
|
35
|
boolean isUseLocalSettings;
|
36
|
protected NameDetailsConfigurator nameDetailsConfig;
|
37
|
Composite localSettings ;
|
38
|
|
39
|
CdmPreference nameDetailsPref;
|
40
|
|
41
|
protected boolean isShowTaxon;
|
42
|
protected boolean isShowNameApprobiation ;
|
43
|
protected boolean isShowHybrid;
|
44
|
protected boolean isShowNameRelationship;
|
45
|
protected boolean isShowTypeDesignation;
|
46
|
protected boolean isShowProtologue;
|
47
|
protected boolean isShowNomenclaturalStatus;
|
48
|
protected boolean isShowNomenclaturalRef;
|
49
|
protected boolean isShowAuthorship;
|
50
|
protected boolean isShowAuthorCache;
|
51
|
protected boolean isShowEpithets;
|
52
|
protected boolean isShowRank;
|
53
|
protected boolean isShowAppendedPhrase;
|
54
|
protected boolean isShowNameCache;
|
55
|
protected boolean isShowNomenclaturalCode;
|
56
|
protected boolean isShowLSID;
|
57
|
protected boolean isSecEnabled;
|
58
|
protected boolean isSecDetailsActivated;
|
59
|
|
60
|
protected boolean isAllowOverride;
|
61
|
private boolean isOverride;
|
62
|
private Button showSecDetail;
|
63
|
private Button secEnabled;
|
64
|
|
65
|
protected Combo activateCheckButton;
|
66
|
protected Button allowLocalPreference;
|
67
|
protected Button showTaxon;
|
68
|
protected Button showLsid;
|
69
|
protected Button showNomenclaturalCode;
|
70
|
protected Button showNameCache;
|
71
|
protected Button showAppendedPhrase;
|
72
|
protected Button showRank;
|
73
|
protected Button showEpithets;
|
74
|
protected Button showAuthorCache;
|
75
|
protected Button showAuthorship;
|
76
|
protected Button showNomenclaturalRef;
|
77
|
protected Button showNomenclaturalStatus;
|
78
|
protected Button showProtologue;
|
79
|
protected Button showTypeDesignation;
|
80
|
protected Button showNameRelationship;
|
81
|
protected Button showHybrid;
|
82
|
protected Button showNameApprobiation;
|
83
|
|
84
|
Composite dbSettings;
|
85
|
|
86
|
@Override
|
87
|
protected Control createContents(Composite parent) {
|
88
|
getValues();
|
89
|
if (isAllowOverride || isAdminPreference ){
|
90
|
|
91
|
final CLabel description = new CLabel(parent, SWT.NULL);
|
92
|
description.setText(Messages.NameDetailsViewConfiguration_description);
|
93
|
|
94
|
Composite title = createComposite(parent);
|
95
|
// nameDetailsConfig = PreferencesUtil.getPreferredNameDetailsConfiguration(!isAdminPreference);
|
96
|
if (nameDetailsConfig == null){
|
97
|
nameDetailsConfig = new NameDetailsConfigurator(false);
|
98
|
}
|
99
|
|
100
|
activateCheckButton = createBooleanCombo(title, ENABLE, DISABLE, PreferencePredicate.SimpleDetailsViewActivated, Messages.NameDetailsViewConfiguration_activateSimpleDetailsView, isAdminPreference);
|
101
|
if (isAdminPreference){
|
102
|
allowLocalPreference = createAllowOverrideButton(title);
|
103
|
|
104
|
allowLocalPreference.addSelectionListener(new SelectionAdapter(){
|
105
|
@Override
|
106
|
public void widgetSelected(SelectionEvent e) {
|
107
|
setApply(true);
|
108
|
if (isAdminPreference){
|
109
|
isAllowOverride = allowLocalPreference.getSelection();
|
110
|
}else{
|
111
|
isOverride = allowLocalPreference.getSelection();
|
112
|
}
|
113
|
|
114
|
}
|
115
|
});
|
116
|
|
117
|
}
|
118
|
dbSettings = new Composite(parent, SWT.NONE);
|
119
|
|
120
|
// activateCheckButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, true, 1, 1));
|
121
|
// activateCheckButton.setText(Messages.NameDetailsViewConfiguration_activateSimpleDetailsView);
|
122
|
isSimpleDetailsViewActivated = nameDetailsConfig.isSimpleDetailsViewActivated();
|
123
|
|
124
|
activateCheckButton.addSelectionListener(this);
|
125
|
// new SelectionAdapter(){
|
126
|
// @Override
|
127
|
// public void widgetSelected(SelectionEvent e) {
|
128
|
// setApply(true);
|
129
|
// isSimpleDetailsViewActivated = activateCheckButton.getSelectionIndex() == 0? true:false;
|
130
|
// nameDetailsConfig.setSimpleDetailsViewActivated(isSimpleDetailsViewActivated);
|
131
|
// dbSettings.setEnabled(isSimpleDetailsViewActivated);
|
132
|
// PreferencesUtil.recursiveSetEnabled(dbSettings, isSimpleDetailsViewActivated);
|
133
|
// if (isSimpleDetailsViewActivated){
|
134
|
// showSecDetail.setEnabled(isShowTaxon);
|
135
|
// secEnabled.setEnabled(isShowTaxon);
|
136
|
// }
|
137
|
//
|
138
|
// }
|
139
|
// });
|
140
|
|
141
|
|
142
|
dbSettings.setLayout(new GridLayout());
|
143
|
dbSettings.setEnabled(isSimpleDetailsViewActivated);
|
144
|
|
145
|
|
146
|
Label separator= new Label(dbSettings, SWT.HORIZONTAL | SWT.SEPARATOR);
|
147
|
separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
148
|
showTaxon = new Button(dbSettings, SWT.CHECK);
|
149
|
showTaxon.setText(Messages.NameDetailsViewComposite_Show_Taxon);
|
150
|
isShowTaxon = nameDetailsConfig.isTaxonSectionActivated();
|
151
|
|
152
|
showTaxon.addSelectionListener(new SelectionAdapter(){
|
153
|
@Override
|
154
|
public void widgetSelected(SelectionEvent e) {
|
155
|
setApply(true);
|
156
|
isShowTaxon = showTaxon.getSelection();
|
157
|
nameDetailsConfig.setTaxonSectionActivated(isShowTaxon);
|
158
|
if (isSimpleDetailsViewActivated){
|
159
|
showSecDetail.setEnabled(isShowTaxon);
|
160
|
secEnabled.setEnabled(isShowTaxon);
|
161
|
}
|
162
|
|
163
|
}
|
164
|
});
|
165
|
|
166
|
Composite taxonComp = new Composite(dbSettings, SWT.NULL);
|
167
|
|
168
|
GridLayoutFactory.fillDefaults().applyTo(taxonComp);
|
169
|
|
170
|
GridData data = new GridData();
|
171
|
data.horizontalIndent = 5;
|
172
|
data.horizontalSpan = 2;
|
173
|
taxonComp.setLayoutData(data);
|
174
|
|
175
|
secEnabled = new Button(taxonComp, SWT.CHECK);
|
176
|
secEnabled.setText(Messages.NameDetailsViewComposite_SecEnabled);
|
177
|
|
178
|
isSecEnabled = nameDetailsConfig.isSecEnabled();
|
179
|
|
180
|
secEnabled.addSelectionListener(new SelectionAdapter(){
|
181
|
@Override
|
182
|
public void widgetSelected(SelectionEvent e) {
|
183
|
setApply(true);
|
184
|
isSecEnabled = secEnabled.getSelection();
|
185
|
nameDetailsConfig.setSecEnabled(isSecEnabled);
|
186
|
}
|
187
|
});
|
188
|
showSecDetail = new Button(taxonComp, SWT.CHECK);
|
189
|
showSecDetail.setText(Messages.NameDetailsViewComposite_Show_SecDetail);
|
190
|
|
191
|
isSecDetailsActivated = nameDetailsConfig.isSecDetailsActivated();
|
192
|
|
193
|
showSecDetail.addSelectionListener(new SelectionAdapter(){
|
194
|
@Override
|
195
|
public void widgetSelected(SelectionEvent e) {
|
196
|
setApply(true);
|
197
|
isSecDetailsActivated = showSecDetail.getSelection();
|
198
|
nameDetailsConfig.setSecDetailsActivated(isSecDetailsActivated);
|
199
|
}
|
200
|
});
|
201
|
|
202
|
showLsid = new Button(dbSettings, SWT.CHECK);
|
203
|
showLsid.setText(Messages.NameDetailsViewComposite_Show_LSID);
|
204
|
isShowLSID = nameDetailsConfig.isLSIDActivated();
|
205
|
|
206
|
showLsid.addSelectionListener(new SelectionAdapter(){
|
207
|
@Override
|
208
|
public void widgetSelected(SelectionEvent e) {
|
209
|
setApply(true);
|
210
|
isShowLSID = showLsid.getSelection();
|
211
|
nameDetailsConfig.setLSIDActivated(isShowLSID);
|
212
|
}
|
213
|
});
|
214
|
|
215
|
showNomenclaturalCode = new Button(dbSettings, SWT.CHECK);
|
216
|
showNomenclaturalCode.setText(Messages.NameDetailsViewComposite_Show_NomenclaturalCode);
|
217
|
isShowNomenclaturalCode = nameDetailsConfig.isNomenclaturalCodeActived();
|
218
|
|
219
|
showNomenclaturalCode.addSelectionListener(new SelectionAdapter(){
|
220
|
@Override
|
221
|
public void widgetSelected(SelectionEvent e) {
|
222
|
setApply(true);
|
223
|
isShowNomenclaturalCode = showNomenclaturalCode.getSelection();
|
224
|
nameDetailsConfig.setNomenclaturalCodeActived(isShowNomenclaturalCode);
|
225
|
}
|
226
|
});
|
227
|
|
228
|
showNameCache = new Button(dbSettings, SWT.CHECK);
|
229
|
showNameCache.setText(Messages.NameDetailsViewComposite_Show_NameCache);
|
230
|
isShowNameCache = nameDetailsConfig.isNameCacheActivated();
|
231
|
|
232
|
showNameCache.addSelectionListener(new SelectionAdapter(){
|
233
|
@Override
|
234
|
public void widgetSelected(SelectionEvent e) {
|
235
|
setApply(true);
|
236
|
isShowNameCache = showNameCache.getSelection();
|
237
|
nameDetailsConfig.setNameCacheActivated(isShowNameCache);
|
238
|
}
|
239
|
});
|
240
|
showAppendedPhrase = new Button(dbSettings, SWT.CHECK);
|
241
|
isShowAppendedPhrase= nameDetailsConfig.isAppendedPhraseActivated();
|
242
|
showAppendedPhrase.setText(Messages.NameDetailsViewComposite_Show_AppendedPhrase);
|
243
|
|
244
|
showAppendedPhrase.addSelectionListener(new SelectionAdapter(){
|
245
|
@Override
|
246
|
public void widgetSelected(SelectionEvent e) {
|
247
|
setApply(true);
|
248
|
isShowAppendedPhrase = showAppendedPhrase.getSelection();
|
249
|
nameDetailsConfig.setAppendedPhraseActivated(isShowAppendedPhrase);
|
250
|
}
|
251
|
});
|
252
|
|
253
|
showRank = new Button(dbSettings, SWT.CHECK);
|
254
|
isShowRank = nameDetailsConfig.isRankActivated();
|
255
|
showRank.setText(Messages.NameDetailsViewComposite_Show_Rank);
|
256
|
|
257
|
showRank.addSelectionListener(new SelectionAdapter(){
|
258
|
@Override
|
259
|
public void widgetSelected(SelectionEvent e) {
|
260
|
setApply(true);
|
261
|
isShowRank = showRank.getSelection();
|
262
|
nameDetailsConfig.setRankActivated(isShowRank);
|
263
|
}
|
264
|
});
|
265
|
showEpithets = new Button(dbSettings, SWT.CHECK);
|
266
|
isShowEpithets = nameDetailsConfig.isAtomisedEpithetsActivated();
|
267
|
showEpithets.setText(Messages.NameDetailsViewComposite_Show_AtomisedEpithets);
|
268
|
|
269
|
showEpithets.addSelectionListener(new SelectionAdapter(){
|
270
|
@Override
|
271
|
public void widgetSelected(SelectionEvent e) {
|
272
|
setApply(true);
|
273
|
isShowEpithets = showEpithets.getSelection();
|
274
|
nameDetailsConfig.setAtomisedEpithetsActivated(isShowEpithets);
|
275
|
}
|
276
|
});
|
277
|
|
278
|
showAuthorCache = new Button(dbSettings, SWT.CHECK);
|
279
|
isShowAuthorCache = nameDetailsConfig.isAuthorCacheActivated();
|
280
|
showAuthorCache.setText(Messages.NameDetailsViewComposite_Show_AuthorCache);
|
281
|
|
282
|
showAuthorCache.addSelectionListener(new SelectionAdapter(){
|
283
|
@Override
|
284
|
public void widgetSelected(SelectionEvent e) {
|
285
|
setApply(true);
|
286
|
isShowAuthorCache = showAuthorCache.getSelection();
|
287
|
nameDetailsConfig.setAuthorCacheActivated(isShowAuthorCache);
|
288
|
}
|
289
|
});
|
290
|
|
291
|
showAuthorship = new Button(dbSettings, SWT.CHECK);
|
292
|
isShowAuthorship = nameDetailsConfig.isAuthorshipSectionActivated();
|
293
|
showAuthorship.setText(Messages.NameDetailsViewComposite_Show_Author);
|
294
|
|
295
|
showAuthorship.addSelectionListener(new SelectionAdapter(){
|
296
|
@Override
|
297
|
public void widgetSelected(SelectionEvent e) {
|
298
|
setApply(true);
|
299
|
isShowAuthorship = showAuthorship.getSelection();
|
300
|
nameDetailsConfig.setAuthorshipSectionActivated(isShowAuthorship);
|
301
|
}
|
302
|
});
|
303
|
|
304
|
showNomenclaturalRef = new Button(dbSettings, SWT.CHECK);
|
305
|
isShowNomenclaturalRef = nameDetailsConfig.isNomenclaturalReferenceSectionActivated();
|
306
|
showNomenclaturalRef.setText(Messages.NameDetailsViewComposite_Show_NomenclaturalReference);
|
307
|
|
308
|
showNomenclaturalRef.addSelectionListener(new SelectionAdapter(){
|
309
|
@Override
|
310
|
public void widgetSelected(SelectionEvent e) {
|
311
|
setApply(true);
|
312
|
isShowNomenclaturalRef = showNomenclaturalRef.getSelection();
|
313
|
nameDetailsConfig.setNomenclaturalReferenceSectionActivated(isShowNomenclaturalRef);
|
314
|
}
|
315
|
});
|
316
|
|
317
|
showNomenclaturalStatus = new Button(dbSettings, SWT.CHECK);
|
318
|
isShowNomenclaturalStatus = nameDetailsConfig.isNomenclaturalStatusSectionActivated();
|
319
|
showNomenclaturalStatus.setText(Messages.NameDetailsViewComposite_Show_NomenclaturalStatus);
|
320
|
|
321
|
showNomenclaturalStatus.addSelectionListener(new SelectionAdapter(){
|
322
|
@Override
|
323
|
public void widgetSelected(SelectionEvent e) {
|
324
|
setApply(true);
|
325
|
isShowNomenclaturalStatus = showNomenclaturalStatus.getSelection();
|
326
|
nameDetailsConfig.setNomenclaturalStatusSectionActivated(isShowNomenclaturalStatus);
|
327
|
}
|
328
|
});
|
329
|
|
330
|
showProtologue = new Button(dbSettings, SWT.CHECK);
|
331
|
isShowProtologue = nameDetailsConfig.isProtologueActivated();
|
332
|
showProtologue.setText(Messages.NameDetailsViewComposite_Show_Protologue);
|
333
|
|
334
|
showProtologue.addSelectionListener(new SelectionAdapter(){
|
335
|
@Override
|
336
|
public void widgetSelected(SelectionEvent e) {
|
337
|
setApply(true);
|
338
|
isShowProtologue = showProtologue.getSelection();
|
339
|
nameDetailsConfig.setProtologueActivated(isShowProtologue);
|
340
|
}
|
341
|
});
|
342
|
|
343
|
showTypeDesignation = new Button(dbSettings, SWT.CHECK);
|
344
|
isShowTypeDesignation = nameDetailsConfig.isTypeDesignationSectionActivated();
|
345
|
showTypeDesignation.setText(Messages.NameDetailsViewComposite_Show_TypeDesignation);
|
346
|
|
347
|
showTypeDesignation.addSelectionListener(new SelectionAdapter(){
|
348
|
@Override
|
349
|
public void widgetSelected(SelectionEvent e) {
|
350
|
setApply(true);
|
351
|
isShowTypeDesignation = showTypeDesignation.getSelection();
|
352
|
nameDetailsConfig.setTypeDesignationSectionActivated(isShowTypeDesignation);
|
353
|
}
|
354
|
});
|
355
|
|
356
|
|
357
|
showNameRelationship = new Button(dbSettings, SWT.CHECK);
|
358
|
isShowNameRelationship = nameDetailsConfig.isNameRelationsSectionActivated();
|
359
|
showNameRelationship.setText(Messages.NameDetailsViewComposite_Show_Namerelationships);
|
360
|
|
361
|
showNameRelationship.addSelectionListener(new SelectionAdapter(){
|
362
|
@Override
|
363
|
public void widgetSelected(SelectionEvent e) {
|
364
|
setApply(true);
|
365
|
isShowNameRelationship = showNameRelationship.getSelection();
|
366
|
nameDetailsConfig.setNameRelationsSectionActivated(isShowNameRelationship);
|
367
|
}
|
368
|
});
|
369
|
|
370
|
showHybrid = new Button(dbSettings, SWT.CHECK);
|
371
|
isShowHybrid = nameDetailsConfig.isHybridActivated();
|
372
|
showHybrid.setText(Messages.NameDetailsViewComposite_Show_Hybrid);
|
373
|
|
374
|
showHybrid.addSelectionListener(new SelectionAdapter(){
|
375
|
@Override
|
376
|
public void widgetSelected(SelectionEvent e) {
|
377
|
setApply(true);
|
378
|
isShowHybrid = showHybrid.getSelection();
|
379
|
nameDetailsConfig.setHybridActivated(isShowHybrid);
|
380
|
}
|
381
|
});
|
382
|
showNameApprobiation = new Button(dbSettings, SWT.CHECK);
|
383
|
isShowNameApprobiation = nameDetailsConfig.isNameApprobiationActivated();
|
384
|
showNameApprobiation.setText(Messages.NameDetailsViewComposite_Show_NameApprobiation);
|
385
|
showNameApprobiation.addSelectionListener(new SelectionAdapter(){
|
386
|
@Override
|
387
|
public void widgetSelected(SelectionEvent e) {
|
388
|
setApply(true);
|
389
|
isShowNameApprobiation = showNameApprobiation.getSelection();
|
390
|
nameDetailsConfig.setNameApprobiationActivated(isShowNameApprobiation);
|
391
|
}
|
392
|
});
|
393
|
PreferencesUtil.recursiveSetEnabled(dbSettings, isSimpleDetailsViewActivated);
|
394
|
if (isSimpleDetailsViewActivated){
|
395
|
showSecDetail.setEnabled(isShowTaxon);
|
396
|
secEnabled.setEnabled(isShowTaxon);
|
397
|
}
|
398
|
setButtonSelections();
|
399
|
|
400
|
}else{
|
401
|
final CLabel description = new CLabel(parent, SWT.NULL);
|
402
|
description.setText(Messages.NameDetailsViewConfiguration_description_not_available);
|
403
|
this.setDefaultButtonActivated(false);
|
404
|
}
|
405
|
|
406
|
|
407
|
|
408
|
|
409
|
return parent;
|
410
|
}
|
411
|
|
412
|
@Override
|
413
|
public boolean performOk() {
|
414
|
if (nameDetailsConfig != null){
|
415
|
PreferencesUtil.setStringValue(PreferencePredicate.NameDetailsView.getKey(), nameDetailsConfig.toString());
|
416
|
if (nameDetailsPref == null || !nameDetailsConfig.toString().equals(nameDetailsPref.getValue())) {
|
417
|
PreferencesUtil.setBooleanValue(PreferencesUtil.prefOverrideKey(PreferencePredicate.NameDetailsView.getKey()), true);
|
418
|
}
|
419
|
}
|
420
|
|
421
|
return true;
|
422
|
|
423
|
}
|
424
|
|
425
|
@Override
|
426
|
public void getValues(){
|
427
|
if (nameDetailsConfig == null){
|
428
|
nameDetailsPref = PreferencesUtil.getPreferenceFromDB(PreferencePredicate.NameDetailsView);
|
429
|
isAdminPreference = false;
|
430
|
isAllowOverride = true;
|
431
|
if (nameDetailsPref != null){
|
432
|
isAllowOverride = nameDetailsPref.isAllowOverride();
|
433
|
|
434
|
}
|
435
|
isOverride = PreferencesUtil.getBooleanValue(PreferencesUtil.prefOverrideKey(PreferencePredicate.NameDetailsView.getKey()), true) != null? PreferencesUtil.getBooleanValue(PreferencesUtil.prefOverrideKey(PreferencePredicate.NameDetailsView.getKey()), true): false;
|
436
|
nameDetailsConfig = PreferencesUtil.getPreferredNameDetailsConfiguration(true);
|
437
|
}
|
438
|
}
|
439
|
|
440
|
protected void setButtonSelections(){
|
441
|
|
442
|
int index = 0;
|
443
|
if (isSimpleDetailsViewActivated != null){
|
444
|
if (isSimpleDetailsViewActivated){
|
445
|
index = 1;
|
446
|
}else{
|
447
|
index = 2;
|
448
|
}
|
449
|
}
|
450
|
activateCheckButton.select(index);
|
451
|
if (isAdminPreference){
|
452
|
allowLocalPreference.setSelection(isAllowOverride);
|
453
|
}
|
454
|
showTaxon.setSelection(isShowTaxon);
|
455
|
showLsid.setSelection(isShowLSID);
|
456
|
showNomenclaturalCode.setSelection(isShowNomenclaturalCode);
|
457
|
showNameCache.setSelection(isShowNameCache);
|
458
|
showAppendedPhrase.setSelection(isShowAppendedPhrase);
|
459
|
showRank.setSelection(isShowRank);
|
460
|
showEpithets.setSelection(isShowEpithets);
|
461
|
showAuthorCache.setSelection(isShowAuthorCache);
|
462
|
showAuthorship.setSelection(isShowAuthorship);
|
463
|
showNomenclaturalRef.setSelection(isShowNomenclaturalRef);
|
464
|
showNomenclaturalStatus.setSelection(isShowNomenclaturalStatus);
|
465
|
showProtologue.setSelection(isShowProtologue);
|
466
|
showTypeDesignation.setSelection(isShowTypeDesignation);
|
467
|
showNameRelationship.setSelection(isShowNameRelationship);
|
468
|
showHybrid.setSelection(isShowHybrid);
|
469
|
showNameApprobiation.setSelection(isShowNameApprobiation);
|
470
|
secEnabled.setSelection(isSecEnabled);
|
471
|
secEnabled.setEnabled(isShowTaxon);
|
472
|
showSecDetail.setSelection(isSecDetailsActivated);
|
473
|
showSecDetail.setEnabled(isShowTaxon);
|
474
|
|
475
|
}
|
476
|
|
477
|
@Override
|
478
|
protected void performDefaults() {
|
479
|
nameDetailsConfig = new NameDetailsConfigurator(false);
|
480
|
isShowAppendedPhrase = nameDetailsConfig.isAppendedPhraseActivated();
|
481
|
isShowEpithets = nameDetailsConfig.isAtomisedEpithetsActivated();
|
482
|
isShowAuthorship = nameDetailsConfig.isAuthorshipSectionActivated();
|
483
|
isShowAuthorCache = nameDetailsConfig.isAuthorCacheActivated();
|
484
|
isShowLSID = nameDetailsConfig.isLSIDActivated();
|
485
|
isShowNameApprobiation = nameDetailsConfig.isNameApprobiationActivated();
|
486
|
isShowNameCache = nameDetailsConfig.isNameCacheActivated();
|
487
|
isShowNameRelationship = nameDetailsConfig.isNameRelationsSectionActivated();
|
488
|
isShowNomenclaturalCode = nameDetailsConfig.isNomenclaturalCodeActived();
|
489
|
isShowNomenclaturalStatus = nameDetailsConfig.isNomenclaturalStatusSectionActivated();
|
490
|
isShowNomenclaturalRef = nameDetailsConfig.isNomenclaturalReferenceSectionActivated();
|
491
|
isShowProtologue = nameDetailsConfig.isProtologueActivated();
|
492
|
isShowRank = nameDetailsConfig.isRankActivated();
|
493
|
isShowTaxon = nameDetailsConfig.isTaxonSectionActivated();
|
494
|
isSecDetailsActivated = nameDetailsConfig.isSecDetailsActivated();
|
495
|
isSecEnabled = nameDetailsConfig.isSecEnabled();
|
496
|
isShowTypeDesignation = nameDetailsConfig.isTypeDesignationSectionActivated();
|
497
|
isShowHybrid = nameDetailsConfig.isHybridActivated();
|
498
|
isSimpleDetailsViewActivated = false;
|
499
|
this.setButtonSelections();
|
500
|
super.performDefaults();
|
501
|
}
|
502
|
|
503
|
/**
|
504
|
* {@inheritDoc}
|
505
|
*/
|
506
|
@Override
|
507
|
public void widgetSelected(SelectionEvent e) {
|
508
|
if (e.getSource().equals(activateCheckButton)){
|
509
|
String text = activateCheckButton.getText();
|
510
|
if(text.equals(Messages.Preference_Use_Default)){
|
511
|
isSimpleDetailsViewActivated = null;
|
512
|
if (isAdminPreference){
|
513
|
nameDetailsPref.setAllowOverride(true);
|
514
|
allowLocalPreference.setSelection(true);
|
515
|
}
|
516
|
return;
|
517
|
}
|
518
|
if (text.equals(ENABLE)){
|
519
|
isSimpleDetailsViewActivated = true;
|
520
|
|
521
|
}else{
|
522
|
isSimpleDetailsViewActivated = false;
|
523
|
}
|
524
|
nameDetailsConfig.setSimpleDetailsViewActivated(isSimpleDetailsViewActivated);
|
525
|
dbSettings.setEnabled(isSimpleDetailsViewActivated);
|
526
|
PreferencesUtil.recursiveSetEnabled(dbSettings, isSimpleDetailsViewActivated);
|
527
|
if (isSimpleDetailsViewActivated){
|
528
|
showSecDetail.setEnabled(isShowTaxon);
|
529
|
secEnabled.setEnabled(isShowTaxon);
|
530
|
}
|
531
|
setApply(true);
|
532
|
}
|
533
|
|
534
|
|
535
|
}
|
536
|
|
537
|
/**
|
538
|
* {@inheritDoc}
|
539
|
*/
|
540
|
@Override
|
541
|
public void widgetDefaultSelected(SelectionEvent e) {
|
542
|
// TODO Auto-generated method stub
|
543
|
|
544
|
}
|
545
|
|
546
|
}
|