Project

General

Profile

« Previous | Next » 

Revision 38eaa3c8

Added by Patrick Plitzner over 7 years ago

fix #6059 Save expand state for details view, supplemental view
including sub sections

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java
48 48
import eu.etaxonomy.cdm.model.reference.Reference;
49 49
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
50 50
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
51
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
51 52
import eu.etaxonomy.taxeditor.model.AbstractUtility;
52 53
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
53 54
import eu.etaxonomy.taxeditor.model.IDerivedUnitFacadePart;
......
327 328

  
328 329
        EmptySection emptySection = formFactory.createEmptySection(formFactory, parent, SWT.NONE);
329 330

  
330
        addPart(emptySection, false);
331
        addPart(emptySection);
331 332
    }
332 333

  
333 334
    private void createGroupSection(RootElement parent) {
......
337 338
        MemberDetailSection memberDetailSection = formFactory.createMemberDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
338 339
        GrantedAuthorityDetailSection grantedAuthorityDetailSection = formFactory.createGrantedAuthorityDetailSection(getConversationHolder(), parent,ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
339 340

  
340
        addPart(groupDetailSection, true);
341
        addPart(memberDetailSection, true);
342
        addPart(grantedAuthorityDetailSection, true);
341
        addPart(groupDetailSection);
342
        addPart(memberDetailSection);
343
        addPart(grantedAuthorityDetailSection);
343 344
    }
344 345

  
345 346
    /** {@inheritDoc} */
......
368 369
            		ExpandableComposite.TWISTIE	| ExpandableComposite.EXPANDED);
369 370
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
370 371

  
371
            addPart(taxonBaseDetailSection, true);
372
            addPart(taxonBaseDetailSection);
372 373
        }
373 374
        NonViralNameDetailSection nonViralNameSection = formFactory
374 375
                .createNonViralNameDetailSection(getConversationHolder(), parent, this, true,
......
383 384
            		ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
384 385
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
385 386

  
386
            addPart(nomenclaturalStatusSection, true);
387
            addPart(referenceDetailSection, true);
387
            addPart(nomenclaturalStatusSection);
388
            addPart(referenceDetailSection);
388 389
        }
389 390
        //TODO RL
390 391
        if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)  && !PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION)){
......
397 398
	        NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
398 399
	        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
399 400

  
400
			addPart(protologSection, false);
401
			addPart(typeDesignationSection, false);
402
			addPart(nameRelationshipSection, false);
401
			addPart(protologSection);
402
			addPart(typeDesignationSection);
403
			addPart(nameRelationshipSection);
403 404
        }
404 405

  
405
        addPart(parsingMessagesSection, true);
406
        addPart(parsingMessagesSection);
406 407

  
407
        addPart(nonViralNameSection, true);
408
        addPart(nonViralNameSection);
408 409

  
409 410
    }
410 411

  
......
423 424
        		ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
424 425
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
425 426

  
426
        addPart(nonViralNameSection, true);
427
        addPart(nomenclaturalStatusSection, true);
428
        addPart(referenceDetailSection, true);
427
        addPart(nonViralNameSection);
428
        addPart(nomenclaturalStatusSection);
429
        addPart(referenceDetailSection);
429 430
//TODO RL
430 431
        if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
431 432
			ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
......
436 437

  
437 438
	        NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
438 439
	        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
439
	        addPart(protologSection, false);
440
	        addPart(typeDesignationSection, false);
441
	        addPart(nameRelationshipSection, false);
440
	        addPart(protologSection);
441
	        addPart(typeDesignationSection);
442
	        addPart(nameRelationshipSection);
442 443
        }
443 444
    }
444 445

  
......
448 449
        ReferenceDetailSection referenceDetailSection = formFactory.createReferenceDetailSection(getConversationHolder(), parent, this,
449 450
        		ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
450 451

  
451
        addPart(referenceDetailSection, true);
452
        addPart(referenceDetailSection);
452 453
    }
453 454

  
454 455
    private void createTeamOrPersonBaseDetailSection(RootElement parent) {
455 456
        destroySections();
456 457
        TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection = formFactory.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
457 458

  
458
        addPart(teamOrPersonBaseDetailSection, true);
459
        addPart(teamOrPersonBaseDetailSection);
459 460
    }
460 461

  
461 462
    private void createTeamDetailSection(RootElement parent) {
462 463
        destroySections();
463 464
        TeamDetailSection teamDetailSection = formFactory.createTeamDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
464 465

  
465
        addPart(teamDetailSection, true);
466
        addPart(teamDetailSection);
466 467
    }
467 468

  
468 469
    private void createPersonDetailSection(RootElement parent) {
469 470
        destroySections();
470 471
        PersonDetailSection personDetailSection = formFactory.createPersonDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
471
        addPart(personDetailSection, true);
472
        addPart(personDetailSection);
472 473
    }
473 474

  
474 475
    private void createDescriptionElementSection(RootElement parent) {
......
486 487

  
487 488
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
488 489

  
489
        addPart(descriptionElementDetailSection, true);
490
        addPart(descriptionElementSourceSection, false);
491
        addPart(descriptionElementMediaSection, false);
490
        addPart(descriptionElementDetailSection);
491
        addPart(descriptionElementSourceSection);
492
        addPart(descriptionElementMediaSection);
492 493
    }
