Project

General

Profile

Revision bca0ecd6

IDbca0ecd6d1447f62f890ba184de4ccb3aac3091a
Parent b084af2b
Child e9b059af

Added by Patrick Plitzner almost 2 years ago

ref #6455 Fix editing and saving of DU facades in bulk editor

View differences:

eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/e4/BulkEditorE4.java
51 51

  
52 52
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
53 53
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
54
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
54 55
import eu.etaxonomy.cdm.model.common.CdmBase;
56
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
57
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
55 58
import eu.etaxonomy.cdm.model.taxon.Taxon;
56 59
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
57 60
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorQuery;
......
347 350
     */
348 351
    @Override
349 352
    public void changed(Object element) {
350
        if (element instanceof CdmBase) {
353
        if(element instanceof DerivedUnitFacade){
354
            DerivedUnit derivedUnit = ((DerivedUnitFacade) element).innerDerivedUnit();
355
            if(derivedUnit!=null){
356
                getEditorInput().addSaveCandidate(derivedUnit);
357
            }
358
            FieldUnit fieldUnit = ((DerivedUnitFacade) element).innerFieldUnit();
359
            if(fieldUnit!=null){
360
                getEditorInput().addSaveCandidate(fieldUnit);
361
            }
362
        }
363
        else if (element instanceof CdmBase) {
351 364
            getEditorInput().addSaveCandidate((CdmBase)element);
352 365
        }
353 366
        dirty.setDirty(true);
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitGeneralDetailElement.java
85 85
		    combo_specorobstype.setEnabled(showSpecimenType);
86 86
		    selection_country = formFactory.createSelectionElement(NamedArea.class, //getConversationHolder(),
87 87
		            formElement, "Country",
88
		            entity.getCountry(), EntitySelectionElement.NOTHING, style);
88
		            entity.getCountry(), EntitySelectionElement.DELETABLE, style);
89 89

  
90 90
	        if(PreferencesUtil.isCollectingAreaInGeneralSection()){
91 91
	            section_collectingAreas = formFactory.createCollectingAreasDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/details/DetailsViewerE4.java
197 197
    @Override
198 198
    protected void markViewPartDirty() {
199 199
        if (getInput() instanceof DerivedUnitFacade) {
200
            DerivedUnitFacade facade = (DerivedUnitFacade) getInput();
201
            if(facade.innerDerivedUnit()!=null){
202
                part.changed(facade.innerDerivedUnit());
200
            if(part instanceof IDerivedUnitFacadePart){
201
                part.changed(getInput());
203 202
            }
204
            else if(facade.innerFieldUnit()!=null){
205
                part.changed(facade.innerFieldUnit());
203
            else{
204
                DerivedUnitFacade facade = (DerivedUnitFacade) getInput();
205
                if(facade.innerDerivedUnit()!=null){
206
                    part.changed(facade.innerDerivedUnit());
207
                }
208
                else if(facade.innerFieldUnit()!=null){
209
                    part.changed(facade.innerFieldUnit());
210
                }
206 211
            }
207 212
        }
208 213
        else{

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)