Project

General

Profile

« Previous | Next » 

Revision c2a446b0

Added by Katja Luther over 4 years ago

ref #8385: fixes in preferences - getDefaults() for all pages

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/SpecimenOrObservationPreferences.java
121 121
        showSpecimenButton.addSelectionListener(this);
122 122
        int index = 0;
123 123
        for (String itemLabel : showSpecimenButton.getItems()) {
124
            if (isShowSpecimenRelatedIssues == null && itemLabel.equals(Messages.Preference_Use_Default)) {
124
            if (isShowSpecimenRelatedIssues == null && itemLabel.startsWith(Messages.Preference_Use_Default)) {
125 125
                showSpecimenButton.select(index);
126 126
                break;
127 127
            }
......
161 161
        showCollectingAreaInGeneralSectionButton.addSelectionListener(this);
162 162
        index = 0;
163 163
        for (String itemLabel : showCollectingAreaInGeneralSectionButton.getItems()) {
164
            if (isShowCollectingAreaInGeneralSection == null && itemLabel.equals(Messages.Preference_Use_Default)) {
164
            if (isShowCollectingAreaInGeneralSection == null && itemLabel.startsWith(Messages.Preference_Use_Default)) {
165 165
                showCollectingAreaInGeneralSectionButton.select(index);
166 166
                break;
167 167
            }
......
196 196
        determinationOnlyForFieldUnitsButton.addSelectionListener(this);
197 197
        index = 0;
198 198
        for (String itemLabel : determinationOnlyForFieldUnitsButton.getItems()) {
199
            if (isDeterminationOnlyForFieldUnits == null && itemLabel.equals(Messages.Preference_Use_Default)) {
199
            if (isDeterminationOnlyForFieldUnits == null && itemLabel.startsWith(Messages.Preference_Use_Default)) {
200 200
                determinationOnlyForFieldUnitsButton.select(index);
201 201
                break;
202 202
            }
......
232 232
        showTaxonAssociationButton.addSelectionListener(this);
233 233
        index = 0;
234 234
        for (String itemLabel : showTaxonAssociationButton.getItems()) {
235
            if (isShowTaxonAssociation == null && itemLabel.equals(Messages.Preference_Use_Default)) {
235
            if (isShowTaxonAssociation == null && itemLabel.startsWith(Messages.Preference_Use_Default)) {
236 236
                showTaxonAssociationButton.select(index);
237 237
                break;
238 238
            }
......
267 267

  
268 268
        index = 0;
269 269
        for (String itemLabel: showLifeFormButton.getItems()) {
270
            if (isShowLifeForm == null && itemLabel.equals(Messages.Preference_Use_Default)) {
270
            if (isShowLifeForm == null && itemLabel.startsWith(Messages.Preference_Use_Default)) {
271 271
                showLifeFormButton.select(index);
272 272
                break;
273 273
            }
......
510 510

  
511 511
    @Override
512 512
    protected void performDefaults() {
513
        isShowSpecimenRelatedIssues = (Boolean)PreferencePredicate.ShowSpecimen.getDefaultValue();
514
        if (isShowSpecimenRelatedIssues){
515
            showSpecimenButton.select(0);
516
        }else{
517
            showSpecimenButton.select(1);
518
        }
513
        isShowSpecimenRelatedIssues = null;
514
        showSpecimenButton.select(0);
515

  
519 516
        if (allowOverrideIsShowSpecimenRelatedIssuesButton != null){
520 517
            allowOverrideShowSpecimenRelatedIssues = true;
521 518
            allowOverrideIsShowSpecimenRelatedIssuesButton.setSelection(allowOverrideShowSpecimenRelatedIssues);
522 519
        }
523
        isShowCollectingAreaInGeneralSection = (Boolean)PreferencePredicate.ShowCollectingAreasInGeneralSection.getDefaultValue();
524
        if (isShowCollectingAreaInGeneralSection){
525
            showCollectingAreaInGeneralSectionButton.select(0);
526
        }else{
527
            showCollectingAreaInGeneralSectionButton.select(1);
528
        }
520
        isShowCollectingAreaInGeneralSection = null;
521
        showCollectingAreaInGeneralSectionButton.select(0);
522

  
529 523
        if (allowOverrideShowCollectingAreaButton != null){
530 524
            allowOverrideShowCollectingAreaInGeneralSection = true;
531 525
            allowOverrideShowCollectingAreaButton.setSelection(allowOverrideShowSpecimenRelatedIssues);
532 526
        }
533
        isDeterminationOnlyForFieldUnits = (Boolean) PreferencePredicate.DeterminationOnlyForFieldUnits.getDefaultValue();
534
        if (isDeterminationOnlyForFieldUnits){
535
            determinationOnlyForFieldUnitsButton.select(0);
536
        }else{
537
            determinationOnlyForFieldUnitsButton.select(1);
538
        }
527
        isDeterminationOnlyForFieldUnits = null;
528
        determinationOnlyForFieldUnitsButton.select(0);
529

  
539 530
        if (allowOverridesDeterminationOnlyForFieldUnitsButton != null){
540 531
            allowOverrideDeterminationOnlyForFieldUnits = true;
541 532
            allowOverridesDeterminationOnlyForFieldUnitsButton.setSelection(allowOverrideShowSpecimenRelatedIssues);
542 533
        }
543 534

  
544
        isShowTaxonAssociation = (Boolean) PreferencePredicate.ShowTaxonAssociations.getDefaultValue();
545
        if (isShowTaxonAssociation){
546
            showTaxonAssociationButton.select(0);
547
        }else{
548
            showTaxonAssociationButton.select(1);
549
        }
535
        isShowTaxonAssociation = null;
536
        showTaxonAssociationButton.select(0);
537

  
550 538
        if (allowOverrideIsShowTaxonAssociationButton != null){
551 539
            allowOverrideShowTaxonAssociation = true;
552 540
            allowOverrideIsShowTaxonAssociationButton.setSelection(allowOverrideShowSpecimenRelatedIssues);
553 541
        }
554 542

  
555 543

  
556
        isShowLifeForm = (Boolean) PreferencePredicate.ShowLifeForm.getDefaultValue();
544
        isShowLifeForm = null;
545

  
546
        showLifeFormButton.select(0);
557 547

  
558
        if (isShowLifeForm){
559
            showLifeFormButton.select(0);
560
        }else{
561
            showLifeFormButton.select(1);
562
        }
563 548
        if (allowOverrideShowLifeFormButton != null){
564 549
            allowOverrideShowLifeForm = true;
565 550
            allowOverrideShowLifeFormButton.setSelection(allowOverrideShowSpecimenRelatedIssues);
......
577 562
       setApply(true);
578 563
       if (e.getSource().equals(this.showSpecimenButton)) {
579 564
           String text = showSpecimenButton.getText();
580
           if(text.equals(Messages.Preference_Use_Default)){
565
           if(text.startsWith(Messages.Preference_Use_Default)){
581 566
               isShowSpecimenRelatedIssues = null;
582 567
               if (isAdminPreference){
583 568
                   allowOverrideIsShowSpecimenRelatedIssuesButton.setSelection(true);
......
593 578

  
594 579
       if (e.getSource().equals(this.showCollectingAreaInGeneralSectionButton)) {
595 580
           String text = showCollectingAreaInGeneralSectionButton.getText();
596
           if(text.equals(Messages.Preference_Use_Default)){
581
           if(text.startsWith(Messages.Preference_Use_Default)){
597 582
               isShowCollectingAreaInGeneralSection = null;
598 583
               if (isAdminPreference){
599 584
                   //showCollectingAreaInGeneralSection.setAllowOverride(true);
......
610 595

  
611 596
       if (e.getSource().equals(this.determinationOnlyForFieldUnitsButton)) {
612 597
           String text = determinationOnlyForFieldUnitsButton.getText();
613
           if(text.equals(Messages.Preference_Use_Default)){
598
           if(text.startsWith(Messages.Preference_Use_Default)){
614 599
               isDeterminationOnlyForFieldUnits = null;
615 600
               if (isAdminPreference){
616 601
                   //showDeterminationOnlyForFieldUnits.setAllowOverride(true);
......
627 612

  
628 613
       if (e.getSource().equals(this.showTaxonAssociationButton)) {
629 614
           String text = showTaxonAssociationButton.getText();
630
           if(text.equals(Messages.Preference_Use_Default)){
615
           if(text.startsWith(Messages.Preference_Use_Default)){
631 616
               isShowTaxonAssociation = null;
632 617
               if (isAdminPreference){
633 618
                   //showTaxonAssociation.setAllowOverride(true);
......
644 629

  
645 630
       if (e.getSource().equals(this.showLifeFormButton)) {
646 631
           String text = showLifeFormButton.getText();
647
           if(text.equals(Messages.Preference_Use_Default)){
632
           if(text.startsWith(Messages.Preference_Use_Default)){
648 633
               isShowLifeForm = null;
649 634
               if (isAdminPreference){
650 635
                   //showLifeForm.setAllowOverride(true);

Also available in: Unified diff