493 494

  
494 495
    private void createDescriptionSection(RootElement parent) {
......
515 516

  
516 517
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
517 518

  
518
        addPart(descriptionDetailSection, true);
519
        addPart(naturalLanguageSection, true);
519
        addPart(descriptionDetailSection);
520
        addPart(naturalLanguageSection);
520 521
//        addPart(describedSpecimenSection);
521 522
        //		addPart(descriptionSourceSection);
522
        addPart(scopeSection, false);
523
        addPart(scopeSection);
523 524
    }
524 525

  
525 526
    private void createSpecimenDescriptionSection(RootElement parent) {
526 527
        destroySections();
527 528
        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
528
        addPart(descriptionDetailSection, true);
529
        addPart(descriptionDetailSection);
529 530
    }
530 531

  
531 532
    private void createUseDescriptionSection(RootElement parent) {
......
538 539

  
539 540
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
540 541

  
541
        addPart(descriptionDetailSection, true);
542
        addPart(descriptionSourceSection, true);
542
        addPart(descriptionDetailSection);
543
        addPart(descriptionSourceSection);
543 544

  
544 545
    }
545 546

  
......
547 548
        destroySections();
548 549
        DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
549 550

  
550
        addPart(descriptionDetailSection, true);
551
        addPart(descriptionDetailSection);
551 552
    }
552 553

  
553 554
    private void createMediaElementSection(RootElement parent) {
......
555 556

  
556 557
        MediaDetailsSection mediaDetailSection = formFactory.createMediaDetailsSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
557 558

  
558
        addPart(mediaDetailSection, true);
559
        addPart(mediaDetailSection);
559 560
    }
560 561

  
561 562
    private void createDerivedUnitBaseElementSection(RootElement parent) {
......
566 567
        if(!(AbstractUtility.getActivePart() instanceof IDerivedUnitFacadePart)){
567 568
            derivedUnitGeneralDetailSection.setShowOnlyDerivedUnitData(true);
568 569
        }
569
        addPart(derivedUnitGeneralDetailSection, true);
570
        addPart(derivedUnitGeneralDetailSection);
570 571

  
571 572
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
572 573

  
573 574
        DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
574
        addPart(derivedUnitBaseDetailSection, true);
575
        addPart(derivedUnitBaseDetailSection);
575 576

  
576 577
        //for editors working with facades
577 578
        if(AbstractUtility.getActivePart() instanceof IDerivedUnitFacadePart){
578 579
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
579 580
            GatheringEventDetailSection gatheringEventDetailSection = formFactory.createGatheringEventDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
580
            addPart(gatheringEventDetailSection, false);
581
            addPart(gatheringEventDetailSection);
581 582

  
582 583
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
583 584
            FieldUnitDetailSection fieldUnitDetailSection = formFactory.createFieldUnitDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
584
            addPart(fieldUnitDetailSection, false);
585
            addPart(fieldUnitDetailSection);
585 586
        }
586 587
        else{
587 588

  
588 589
            if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_TAXON_ASSOCIATIONS)){
589 590
                formFactory.createHorizontalSeparator(parent, SWT.BORDER);
590 591
                TaxonAssociationDetailSection taxonAssociationDetailSection = formFactory.createTaxonAssociationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
591
                addPart(taxonAssociationDetailSection, true);
592
                addPart(taxonAssociationDetailSection);
592 593
            }
593 594
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
594 595
            DerivedUnitFacadeIdentifierSection identifierDetailSection = formFactory.createDerivedUnitFacadeIdentifierSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
595
            addPart(identifierDetailSection, false);
596
            addPart(identifierDetailSection);
596 597
        }
597 598
        if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS)){
598 599
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
599 600
            DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
600
            addPart(determinationDetailSection, false);
601
            addPart(determinationDetailSection);
601 602
        }
602 603

  
603 604
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
604 605
        DerivedUnitTypeDesignationSection derivedUnitTypeDesignationSection = formFactory.createDerivedUnitTypeDesignationSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
605
        addPart(derivedUnitTypeDesignationSection, false);
606
        addPart(derivedUnitTypeDesignationSection);
606 607

  
607 608
    }
608 609

  
......
619 620

  
620 621
        FieldUnitDetailSection fieldUnitDetailSection = formFactory.createFieldUnitDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
621 622

  
622
        addPart(fielUnitGeneralDetailSection, true);
623
        addPart(gatheringEventDetailSection, false);
624
        addPart(fieldUnitDetailSection, false);
623
        addPart(fielUnitGeneralDetailSection);
624
        addPart(gatheringEventDetailSection);
625
        addPart(fieldUnitDetailSection);
625 626

  
626 627
        if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS)){
627 628
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
628 629
            DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
629
            addPart(determinationDetailSection, false);
630
            addPart(determinationDetailSection);
630 631
        }
631 632
    }
632 633

  
......
639 640

  
640 641
        SampleDesignationDetailSection sampleDesignationDetailSection = formFactory.createSampleDesignationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
