Revision 97352439
Added by Patrick Plitzner almost 6 years ago
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/AbstractBulkEditorInput.java | ||
---|---|---|
19 | 19 |
import java.util.Set; |
20 | 20 |
import java.util.UUID; |
21 | 21 |
|
22 |
import ca.odell.glazedlists.BasicEventList; |
|
22 | 23 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
23 | 24 |
import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase; |
24 | 25 |
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator; |
... | ... | |
51 | 52 |
|
52 | 53 |
private UUID entityUuid; |
53 | 54 |
|
54 |
private List<T> model = new ArrayList<>();
|
|
55 |
private BasicEventList<T> model = new BasicEventList<>();
|
|
55 | 56 |
|
56 | 57 |
private Map<T, DeleteConfiguratorBase> toDelete = new HashMap<>(); |
57 | 58 |
private List<T> saveCandidates = new ArrayList<>(); |
... | ... | |
135 | 136 |
} |
136 | 137 |
|
137 | 138 |
public void performSearch(final BulkEditorQuery bulkEditorQuery) { |
138 |
|
|
139 |
List<T> entityList = new ArrayList<T>();
|
|
139 |
model.clear(); |
|
140 |
BasicEventList<T> entityList = new BasicEventList<>();
|
|
140 | 141 |
|
141 | 142 |
if(getEntityUuid() != null){ |
142 | 143 |
|
143 | 144 |
T entity = loadEntity(getEntityUuid()); |
144 | 145 |
entityList.add(entity); |
145 |
model = entityList;
|
|
146 |
model.addAll(entityList);
|
|
146 | 147 |
} |
147 | 148 |
else if(bulkEditorQuery != null){ |
148 | 149 |
|
149 | 150 |
IIdentifiableEntityServiceConfigurator configurator = bulkEditorQuery.getSearchConfigurator(); |
150 | 151 |
Comparator queryComparator = (bulkEditorQuery.getComparator() != null) ? bulkEditorQuery.getComparator() : new TitleCacheComparator(); |
151 | 152 |
|
152 |
entityList = listEntities(configurator);
|
|
153 |
entityList.addAll(listEntities(configurator));
|
|
153 | 154 |
|
154 | 155 |
Collections.sort(entityList, queryComparator); |
155 |
|
|
156 |
|
|
157 | 156 |
} |
158 |
|
|
159 |
model = entityList; |
|
157 |
model.addAll(entityList); |
|
160 | 158 |
} |
161 | 159 |
|
162 | 160 |
public boolean isMergingEnabled() { |
... | ... | |
269 | 267 |
return "No text. Implement in subclass"; |
270 | 268 |
} |
271 | 269 |
|
272 |
public List<T> getModel() { |
|
270 |
public BasicEventList<T> getModel() {
|
|
273 | 271 |
return model; |
274 | 272 |
} |
275 | 273 |
|
Also available in: Unified diff
ref #7439 Move event list to editor input