Project

General

Profile

« Previous | Next » 

Revision 10c5f268

Added by Katja Luther about 4 years ago

correct handling of pref determinations only for field units

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/details/DetailsViewerE4.java
187 187
        if(input instanceof GbifResponse){
188 188
            input = ((GbifResponse) input).getDerivedUnitFacade();
189 189
        }
190
        if (input !=null && input.getClass().equals(DerivedUnit.class)) {
190
       if (input !=null && input instanceof DerivedUnit) {
191 191
            DerivedUnit derivedUnit = (DerivedUnit)input;
192 192
            try {
193 193
                input = DerivedUnitFacade.NewInstance(derivedUnit,
194 194
                        PreferencesUtil.getDerivedUnitConfigurator());
195 195
            } catch (DerivedUnitFacadeNotSupportedException e) {
196
                //                MessagingUtils.error(getClass(), e); //nothing should happen, later on the Details View will show an according information that it is not possible to open this data
196
                                MessagingUtils.error(getClass(), e); //nothing should happen, later on the Details View will show an according information that it is not possible to open this data
197 197
            }
198 198
        }
199 199
        else if(input instanceof FieldUnit){
......
310 310
        }
311 311
        //FIXME hack to show more informative message to the user when
312 312
        //DerivedUnit has more than one FieldUnit #4363
313
        else if (input.getClass().equals(DerivedUnit.class)) {
313
        else if (input instanceof DerivedUnit) {
314 314
            DerivedUnit derivedUnit = (DerivedUnit)input;
315 315
            try {
316 316
                input = DerivedUnitFacade.NewInstance(derivedUnit,
......
341 341
                //in future using only one class with different SpecimenOrObservationTypes is desired
342 342
                createTissueSampleSection(rootElement);
343 343
            }
344
            else if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.DnaSample){
345

  
346
                if(((DerivedUnitFacade) input).innerDerivedUnit().getRecordBasis()==SpecimenOrObservationType.TissueSample){
347
                    createTissueSampleSection(rootElement);
348
                }
349
                else if(((DerivedUnitFacade) input).innerDerivedUnit().getRecordBasis()==SpecimenOrObservationType.DnaSample){
350
                    createDnaSampleSection(rootElement);
351
                }
352
            }
353

  
344 354
            else{
345 355
                createDerivedUnitBaseElementSection(rootElement);
346 356
            }
......
751 761
        addPart(gatheringEventDetailSection);
752 762
        addPart(fieldUnitDetailSection);
753 763

  
754
        if(PreferencesUtil.isDeterminationOnlyForFieldUnits()){
755
            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
756
            DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DeterminationDetailSection.class, getInput().getClass().getCanonicalName()));
757
            addPart(determinationDetailSection);
758
        }
764
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
765
        DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DeterminationDetailSection.class, getInput().getClass().getCanonicalName()));
766
        addPart(determinationDetailSection);
767

  
759 768
    }
760 769

  
761 770
    private void createTissueSampleSection(RootElement parent) {
......
784 793

  
785 794
        SampleDesignationDetailSection sampleDesignationDetailSection = formFactory.createSampleDesignationDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(SampleDesignationDetailSection.class, getInput().getClass().getCanonicalName(), true));
786 795

  
796
        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
797
        DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, StoreUtil.getSectionStyle(DeterminationDetailSection.class, getInput().getClass().getCanonicalName()));
798

  
787 799
        addPart(section);
788 800
        addPart(preparationPreservationSection);
789 801
        addPart(qualitySection);
790 802
        addPart(sampleDesignationDetailSection);
803
        addPart(determinationDetailSection);
791 804
    }
792 805

  
793 806
    private void createSequenceSection(RootElement parent) {

Also available in: Unified diff