641 642

  
642
        addPart(section, true);
643
        addPart(sampleDesignationDetailSection, true);
643
        addPart(section);
644
        addPart(sampleDesignationDetailSection);
644 645
    }
645 646

  
646 647
    private void createDnaSampleSection(RootElement parent) {
......
660 661

  
661 662
        SampleDesignationDetailSection sampleDesignationDetailSection = formFactory.createSampleDesignationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
662 663

  
663
        addPart(section, true);
664
        addPart(preparationPreservationSection, true);
665
        addPart(qualitySection, true);
666
        addPart(sampleDesignationDetailSection, true);
664
        addPart(section);
665
        addPart(preparationPreservationSection);
666
        addPart(qualitySection);
667
        addPart(sampleDesignationDetailSection);
667 668
    }
668 669

  
669 670
    private void createSequenceSection(RootElement parent) {
......
680 681
        SequenceContigFileCollectionDetailSection contigFileSection = formFactory.createSequenceContigFileCollectionDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
681 682

  
682 683

  
683
        addPart(section, true);
684
        addPart(referenceSection, true);
685
        addPart(contigFileSection, true);
684
        addPart(section);
685
        addPart(referenceSection);
686
        addPart(contigFileSection);
686 687
    }
687 688

  
688 689
    private void createSingleReadSection(RootElement parent) {
689 690
        destroySections();
690 691

  
691 692
        SingleReadGeneralDetailSection section = formFactory.createSingleReadGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
692
        addPart(section, true);
693
        addPart(section);
693 694

  
694 695
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
695 696

  
696 697
        SingleReadPherogramCollectionDetailSection pherogramSection = formFactory.createSingleReadPherogramCollectionDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
697
        addPart(pherogramSection, true);
698
        addPart(pherogramSection);
698 699

  
699 700
    }
700 701

  
......
702 703
        destroySections();
703 704

  
704 705
        MediaSpecimenGeneralDetailSection generalSection = formFactory.createMediaSpecimenGeneralDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
705
        addPart(generalSection, true);
706
        addPart(generalSection);
706 707

  
707 708
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
708 709

  
709 710
        RightsSection rightsSection = formFactory.createRightsSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
710
        addPart(rightsSection, false);
711
        addPart(rightsSection);
711 712

  
712 713
    }
713 714

  
......
716 717

  
717 718
        FeatureDistributionDetailSection featureDistributionSection = formFactory.createFeatureDistributionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
718 719

  
719
        addPart(featureDistributionSection, true);
720
        addPart(featureDistributionSection);
720 721
    }
721 722

  
722 723
    private void createPolytomousKeyNodeSection(RootElement parent) {
......
728 729

  
729 730
        PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection = formFactory.createPolytomousKeyNodeDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
730 731

  
731
        addPart(polytomousKeyDetailSection, true);
732
        addPart(polytomousKeyNodeDetailSection, true);
732
        addPart(polytomousKeyDetailSection);
733
        addPart(polytomousKeyNodeDetailSection);
733 734

  
734 735
    }
735 736

  
......
740 741

  
741 742
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
742 743

  
743
        addPart(descriptionUseRecordSection, true);
744
        addPart(descriptionUseRecordSection);
744 745

  
745 746

  
746 747
    }
......
752 753

  
753 754
        GroupsByUserDetailSection groupByUserDetailSection = formFactory.createGroupsByUserDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
754 755

  
755
        addPart(userDetailSection, true);
756
        addPart(groupByUserDetailSection, true);
756
        addPart(userDetailSection);
757
        addPart(groupByUserDetailSection);
757 758
    }
758 759

  
759 760
    private void createTaxonRelationshipSection(RootElement parent) {
......
762 763
        TaxonRelationshipDetailSection taxonRelationshipDetailSection = formFactory.createTaxonRelationshipDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
763 764

  
764 765
        ReferencedEntityDetailSection referencedEntityBaseDetailSection = formFactory.createReferencedEntityDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
765
        addPart(taxonRelationshipDetailSection, true);
766
        addPart(referencedEntityBaseDetailSection, true);
766
        addPart(taxonRelationshipDetailSection);
767
        addPart(referencedEntityBaseDetailSection);
767 768
    }
768 769

  
769 770
    private void createTermVocabularySection(RootElement parent) {
770 771
        destroySections();
771 772

  
772 773
        TermVocabularyDetailSection termVocabularyDetailSection = formFactory.createTermVocabularyDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
773
        addPart(termVocabularyDetailSection, true);
774
        addPart(termVocabularyDetailSection);
774 775
    }
775 776

  
776 777
    private void createDefinedTermSection(RootElement parent) {
777 778
        destroySections();
778 779

  
779 780
        AbstractFormSection<?> definedTermDetailSection = formFactory.createDefinedTermDetailSection(getInput().getClass(), getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
780
        addPart(definedTermDetailSection, true);
781
        addPart(definedTermDetailSection);
781 782
    }
782 783

  
784
	@Override
785
	public void update(CdmDataChangeMap arg0) {
786
		
787
	}
788

  
783 789
}

Also available in: Unified diff