Project

General

Profile

Revision 31a9124b

ID31a9124b53f28224f6e6cebf1d346533ca1c7dc6
Parent 7106e8d1
Child ede4ba36

Added by Patrick Plitzner over 2 years ago

ref #7439 Cleanup saveCandidates of bulk editor input

View differences:

eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/e4/BulkEditorE4.java
332 332
        }
333 333
	    input.saveModel(resetMerge);
334 334

  
335
	    List<CdmBase> saveCandidates = getEditorInput().getSaveCandidates();
336 335
	    IStructuredSelection selection = getSelection();
337 336

  
338 337
        dirty.setDirty(false);
339
        getEditorInput().resetSaveCandidates();
340 338
        getEditorInput().dispose();
341 339
        getEditorInput().bind();
342 340
        conversation.commit(true);
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/AbstractBulkEditorInput.java
56 56
	private BasicEventList<T> model = new BasicEventList<>();
57 57

  
58 58
	private Map<T, DeleteConfiguratorBase> toDelete = new HashMap<>();
59
	private List<T> saveCandidates = new ArrayList<>();
59
	private Set<T> saveCandidates = new HashSet<>();
60 60

  
61 61

  
62 62
	private Set<T> markedMergeCandidates = new HashSet<>();
......
233 233
                e.printStackTrace();
234 234
            }
235 235
	    }
236
	    toDelete.clear();
237 236
	    if (!saveCandidates.isEmpty()){
238
	        CdmStore.getService(saveCandidates.get(0)).merge(saveCandidates, true);
237
	        CdmStore.getService(saveCandidates.iterator().next()).merge(new ArrayList<>(saveCandidates), true);
239 238
        }
240 239
	    if(resetMerge){
241 240
	        //merge entities
......
244 243
	                merge(mergeCandidate, mergeTarget);
245 244
	            }
246 245
	        }
247
	        mergedEntities.clear();
248

  
249 246
	    }
247
	    toDelete.clear();
248
	    saveCandidates.clear();
249
	    mergedEntities.clear();
250 250
	}
251 251

  
252 252

  
......
321 321
	}
322 322

  
323 323
    @Override
324
    public   List<T> getRootEntities() {
324
    public List<T> getRootEntities() {
325 325
        return getModel();
326 326
    }
327 327

  
......
336 336
		return conversation;
337 337
	}
338 338

  
339
	public List<T> getSaveCandidates() {
339
	public Set<T> getSaveCandidates() {
340 340
        return saveCandidates;
341 341
    }
342 342

  
343
    /**
344
     *
345
     */
346
    public void resetSaveCandidates() {
347
       this.saveCandidates.clear();
348

  
349
    }
350

  
351 343
    public HashMap<T, Set<T>> getMergedEntities() {
352 344
        return mergedEntities;
353 345
    }

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)