1
|
/**
|
2
|
* Copyright (C) 2014 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.taxeditor.preference;
|
10
|
|
11
|
import org.eclipse.swt.SWT;
|
12
|
import org.eclipse.swt.custom.CLabel;
|
13
|
import org.eclipse.swt.events.SelectionAdapter;
|
14
|
import org.eclipse.swt.events.SelectionEvent;
|
15
|
import org.eclipse.swt.events.SelectionListener;
|
16
|
import org.eclipse.swt.layout.GridData;
|
17
|
import org.eclipse.swt.layout.GridLayout;
|
18
|
import org.eclipse.swt.widgets.Button;
|
19
|
import org.eclipse.swt.widgets.Combo;
|
20
|
import org.eclipse.swt.widgets.Composite;
|
21
|
import org.eclipse.swt.widgets.Control;
|
22
|
import org.eclipse.swt.widgets.Label;
|
23
|
|
24
|
import eu.etaxonomy.cdm.model.metadata.CdmPreference;
|
25
|
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
|
26
|
import eu.etaxonomy.taxeditor.l10n.Messages;
|
27
|
import eu.etaxonomy.taxeditor.preference.menu.CdmPreferencePage;
|
28
|
import eu.etaxonomy.taxeditor.ui.element.CommandHandlerButton;
|
29
|
|
30
|
/**
|
31
|
* @author a.oppermann
|
32
|
* @date 21.07.2014
|
33
|
*
|
34
|
*/
|
35
|
public class ChecklistEditorGeneralPreference extends CdmPreferencePage implements SelectionListener {
|
36
|
|
37
|
protected boolean isEditorActivated;
|
38
|
protected boolean allowOverrideActivated;
|
39
|
protected boolean overrideActivated;
|
40
|
boolean isUseLocal;
|
41
|
protected boolean isShowRank;
|
42
|
protected boolean isSortByVocabularyOrder;
|
43
|
protected String displayStatus;
|
44
|
protected String displayArea;
|
45
|
protected boolean ownDescriptionForDistributionEditor;
|
46
|
protected boolean allowOverrideOwnDescriptionForDistributionEditor;
|
47
|
protected boolean overrideOwnDescriptionForDistributionEditor;
|
48
|
protected boolean allowOverrideAreaVoc;
|
49
|
protected boolean overrideAreaVoc;
|
50
|
protected boolean allowOverrideRank;
|
51
|
protected boolean overrideRank;
|
52
|
protected boolean allowOverrideOrderAreas;
|
53
|
protected boolean overrideOrderAreas;
|
54
|
protected boolean allowOverrideAreaDisplay;
|
55
|
protected boolean overrideAreaDisplay;
|
56
|
protected boolean allowOverrideStatusDisplay;
|
57
|
protected boolean overrideStatusDisplay;
|
58
|
Combo statusDisplaySelectionCombo;
|
59
|
Combo areaDisplaySelectionCombo;
|
60
|
|
61
|
protected String commandHandlerString;
|
62
|
protected String commandHandlerStringStatus;
|
63
|
|
64
|
protected CdmPreference distributionEditorPref;
|
65
|
Composite child ;
|
66
|
protected boolean isAllowOverride;
|
67
|
|
68
|
@Override
|
69
|
protected Control createContents(Composite parent) {
|
70
|
|
71
|
Composite composite = new Composite(parent, SWT.NULL);
|
72
|
composite.setLayout(new GridLayout());
|
73
|
|
74
|
|
75
|
if (isAllowOverride || isAdminPreference){
|
76
|
Composite activateComp = createComposite(composite);
|
77
|
final Button activateCheckButton = new Button(activateComp, SWT.CHECK);
|
78
|
activateCheckButton.setText(Messages.ChecklistEditorGeneralPreference_enable);
|
79
|
activateCheckButton.setSelection(isEditorActivated);
|
80
|
activateCheckButton.addSelectionListener(new SelectionAdapter(){
|
81
|
@Override
|
82
|
public void widgetSelected(SelectionEvent e) {
|
83
|
isEditorActivated = activateCheckButton.getSelection();
|
84
|
if(!isAdminPreference){
|
85
|
overrideActivated = true;
|
86
|
}
|
87
|
|
88
|
if(isEditorActivated){
|
89
|
child.setVisible(true);
|
90
|
child.setEnabled(true);
|
91
|
}else{
|
92
|
child.setVisible(false);
|
93
|
child.setEnabled(false);
|
94
|
}
|
95
|
|
96
|
}
|
97
|
});
|
98
|
|
99
|
if (isAdminPreference){
|
100
|
Button allowOverrideActivatedButton = createAllowOverrideButton(activateComp);
|
101
|
allowOverrideActivatedButton.setSelection(allowOverrideActivated);
|
102
|
|
103
|
allowOverrideActivatedButton.addSelectionListener(new SelectionAdapter(){
|
104
|
@Override
|
105
|
public void widgetSelected(SelectionEvent e) {
|
106
|
allowOverrideActivated = allowOverrideActivatedButton.getSelection();
|
107
|
}
|
108
|
});
|
109
|
}
|
110
|
|
111
|
|
112
|
child = createComposite(composite);
|
113
|
|
114
|
child.setVisible(isEditorActivated);
|
115
|
Label separator= new Label(child, SWT.HORIZONTAL | SWT.SEPARATOR);
|
116
|
GridData sepGrid = new GridData(GridData.FILL_HORIZONTAL);
|
117
|
if (isAdminPreference){
|
118
|
sepGrid.horizontalSpan = 2;
|
119
|
}
|
120
|
|
121
|
GridData textGrid = new GridData(GridData.FILL_HORIZONTAL);
|
122
|
if (isAdminPreference){
|
123
|
textGrid.horizontalSpan = 2;
|
124
|
}
|
125
|
textGrid.verticalSpan = 2;
|
126
|
separator.setLayoutData(sepGrid);
|
127
|
|
128
|
|
129
|
final Button activateRankButton = new Button(child, SWT.CHECK);
|
130
|
activateRankButton.setText(Messages.ChecklistEditorGeneralPreference_show_rank);
|
131
|
activateRankButton.setSelection(isShowRank);
|
132
|
activateRankButton.addSelectionListener(new SelectionAdapter(){
|
133
|
@Override
|
134
|
public void widgetSelected(SelectionEvent e) {
|
135
|
if(!isAdminPreference){
|
136
|
overrideRank = true;
|
137
|
}
|
138
|
isShowRank = activateRankButton.getSelection();
|
139
|
}
|
140
|
});
|
141
|
|
142
|
if (isAdminPreference){
|
143
|
Button allowOverrideRankButton = createAllowOverrideButton(child);
|
144
|
allowOverrideRankButton.setSelection(allowOverrideRank);
|
145
|
|
146
|
allowOverrideRankButton.addSelectionListener(new SelectionAdapter(){
|
147
|
@Override
|
148
|
public void widgetSelected(SelectionEvent e) {
|
149
|
allowOverrideRank = allowOverrideRankButton.getSelection();
|
150
|
}
|
151
|
});
|
152
|
}else{
|
153
|
if (!allowOverrideRank){
|
154
|
activateRankButton.setEnabled(false);
|
155
|
}
|
156
|
}
|
157
|
|
158
|
|
159
|
final Button sortNamedAreaByVocabularyOrder = new Button(child, SWT.CHECK);
|
160
|
sortNamedAreaByVocabularyOrder.setText(Messages.ChecklistEditorGeneralPreference_sort_areas);
|
161
|
sortNamedAreaByVocabularyOrder.setSelection(isSortByVocabularyOrder);
|
162
|
sortNamedAreaByVocabularyOrder.addSelectionListener(new SelectionAdapter(){
|
163
|
@Override
|
164
|
public void widgetSelected(SelectionEvent e) {
|
165
|
if(!isAdminPreference){
|
166
|
overrideOrderAreas = true;
|
167
|
}
|
168
|
isSortByVocabularyOrder = sortNamedAreaByVocabularyOrder.getSelection();
|
169
|
}
|
170
|
});
|
171
|
|
172
|
if (isAdminPreference){
|
173
|
Button allowOverrideOrderAreasButton = createAllowOverrideButton(child);
|
174
|
allowOverrideOrderAreasButton.setSelection(allowOverrideOrderAreas);
|
175
|
|
176
|
allowOverrideOrderAreasButton.addSelectionListener(new SelectionAdapter(){
|
177
|
@Override
|
178
|
public void widgetSelected(SelectionEvent e) {
|
179
|
allowOverrideOrderAreas = allowOverrideOrderAreasButton.getSelection();
|
180
|
}
|
181
|
});
|
182
|
}else{
|
183
|
if (!allowOverrideOrderAreas){
|
184
|
sortNamedAreaByVocabularyOrder.setEnabled(false);
|
185
|
}
|
186
|
}
|
187
|
|
188
|
final Button ownDescription = new Button(child, SWT.CHECK);
|
189
|
ownDescription.setText(Messages.ChecklistEditorGeneralPreference_own_Description);
|
190
|
ownDescription.setToolTipText(Messages.ChecklistEditorGeneralPreference_own_Description);
|
191
|
ownDescription.setSelection(ownDescriptionForDistributionEditor);
|
192
|
ownDescription.addSelectionListener(new SelectionAdapter(){
|
193
|
@Override
|
194
|
public void widgetSelected(SelectionEvent e) {
|
195
|
if(!isAdminPreference){
|
196
|
overrideOwnDescriptionForDistributionEditor = true;
|
197
|
}
|
198
|
ownDescriptionForDistributionEditor = ownDescription.getSelection();
|
199
|
}
|
200
|
});
|
201
|
|
202
|
if (isAdminPreference){
|
203
|
Button allowOverrideDescription = createAllowOverrideButton(child);
|
204
|
allowOverrideDescription.setSelection(allowOverrideOwnDescriptionForDistributionEditor);
|
205
|
|
206
|
allowOverrideDescription.addSelectionListener(new SelectionAdapter(){
|
207
|
@Override
|
208
|
public void widgetSelected(SelectionEvent e) {
|
209
|
allowOverrideOwnDescriptionForDistributionEditor = allowOverrideDescription.getSelection();
|
210
|
}
|
211
|
});
|
212
|
}else{
|
213
|
if (!allowOverrideOwnDescriptionForDistributionEditor){
|
214
|
ownDescription.setEnabled(false);
|
215
|
}
|
216
|
}
|
217
|
|
218
|
|
219
|
separator= new Label(child, SWT.HORIZONTAL | SWT.SEPARATOR);
|
220
|
separator.setLayoutData(sepGrid);
|
221
|
|
222
|
//
|
223
|
|
224
|
final CLabel description = new CLabel(child, SWT.NULL);
|
225
|
description.setText(Messages.ChecklistEditorGeneralPreference_Configure_display_of_Areas);
|
226
|
description.setLayoutData(textGrid);
|
227
|
|
228
|
GridData gridData = new GridData();
|
229
|
gridData = new GridData(GridData.BEGINNING, GridData.CENTER, true, false);
|
230
|
//gridData.horizontalIndent = 5;
|
231
|
|
232
|
|
233
|
areaDisplaySelectionCombo = new Combo(child, SWT.BORDER| SWT.READ_ONLY);
|
234
|
areaDisplaySelectionCombo.setLayoutData(gridData);
|
235
|
|
236
|
for(TermDisplayEnum display: TermDisplayEnum.values()){
|
237
|
areaDisplaySelectionCombo.add(display.getLabel());
|
238
|
}
|
239
|
int index = 0;
|
240
|
if (PreferencesUtil.getStringValue(EditorPreferencePredicate.DistributionEditorActivated.getKey()) != null){
|
241
|
TermDisplayEnum areaDisplay;
|
242
|
try{
|
243
|
areaDisplay = TermDisplayEnum.valueOf(displayArea);
|
244
|
}catch(IllegalArgumentException e){
|
245
|
areaDisplay = TermDisplayEnum.Title;
|
246
|
}
|
247
|
for (String itemLabel : areaDisplaySelectionCombo.getItems()){
|
248
|
if (itemLabel.equalsIgnoreCase(areaDisplay.getLabel())){
|
249
|
areaDisplaySelectionCombo.select(index);
|
250
|
break;
|
251
|
}
|
252
|
index++;
|
253
|
}
|
254
|
}
|
255
|
areaDisplaySelectionCombo.addSelectionListener(this);
|
256
|
|
257
|
if (isAdminPreference){
|
258
|
Button allowOverrideOrderAreaDisplayButton = createAllowOverrideButton(child);
|
259
|
allowOverrideOrderAreaDisplayButton.setSelection(allowOverrideAreaDisplay);
|
260
|
|
261
|
allowOverrideOrderAreaDisplayButton.addSelectionListener(new SelectionAdapter(){
|
262
|
@Override
|
263
|
public void widgetSelected(SelectionEvent e) {
|
264
|
allowOverrideAreaDisplay = allowOverrideOrderAreaDisplayButton.getSelection();
|
265
|
}
|
266
|
});
|
267
|
}else{
|
268
|
if (!allowOverrideAreaDisplay){
|
269
|
areaDisplaySelectionCombo.setEnabled(false);
|
270
|
}
|
271
|
}
|
272
|
|
273
|
final CLabel descriptionStatus = new CLabel(child, SWT.NULL);
|
274
|
descriptionStatus.setText(Messages.ChecklistEditorGeneralPreference_Configure_display_of_Status);
|
275
|
descriptionStatus.setLayoutData(textGrid);
|
276
|
|
277
|
|
278
|
|
279
|
statusDisplaySelectionCombo = new Combo(child, SWT.BORDER| SWT.READ_ONLY);
|
280
|
statusDisplaySelectionCombo.setLayoutData(gridData);
|
281
|
|
282
|
for(TermDisplayEnum display: TermDisplayEnum.values()){
|
283
|
statusDisplaySelectionCombo.add(display.getLabel());
|
284
|
}
|
285
|
index = 0;
|
286
|
if (PreferencesUtil.displayStatusInChecklistEditor() != null){
|
287
|
TermDisplayEnum statusDisplay = TermDisplayEnum.valueOf(displayStatus);
|
288
|
for (String itemLabel : areaDisplaySelectionCombo.getItems()){
|
289
|
if (itemLabel.equalsIgnoreCase(statusDisplay.getLabel())){
|
290
|
statusDisplaySelectionCombo.select(index);
|
291
|
break;
|
292
|
}
|
293
|
index++;
|
294
|
}
|
295
|
}
|
296
|
|
297
|
statusDisplaySelectionCombo.addSelectionListener(this);
|
298
|
if (isAdminPreference){
|
299
|
Button allowOverrideOrderStatusDisplayButton = createAllowOverrideButton(child);
|
300
|
allowOverrideOrderStatusDisplayButton.setSelection(allowOverrideStatusDisplay);
|
301
|
|
302
|
allowOverrideOrderStatusDisplayButton.addSelectionListener(new SelectionAdapter(){
|
303
|
@Override
|
304
|
public void widgetSelected(SelectionEvent e) {
|
305
|
allowOverrideStatusDisplay = allowOverrideOrderStatusDisplayButton.getSelection();
|
306
|
}
|
307
|
});
|
308
|
}else{
|
309
|
if (!allowOverrideStatusDisplay){
|
310
|
statusDisplaySelectionCombo.setEnabled(false);
|
311
|
}
|
312
|
}
|
313
|
|
314
|
// if (isAdminPreference){
|
315
|
// final CLabel labelStatus = new CLabel(child, SWT.NULL);
|
316
|
// labelStatus.setText(Messages.DistributionAdminPreferences_SELECT_STATUS);
|
317
|
// labelStatus.setLayoutData(textGrid);
|
318
|
//
|
319
|
// final CommandHandlerButton button_openStatusWizard = new CommandHandlerButton(child, SWT.PUSH,
|
320
|
// commandHandlerStringStatus); //$NON-NLS-1$
|
321
|
//
|
322
|
// button_openStatusWizard.setText(Messages.Distribution_status_selection);
|
323
|
//
|
324
|
// }
|
325
|
|
326
|
final CLabel label = new CLabel(child, SWT.NULL);
|
327
|
label.setText(Messages.ChecklistEditorGeneralPreference_open_wizard);
|
328
|
label.setLayoutData(textGrid);
|
329
|
final CommandHandlerButton button_openSelectAreas = new CommandHandlerButton(child, SWT.PUSH,
|
330
|
commandHandlerString);
|
331
|
button_openSelectAreas.setText(Messages.ChecklistEditorGeneralPreference_open_distribution_selection);
|
332
|
|
333
|
if (isAdminPreference){
|
334
|
createAllowOverrideButton(child);
|
335
|
}else{
|
336
|
if (!allowOverrideAreaVoc){
|
337
|
button_openSelectAreas.setEnabled(false);
|
338
|
}
|
339
|
}
|
340
|
// PreferencesUtil.recursiveSetEnabled(child, CdmStore.isActive());
|
341
|
|
342
|
if(isEditorActivated){
|
343
|
child.setEnabled(true);
|
344
|
}else{
|
345
|
child.setEnabled(false);
|
346
|
}
|
347
|
}else{
|
348
|
Label label = new Label(composite, SWT.NONE);
|
349
|
label.setText("The CDM settings don't allow to set the preferences for using the distribution editor locally. If you need to make local settings, please ask an administrator.");
|
350
|
|
351
|
}
|
352
|
setValid(true);
|
353
|
return composite;
|
354
|
}
|
355
|
|
356
|
|
357
|
|
358
|
private Button createAllowOverrideButton(Composite activateComp) {
|
359
|
final Button allowOverrideCheckButton = new Button(activateComp, SWT.CHECK);
|
360
|
allowOverrideCheckButton.setText(Messages.ChecklistEditorGeneralPreference_allowOverride);
|
361
|
return allowOverrideCheckButton;
|
362
|
}
|
363
|
|
364
|
@Override
|
365
|
public boolean performOk() {
|
366
|
if (isAllowOverride){
|
367
|
PreferencesUtil.setBooleanValue(EditorPreferencePredicate.DistributionEditorActivated.getKey(), isEditorActivated);
|
368
|
PreferencesUtil.setBooleanValue(IPreferenceKeys.DISTRIBUTION_AREA_PREFRENCES_ACTIVE_OVERRIDE, overrideActivated);
|
369
|
PreferencesUtil.setSortNamedAreasByOrderInVocabulary(isSortByVocabularyOrder);
|
370
|
PreferencesUtil.setBooleanValue(IPreferenceKeys.DISTRIBUTION_AREAS_SORTED_BY_IDINVOC_OVERRIDE, overrideOrderAreas);
|
371
|
PreferencesUtil.setShowRankInChecklistEditor(isShowRank);
|
372
|
PreferencesUtil.setBooleanValue(IPreferenceKeys.DISTRIBUTION_SHOW_RANK_OVERRIDE, overrideRank);
|
373
|
PreferencesUtil.setDisplayStatusInChecklistEditor(displayStatus);
|
374
|
PreferencesUtil.setBooleanValue(IPreferenceKeys.DISTRIBUTION_DISPLAY_STATUS_OVERRIDE, overrideStatusDisplay);
|
375
|
PreferencesUtil.setAreaDisplayInChecklistEditor(displayArea);
|
376
|
PreferencesUtil.setBooleanValue(IPreferenceKeys.DISTRIBUTION_DISPLAY_AREA_OVERRIDE, overrideAreaDisplay);
|
377
|
PreferencesUtil.setOwnDescriptionForChecklistEditor(ownDescriptionForDistributionEditor);
|
378
|
PreferencesUtil.setBooleanValue(IPreferenceKeys.OWN_DESCRIPTION_OVERRIDE, overrideOwnDescriptionForDistributionEditor);
|
379
|
|
380
|
|
381
|
}
|
382
|
return true;
|
383
|
}
|
384
|
|
385
|
/**
|
386
|
* {@inheritDoc}
|
387
|
*/
|
388
|
@Override
|
389
|
public void widgetSelected(SelectionEvent e) {
|
390
|
if (e.getSource().equals(statusDisplaySelectionCombo)){
|
391
|
String text = statusDisplaySelectionCombo.getText();
|
392
|
for (TermDisplayEnum display: TermDisplayEnum.values()){
|
393
|
if (display.getLabel().equals(text)){
|
394
|
displayStatus = display.getKey();
|
395
|
break;
|
396
|
}
|
397
|
}
|
398
|
}
|
399
|
if (e.getSource().equals(areaDisplaySelectionCombo)){
|
400
|
String text = areaDisplaySelectionCombo.getText();
|
401
|
for (TermDisplayEnum display: TermDisplayEnum.values()){
|
402
|
if (display.getLabel().equals(text)){
|
403
|
displayArea = display.getKey();
|
404
|
break;
|
405
|
}
|
406
|
}
|
407
|
}
|
408
|
|
409
|
}
|
410
|
|
411
|
/**
|
412
|
* {@inheritDoc}
|
413
|
*/
|
414
|
@Override
|
415
|
public void widgetDefaultSelected(SelectionEvent e) {
|
416
|
// TODO Auto-generated method stub
|
417
|
|
418
|
}
|
419
|
|
420
|
@Override
|
421
|
public void init() {
|
422
|
isAdminPreference = false;
|
423
|
setPreferenceStore(PreferencesUtil.getPreferenceStore());
|
424
|
distributionEditorPref = PreferencesUtil.getPreferenceFromDB(EditorPreferencePredicate.DistributionEditorActivated);
|
425
|
|
426
|
|
427
|
if (distributionEditorPref != null){
|
428
|
isAllowOverride = distributionEditorPref.isAllowOverride();
|
429
|
boolean test = PreferencesUtil.getBooleanValue(IPreferenceKeys.DISTRIBUTION_AREA_PREFRENCES_ACTIVE_OVERRIDE);
|
430
|
if (isAllowOverride && PreferencesUtil.getBooleanValue(IPreferenceKeys.DISTRIBUTION_AREA_PREFRENCES_ACTIVE_OVERRIDE)){
|
431
|
isEditorActivated = PreferencesUtil.getBooleanValue(EditorPreferencePredicate.DistributionEditorActivated.getKey());
|
432
|
}else{
|
433
|
isEditorActivated = Boolean.valueOf(distributionEditorPref.getValue());
|
434
|
}
|
435
|
}else{
|
436
|
isEditorActivated = PreferencesUtil.getBooleanValue(EditorPreferencePredicate.DistributionEditorActivated.getKey());
|
437
|
isAllowOverride = true;
|
438
|
}
|
439
|
CdmPreference prefStatus = PreferencesUtil.getPreferenceFromDB(PreferencePredicate.AvailableDistributionAreaVocabularies);
|
440
|
|
441
|
allowOverrideAreaVoc = prefStatus != null?prefStatus.isAllowOverride():false;
|
442
|
|
443
|
CdmPreference pref = PreferencesUtil.getPreferenceFromDB(EditorPreferencePredicate.DisplayOfAreasInDistributionEditor);
|
444
|
if (pref != null){
|
445
|
this.allowOverrideAreaDisplay = pref.isAllowOverride();
|
446
|
if (allowOverrideAreaDisplay){
|
447
|
displayArea = PreferencesUtil.getStringValue(EditorPreferencePredicate.DisplayOfAreasInDistributionEditor.getKey());
|
448
|
}else{
|
449
|
displayArea = pref.getValue();
|
450
|
}
|
451
|
}else{
|
452
|
displayArea = PreferencesUtil.getStringValue(EditorPreferencePredicate.DisplayOfAreasInDistributionEditor.getKey());
|
453
|
this.allowOverrideAreaDisplay = true;
|
454
|
}
|
455
|
|
456
|
pref = PreferencesUtil.getPreferenceFromDB(EditorPreferencePredicate.DisplayOfStatus);
|
457
|
if (pref != null){
|
458
|
this.allowOverrideStatusDisplay = pref.isAllowOverride();
|
459
|
if (allowOverrideStatusDisplay){
|
460
|
displayStatus = PreferencesUtil.displayStatusInChecklistEditor();
|
461
|
}else{
|
462
|
this.displayStatus = pref.getValue();
|
463
|
}
|
464
|
}else{
|
465
|
displayStatus = PreferencesUtil.displayStatusInChecklistEditor();
|
466
|
this.allowOverrideStatusDisplay = true;
|
467
|
}
|
468
|
|
469
|
pref = PreferencesUtil.getPreferenceFromDB(EditorPreferencePredicate.AreasSortedByIdInVocabulary);
|
470
|
if (pref != null){
|
471
|
|
472
|
this.allowOverrideOrderAreas = pref.isAllowOverride();
|
473
|
if (allowOverrideOrderAreas){
|
474
|
isSortByVocabularyOrder = PreferencesUtil.isSortNamedAreaByOrderInVocabulary();
|
475
|
}else{
|
476
|
this.isSortByVocabularyOrder = Boolean.valueOf(pref.getValue().toString());
|
477
|
}
|
478
|
}else{
|
479
|
isSortByVocabularyOrder = PreferencesUtil.isSortNamedAreaByOrderInVocabulary();
|
480
|
this.allowOverrideOrderAreas = true;
|
481
|
}
|
482
|
|
483
|
pref = PreferencesUtil.getPreferenceFromDB(EditorPreferencePredicate.ShowRankInDistributionEditor);
|
484
|
if (pref != null){
|
485
|
|
486
|
allowOverrideRank = pref.isAllowOverride();
|
487
|
if (allowOverrideRank){
|
488
|
isShowRank = PreferencesUtil.isShowRankInChecklistEditor();
|
489
|
}else{
|
490
|
this.isShowRank = Boolean.valueOf(pref.getValue().toString());
|
491
|
}
|
492
|
}else{
|
493
|
isShowRank = PreferencesUtil.isShowRankInChecklistEditor();
|
494
|
this.allowOverrideRank = true;
|
495
|
}
|
496
|
|
497
|
pref = PreferencesUtil.getPreferenceFromDB(EditorPreferencePredicate.OwnDescriptionForDistributionEditor);
|
498
|
if (pref != null){
|
499
|
|
500
|
allowOverrideOwnDescriptionForDistributionEditor = pref.isAllowOverride();
|
501
|
if (allowOverrideOwnDescriptionForDistributionEditor){
|
502
|
ownDescriptionForDistributionEditor = PreferencesUtil.isOwnDescriptionForChecklistEditor();
|
503
|
}else{
|
504
|
ownDescriptionForDistributionEditor = Boolean.valueOf(pref.getValue().toString());
|
505
|
}
|
506
|
}else{
|
507
|
ownDescriptionForDistributionEditor = PreferencesUtil.isShowRankInChecklistEditor();
|
508
|
ownDescriptionForDistributionEditor = true;
|
509
|
}
|
510
|
|
511
|
|
512
|
commandHandlerString = "eu.etaxonomy.taxeditor.store.open.OpenDistributionEditorWizardHandler";
|
513
|
commandHandlerStringStatus = "eu.etaxonomy.taxeditor.store.open.OpenDistributionStatusWizardHandler";
|
514
|
|
515
|
}
|
516
|
}
|