Project

General

Profile

Revision 3886664b

ID3886664bad8d79e22b8129c8cc88f378193448b8
Parent 31cfe10f
Child 1871c770

Added by Andreas Müller 5 months ago

cleanup

View differences:

eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/AbstractBulkEditorInput.java
9 9
package eu.etaxonomy.taxeditor.bulkeditor.input;
10 10

  
11 11
import java.util.ArrayList;
12
import java.util.Collection;
12 13
import java.util.Comparator;
13 14
import java.util.HashMap;
14 15
import java.util.HashSet;
......
53 54
 * @author p.ciardelli
54 55
 * @created 25.06.2009
55 56
 */
56
public abstract class AbstractBulkEditorInput<T extends CdmBase> extends CdmEntitySessionInput implements
57
    IEntityPersistenceService<T> {
57
public abstract class AbstractBulkEditorInput<T extends CdmBase>
58
        extends CdmEntitySessionInput
59
        implements IEntityPersistenceService<T> {
58 60

  
59 61

  
60 62
    private static final String PROPERTY_PROTECTED_TITLECACHE = "Protect TitleCache";
......
98 100

  
99 101
		BulkEditorInputType inputType = BulkEditorInputType.getByType(entity.getClass());
100 102

  
101
		AbstractBulkEditorInput editorInput = NewInstance(inputType);
103
		AbstractBulkEditorInput<?> editorInput = NewInstance(inputType);
102 104

  
103 105
		editorInput.setEntityUuid(entity.getUuid());
104 106

  
......
109 111

  
110 112
        BulkEditorInputType inputType = BulkEditorInputType.getByType(clazz);
111 113

  
112
        AbstractBulkEditorInput editorInput = NewInstance(inputType);
114
        AbstractBulkEditorInput<?> editorInput = NewInstance(inputType);
113 115

  
114 116
        editorInput.setEntityUuid(uuid);
115 117

  
......
180 182
        return false;
181 183
    }
182 184

  
183
	public Comparator<T> getTitleComparator(){
184
	    return new TitleCacheComparator();
185
	public <T extends IdentifiableEntity> Comparator<T> getTitleComparator(){
186
	    return new TitleCacheComparator<T>();
185 187
	}
186 188

  
187 189
	public void setMergeTarget(T t){
......
248 250
			model.add(entity);
249 251
		}
250 252
		else if(bulkEditorQuery != null){
251
            IIdentifiableEntityServiceConfigurator configurator = bulkEditorQuery.getSearchConfigurator();
253
            IIdentifiableEntityServiceConfigurator<?> configurator = bulkEditorQuery.getSearchConfigurator();
252 254

  
253 255
            // check for UUID search
254 256
            String titleSearchString = configurator.getTitleSearchString();
......
368 370
	        List<MergeResult<T>> results = CdmStore.getService(saveCandidates.iterator().next()).merge(new ArrayList<>(saveCandidates), true);
369 371
	        for (MergeResult<T> result: results){
370 372
	            if (result.getMergedEntity() != null){
371
	                T entitiy = result.getMergedEntity();
373
	                T entity = result.getMergedEntity();
372 374
	            }
373

  
374 375
	        }
375 376
        }
376 377
	    if(resetMerge){
......
405 406
	 * @return
406 407
	 */
407 408
	public List<IBulkEditorSortProvider<T>> getSortProviders(){
408
		List<IBulkEditorSortProvider<T>> sortProviders = new ArrayList<IBulkEditorSortProvider<T>>();
409
		List<IBulkEditorSortProvider<T>> sortProviders = new ArrayList<>();
409 410

  
410
		sortProviders.add(new CdmBaseSortProvider<T>());
411
		sortProviders.add(new CdmBaseSortProvider<>());
411 412

  
412 413
		return sortProviders;
413 414
	}
......
426 427

  
427 428
	public String getText(T entity) {
428 429
		if(entity.isInstanceOf(IdentifiableEntity.class)){
429
			IdentifiableEntity identifiableEntity = HibernateProxyHelper.deproxy(entity, IdentifiableEntity.class);
430
			IdentifiableEntity<?> identifiableEntity = HibernateProxyHelper.deproxy(entity, IdentifiableEntity.class);
430 431
			String text = identifiableEntity.getTitleCache();
431 432
			return text;
432 433
		}
......
449 450
	}
450 451

  
451 452
    @Override
452
    public List<T> getRootEntities() {
453
    public Collection<T> getRootEntities() {
453 454
        return getModel();
454 455
    }
455 456

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)