Project

General

Profile

« Previous | Next » 

Revision 8f96bb65

Added by Patrick Plitzner over 8 years ago

Remove identifier and taxon associations from bulk editor details view

  • reduce space taken by taxon associaton section #5348

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/TaxonAssociationDetailElement.java
70 70
        //TODO add context menu for deleting associations
71 71

  
72 72
        Collection<TaxonBase<?>> associatedTaxa = CdmStore.getService(IOccurrenceService.class).listAssociatedTaxa(entity.innerDerivedUnit(), null, null, null, null);
73
        if(associatedTaxa.isEmpty()){
74
            Label associationsLabel = formFactory.createLabel(getLayoutComposite(), "Individuals Associations");
75
            associationsLabel.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
73
        Collection<SpecimenTypeDesignation> typeDesignations = CdmStore.getService(IOccurrenceService.class).listTypeDesignations(entity.innerDerivedUnit(), null, null, null, null);
76 74

  
75
        if(!associatedTaxa.isEmpty()){
77 76
            associationsViewer = new TableViewer(getLayoutComposite(), SWT.FULL_SELECTION);
78 77
            associationsViewer.getTable().setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
79 78
            associationsViewer.setContentProvider(new ArrayContentProvider());
80 79
            associationsViewer.setInput(associatedTaxa);
81 80
            associationsViewer.addDoubleClickListener(this);
82 81
        }
82
        else{
83
            Label label = formFactory.createLabel(getLayoutComposite(), "No associations");
84
            label.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
85
        }
83 86

  
84
        Collection<SpecimenTypeDesignation> typeDesignations = CdmStore.getService(IOccurrenceService.class).listTypeDesignations(entity.innerDerivedUnit(), null, null, null, null);
85 87
        //TODO implement service method for this which is just used in the label provider
86 88
        Collection<TaxonBase<?>> typedTaxa = new HashSet<TaxonBase<?>>();
87 89
        for (SpecimenTypeDesignation specimenTypeDesignation : typeDesignations) {
......
112 114
        //empty
113 115
    }
114 116

  
115
    /* (non-Javadoc)
116
     * @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(org.eclipse.jface.viewers.DoubleClickEvent)
117
     */
118 117
    @Override
119 118
    public void doubleClick(DoubleClickEvent event) {
120 119
        if(event.getSelection() instanceof IStructuredSelection){
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java
577 577
            FieldUnitDetailSection fieldUnitDetailSection = formFactory.createFieldUnitDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
578 578
            addPart(fieldUnitDetailSection);
579 579
        }
580
        else{
580 581

  
582
            if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_TAXON_ASSOCIATIONS)){
583
                formFactory.createHorizontalSeparator(parent, SWT.BORDER);
584
                TaxonAssociationDetailSection taxonAssociationDetailSection = formFactory.createTaxonAssociationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
585
                addPart(taxonAssociationDetailSection);
586
            }
587
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
588
            IdentifierDetailSection identifierDetailSection = formFactory.createIdentifierDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
589
            addPart(identifierDetailSection);
590
        }
581 591
        if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS)){
582 592
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
583 593
            DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
584 594
            addPart(determinationDetailSection);
585 595
        }
586
        if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_TAXON_ASSOCIATIONS)){
587
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
588
            TaxonAssociationDetailSection taxonAssociationDetailSection = formFactory.createTaxonAssociationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
589
            addPart(taxonAssociationDetailSection);
590
        }
591

  
592
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
593
        IdentifierDetailSection identifierDetailSection = formFactory.createIdentifierDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
594
        addPart(identifierDetailSection);
595 596

  
596 597
    }
597 598

  

Also available in: Unified diff