Project

General

Profile

Revision 515c0724

ID515c07244f2b4190085c479921839565dcf6e596
Parent 5dc5c2ed
Child 06cbb2b0, 7a5d7871

Added by Katja Luther almost 2 years ago

fix saving for edited factual data in bulk editor

View differences:

eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/e4/BulkEditorE4.java
35 35
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
36 36
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
37 37
import eu.etaxonomy.cdm.model.common.CdmBase;
38
import eu.etaxonomy.cdm.model.description.DescriptionBase;
39
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
40
import eu.etaxonomy.cdm.model.description.TaxonDescription;
41
import eu.etaxonomy.cdm.model.description.TaxonNameDescription;
42
import eu.etaxonomy.cdm.model.name.TaxonName;
38 43
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
39 44
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
40 45
import eu.etaxonomy.cdm.model.taxon.Taxon;
......
225 230
            }
226 231
        }
227 232
        else if (element instanceof CdmBase) {
228
            getEditorInput().addSaveCandidate((CdmBase)element);
229
            input.replaceInModel((CdmBase) element);
233
            if (element instanceof DescriptionBase){
234
                if (element instanceof TaxonNameDescription){
235
                    TaxonName changedName = ((TaxonNameDescription)element).getTaxonName();
236
                    getEditorInput().addSaveCandidate(changedName);
237
                    input.replaceInModel(changedName);
238
                }else if (element instanceof TaxonDescription){
239
                    Taxon changedTaxon = ((TaxonDescription)element).getTaxon();
240
                    getEditorInput().addSaveCandidate(changedTaxon);
241
                    input.replaceInModel(changedTaxon);
242
                }
243
            }else if (element instanceof DescriptionElementBase){
244
                if (((DescriptionElementBase)element).getInDescription() instanceof TaxonNameDescription){
245
                    TaxonName changedName = ((TaxonNameDescription)((DescriptionElementBase)element).getInDescription()).getTaxonName();
246
                    getEditorInput().addSaveCandidate(changedName);
247
                    input.replaceInModel(changedName);
248
                }else if (((DescriptionElementBase)element).getInDescription() instanceof TaxonDescription){
249
                    Taxon changedTaxon = ((TaxonDescription)((DescriptionElementBase)element).getInDescription()).getTaxon();
250
                    getEditorInput().addSaveCandidate(changedTaxon);
251
                    input.replaceInModel(changedTaxon);
252
                }
253
            }else{
254
                getEditorInput().addSaveCandidate((CdmBase)element);
255
                input.replaceInModel((CdmBase) element);
256
            }
230 257
        }
231 258
        dirty.setDirty(true);
232 259
        setSelection(new StructuredSelection(element));

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)