Project

General

Profile

Revision dcf98348

IDdcf98348abae2de24283207fddb7cb670c6028b6
Parent 01a4599b
Child 8360c0ff

Added by Patrick Plitzner about 2 years ago

fix #4363 Show more informative message in details view for specimen

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/EmptySection.java
37 37

  
38 38
    @Override
39 39
    protected AbstractCdmDetailElement<Object> createCdmDetailElement(AbstractCdmDetailSection<Object> parentElement, int style) {
40
        return formFactory.createEmptyElement(parentElement, null);
40
        return formFactory.createEmptyElement(parentElement, message);
41 41
    }
42 42

  
43 43
    @Override
44 44
    public void setEntity(Object entity) {
45
        //nothing
45
        //update section title because getHeading is invoked
46
        //before message is set via constructor
47
        setSectionTitle();
46 48
    }
47 49
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/details/DetailsViewerE4.java
295 295
        } else if (input instanceof Media) {
296 296
            createMediaElementSection(rootElement);
297 297

  
298
        } else if (input instanceof DerivedUnitFacade) {
298
        }
299
        //FIXME hack to show more informative message to the user when
300
        //DerivedUnit has more than one FieldUnit #4363
301
        else if (input.getClass().equals(DerivedUnit.class)) {
302
            DerivedUnit derivedUnit = (DerivedUnit)input;
303
            try {
304
                input = DerivedUnitFacade.NewInstance(derivedUnit,
305
                        PreferencesUtil.getDerivedUnitConfigurator());
306
            } catch (DerivedUnitFacadeNotSupportedException e) {
307
                createEmptySection(e.getMessage(), rootElement);
308
            }
309
        }
310
        else if (input instanceof DerivedUnitFacade) {
299 311
            if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.FieldUnit){
300 312
                if(((DerivedUnitFacade) input).innerFieldUnit()==null){
301 313
                    MessagingUtils.error(DetailsViewerE4.class, "FieldUnit of facade is null", null); //$NON-NLS-1$

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)