Revision bce766a1
Added by Patrick Plitzner over 6 years ago
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/AbstractBulkEditorInput.java | ||
---|---|---|
31 | 31 |
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService; |
32 | 32 |
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorQuery; |
33 | 33 |
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider; |
34 |
import eu.etaxonomy.taxeditor.bulkeditor.e4.AnnotatedTableItem; |
|
35 | 34 |
import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.CdmBaseSortProvider; |
36 | 35 |
import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.TitleCacheComparator; |
37 | 36 |
import eu.etaxonomy.taxeditor.bulkeditor.internal.TaxeditorBulkeditorPlugin; |
... | ... | |
52 | 51 |
|
53 | 52 |
private List<T> model = new ArrayList<>(); |
54 | 53 |
|
54 |
private List<T> mergeCandidates = new ArrayList<>(); |
|
55 |
private T mergeTarget = null; |
|
56 |
|
|
55 | 57 |
private IEntityCreator<T> entityCreator; |
56 | 58 |
private final ConversationHolder conversation; |
57 | 59 |
|
... | ... | |
80 | 82 |
|
81 | 83 |
protected abstract T loadEntity(UUID entityUuid); |
82 | 84 |
|
85 |
public void setMergeTarget(T t){ |
|
86 |
mergeTarget = t; |
|
87 |
} |
|
88 |
|
|
89 |
public List<T> getMergeCandidates() { |
|
90 |
return mergeCandidates; |
|
91 |
} |
|
92 |
|
|
93 |
public T getMergeTarget() { |
|
94 |
return mergeTarget; |
|
95 |
} |
|
96 |
|
|
97 |
public void removeMergeTarget(){ |
|
98 |
mergeTarget = null; |
|
99 |
} |
|
100 |
|
|
101 |
public void addMergeCandidate(T t){ |
|
102 |
mergeCandidates.add(t); |
|
103 |
} |
|
104 |
|
|
105 |
public void removeMergeCandidate(T t){ |
|
106 |
mergeCandidates.remove(t); |
|
107 |
} |
|
108 |
|
|
109 |
public void removeMergeCandidates() { |
|
110 |
mergeCandidates = new ArrayList<>(); |
|
111 |
} |
|
112 |
|
|
83 | 113 |
private void setEntityUuid(UUID entityUuid){ |
84 | 114 |
this.entityUuid = entityUuid; |
85 | 115 |
} |
... | ... | |
222 | 252 |
return model; |
223 | 253 |
} |
224 | 254 |
|
225 |
public List<AnnotatedTableItem<T>> getWrappedModel() { |
|
226 |
List<AnnotatedTableItem<T>> wrappetItems = new ArrayList<>(); |
|
227 |
for(T t:model){ |
|
228 |
wrappetItems.add(new AnnotatedTableItem<T>(t)); |
|
229 |
} |
|
230 |
return wrappetItems; |
|
231 |
} |
|
232 |
|
|
233 | 255 |
protected boolean replaceInModel(T entity) { |
234 | 256 |
int index = model.indexOf(entity); |
235 | 257 |
if(index >= 0) { |
Also available in: Unified diff
ref #6932 Refactor merge annotating