Revision 79bd864f
Added by Katja Luther over 4 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/ChecklistEditorGeneralPreference.java | ||
---|---|---|
182 | 182 |
if (isAdminPreference) { |
183 | 183 |
allowOverrideRankButton = createAllowOverrideButton(child); |
184 | 184 |
allowOverrideRankButton.setSelection(prefRank != null? prefRank.isAllowOverride():true); |
185 |
allowOverrideRankButton.setEnabled(prefRank != null); |
|
185 |
// allowOverrideRankButton.setEnabled(prefRank != null);
|
|
186 | 186 |
allowOverrideRankButton.addSelectionListener(new SelectionAdapter() { |
187 | 187 |
@Override |
188 | 188 |
public void widgetSelected(SelectionEvent e) { |
... | ... | |
216 | 216 |
if (isAdminPreference) { |
217 | 217 |
allowOverrideOrderAreasButton = createAllowOverrideButton(child); |
218 | 218 |
allowOverrideOrderAreasButton.setSelection(prefAreaSort != null? prefAreaSort.isAllowOverride(): true); |
219 |
allowOverrideOrderAreasButton.setEnabled(prefAreaSort != null); |
|
219 |
//allowOverrideOrderAreasButton.setEnabled(prefAreaSort != null);
|
|
220 | 220 |
allowOverrideOrderAreasButton.addSelectionListener(new SelectionAdapter() { |
221 | 221 |
@Override |
222 | 222 |
public void widgetSelected(SelectionEvent e) { |
... | ... | |
252 | 252 |
if (isAdminPreference) { |
253 | 253 |
allowOverrideAreaDisplayButton = createAllowOverrideButton(child); |
254 | 254 |
allowOverrideAreaDisplayButton.setSelection(prefAreaDisplay != null? prefAreaDisplay.isAllowOverride(): true); |
255 |
allowOverrideAreaDisplayButton.setEnabled(prefAreaDisplay != null); |
|
255 |
//allowOverrideAreaDisplayButton.setEnabled(prefAreaDisplay != null);
|
|
256 | 256 |
allowOverrideAreaDisplayButton.addSelectionListener(new SelectionAdapter() { |
257 | 257 |
@Override |
258 | 258 |
public void widgetSelected(SelectionEvent e) { |
... | ... | |
287 | 287 |
if (isAdminPreference) { |
288 | 288 |
allowOverrideStatusDisplayButton = createAllowOverrideButton(child); |
289 | 289 |
allowOverrideStatusDisplayButton.setSelection(prefStatusDisplay != null ? prefStatusDisplay.isAllowOverride(): true); |
290 |
allowOverrideStatusDisplayButton.setEnabled(prefStatusDisplay != null); |
|
290 |
//allowOverrideStatusDisplayButton.setEnabled(prefStatusDisplay != null);
|
|
291 | 291 |
allowOverrideStatusDisplayButton.addSelectionListener(new SelectionAdapter() { |
292 | 292 |
@Override |
293 | 293 |
public void widgetSelected(SelectionEvent e) { |
... | ... | |
322 | 322 |
if (isAdminPreference) { |
323 | 323 |
allowOverrideStatusDisplayInComboButton = createAllowOverrideButton(child); |
324 | 324 |
allowOverrideStatusDisplayInComboButton.setSelection(prefStatusDisplayInCombo != null ? prefStatusDisplayInCombo.isAllowOverride(): true); |
325 |
allowOverrideStatusDisplayInComboButton.setEnabled(prefStatusDisplayInCombo != null); |
|
325 |
//allowOverrideStatusDisplayInComboButton.setEnabled(prefStatusDisplayInCombo != null);
|
|
326 | 326 |
allowOverrideStatusDisplayInComboButton.addSelectionListener(new SelectionAdapter() { |
327 | 327 |
@Override |
328 | 328 |
public void widgetSelected(SelectionEvent e) { |
... | ... | |
446 | 446 |
String text = statusDisplaySelectionCombo.getText(); |
447 | 447 |
if(text.startsWith(Messages.Preference_Use_Default)){ |
448 | 448 |
displayStatus = null; |
449 |
if(isAdminPreference){ |
|
450 |
prefStatusDisplay.setAllowOverride(true); |
|
451 |
allowOverrideStatusDisplayButton.setSelection(true); |
|
452 |
allowOverrideStatusDisplayButton.setEnabled(false); |
|
453 |
} |
|
454 |
|
|
455 | 449 |
return; |
456 | 450 |
} |
457 |
allowOverrideStatusDisplayButton.setEnabled(true); |
|
451 |
|
|
458 | 452 |
for (TermDisplayEnum display : TermDisplayEnum.values()) { |
459 | 453 |
if (text.startsWith(display.getLabel())) { |
460 | 454 |
displayStatus = display; |
... | ... | |
467 | 461 |
String text = statusDisplayInComboSelectionCombo.getText(); |
468 | 462 |
if(text.startsWith(Messages.Preference_Use_Default)){ |
469 | 463 |
displayStatusCombo = null; |
470 |
if(isAdminPreference){ |
|
471 |
prefStatusDisplayInCombo.setAllowOverride(true); |
|
472 |
allowOverrideStatusDisplayInComboButton.setSelection(true); |
|
473 |
allowOverrideStatusDisplayInComboButton.setEnabled(false); |
|
474 |
} |
|
475 |
|
|
476 | 464 |
return; |
477 | 465 |
} |
478 |
allowOverrideStatusDisplayInComboButton.setEnabled(true); |
|
466 |
|
|
479 | 467 |
for (TermComboEnum display : TermComboEnum.values()) { |
480 | 468 |
if (text.startsWith(display.getLabel())) { |
481 | 469 |
displayStatusCombo = display; |
... | ... | |
488 | 476 |
String text = areaDisplaySelectionCombo.getText(); |
489 | 477 |
if(text.startsWith(Messages.Preference_Use_Default)){ |
490 | 478 |
displayArea = null; |
491 |
if (isAdminPreference){ |
|
492 |
prefAreaDisplay.setAllowOverride(true); |
|
493 |
allowOverrideAreaDisplayButton.setSelection(true); |
|
494 |
allowOverrideAreaDisplayButton.setEnabled(false); |
|
495 |
} |
|
496 | 479 |
return; |
497 | 480 |
} |
498 |
allowOverrideAreaDisplayButton.setEnabled(true); |
|
481 |
|
|
499 | 482 |
for (TermDisplayEnum display : TermDisplayEnum.values()) { |
500 | 483 |
if (text.startsWith(display.getLabel())) { |
501 | 484 |
displayArea = display; |
... | ... | |
507 | 490 |
String text = areaOrderSelectionCombo.getText(); |
508 | 491 |
if(text.startsWith(Messages.Preference_Use_Default)){ |
509 | 492 |
orderAreas = null; |
510 |
if (isAdminPreference){ |
|
511 |
prefAreaSort.setAllowOverride(true); |
|
512 |
allowOverrideOrderAreasButton.setSelection(true); |
|
513 |
allowOverrideOrderAreasButton.setEnabled(false); |
|
514 |
} |
|
515 | 493 |
return; |
516 | 494 |
} |
517 |
allowOverrideOrderAreasButton.setEnabled(true); |
|
495 |
|
|
518 | 496 |
for (TermOrder display : TermOrder.values()) { |
519 | 497 |
if (text.startsWith(display.getLabel())) { |
520 | 498 |
orderAreas = display; |
... | ... | |
526 | 504 |
String text = activateRankCombo.getText(); |
527 | 505 |
if(text.startsWith(Messages.Preference_Use_Default)){ |
528 | 506 |
isShowRank = null; |
529 |
if (isAdminPreference){ |
|
530 |
prefRank.setAllowOverride(true); |
|
531 |
allowOverrideRankButton.setSelection(true); |
|
532 |
allowOverrideRankButton.setEnabled(false); |
|
533 |
} |
|
534 | 507 |
return; |
535 | 508 |
} |
536 |
allowOverrideRankButton.setEnabled(true); |
|
509 |
|
|
537 | 510 |
if (text.equals(SHOW_RANK)){ |
538 | 511 |
isShowRank = true; |
539 | 512 |
}else{ |
... | ... | |
545 | 518 |
String text = activateCombo.getText(); |
546 | 519 |
if(text.startsWith(Messages.Preference_Use_Default)){ |
547 | 520 |
isEditorActivated = null; |
548 |
if (isAdminPreference){ |
|
549 |
if (distributionEditorPref == null){ |
|
550 |
distributionEditorPref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.DistributionEditorActivated, PreferencePredicate.DistributionEditorActivated.getDefaultValue() != null ? PreferencePredicate.DistributionEditorActivated.getDefaultValue().toString(): null); |
|
551 |
} |
|
552 |
distributionEditorPref.setAllowOverride(true); |
|
553 |
allowOverrideActivatedButton.setSelection(true); |
|
554 |
allowOverrideActivatedButton.setEnabled(false); |
|
555 |
} |
|
556 | 521 |
return; |
557 | 522 |
} |
558 |
allowOverrideActivatedButton.setEnabled(true); |
|
523 |
|
|
559 | 524 |
if (text.equals(ENABLE)){ |
560 | 525 |
isEditorActivated = true; |
561 | 526 |
}else{ |
... | ... | |
563 | 528 |
} |
564 | 529 |
|
565 | 530 |
} |
566 |
//PreferencesUtil.recursiveSetEnabled(child, isEditorActivated); |
|
531 |
|
|
567 | 532 |
} |
568 | 533 |
|
569 | 534 |
/** |
... | ... | |
594 | 559 |
} |
595 | 560 |
|
596 | 561 |
} else { |
597 |
isEditorActivated = Boolean.valueOf(distributionEditorPref.getValue());
|
|
562 |
isEditorActivated = distributionEditorPref.getValue() != null? Boolean.valueOf(distributionEditorPref.getValue()): null;
|
|
598 | 563 |
} |
599 | 564 |
|
600 | 565 |
} else { |
... | ... | |
622 | 587 |
displayArea = null; |
623 | 588 |
} |
624 | 589 |
} else { |
625 |
displayArea = TermDisplayEnum.byKey(prefAreaDisplay.getValue());
|
|
590 |
displayArea = prefAreaDisplay.getValue() != null? TermDisplayEnum.byKey(prefAreaDisplay.getValue()): null;
|
|
626 | 591 |
} |
627 | 592 |
} else { |
628 | 593 |
if (overrideAreaDisplay){ |
... | ... | |
645 | 610 |
displayStatus = null; |
646 | 611 |
} |
647 | 612 |
} else { |
648 |
this.displayStatus = TermDisplayEnum.byKey(prefStatusDisplay.getValue());
|
|
613 |
this.displayStatus = prefStatusDisplay.getValue() != null? TermDisplayEnum.byKey(prefStatusDisplay.getValue()): null;
|
|
649 | 614 |
} |
650 | 615 |
} else { |
651 | 616 |
if (overrideStatusDisplay){ |
... | ... | |
668 | 633 |
displayStatusCombo = null; |
669 | 634 |
} |
670 | 635 |
} else { |
671 |
this.displayStatusCombo = TermComboEnum.byKey(prefStatusDisplayInCombo.getValue());
|
|
636 |
this.displayStatusCombo = prefStatusDisplayInCombo.getValue() != null? TermComboEnum.byKey(prefStatusDisplayInCombo.getValue()): null;
|
|
672 | 637 |
} |
673 | 638 |
} else { |
674 | 639 |
if (overrideStatusDisplayCombo){ |
... | ... | |
693 | 658 |
} |
694 | 659 |
} else { |
695 | 660 |
if (prefAreaSort.getValue() != null) { |
696 |
orderAreas = TermOrder.valueOf(prefAreaSort.getValue().toString());
|
|
661 |
orderAreas = prefAreaSort.getValue() != null? TermOrder.valueOf(prefAreaSort.getValue().toString()): null;
|
|
697 | 662 |
} else { |
698 | 663 |
orderAreas = ((TermOrder) PreferencePredicate.AreasSortedInDistributionEditor.getDefaultValue()); |
699 | 664 |
} |
... | ... | |
719 | 684 |
} |
720 | 685 |
|
721 | 686 |
} else { |
722 |
this.isShowRank = Boolean.valueOf(prefRank.getValue().toString());
|
|
687 |
this.isShowRank = prefRank.getValue() != null? Boolean.valueOf(prefRank.getValue().toString()): null;
|
|
723 | 688 |
} |
724 | 689 |
} else { |
725 | 690 |
if (overrideRank){ |
... | ... | |
737 | 702 |
if (prefOwnDescription.isAllowOverride()) { |
738 | 703 |
ownDescriptionForDistributionEditor = PreferencesUtil.isOwnDescriptionForChecklistEditor(); |
739 | 704 |
} else { |
740 |
ownDescriptionForDistributionEditor = Boolean.valueOf(prefOwnDescription.getValue().toString());
|
|
705 |
ownDescriptionForDistributionEditor = prefOwnDescription.getValue() != null? Boolean.valueOf(prefOwnDescription.getValue().toString()): null;
|
|
741 | 706 |
} |
742 | 707 |
} else { |
743 | 708 |
ownDescriptionForDistributionEditor = PreferencesUtil.isShowRankInChecklistEditor(); |
Also available in: Unified diff
ref #8389: revert disabling of allowOverride for default selection