if (selectionModel.indexOf(entity) == -1) {
choiceModel.add(entity);
}
}
} else {
FullTextIndex index = new FullTextIndex();
for (int i = 0; i < backupModel.size(); i++) {
Object entity = backupModel.get(i);
if ((choiceListbox.getItemRenderer()) instanceof ItemRenderer) {
index.add(entity, ((ItemRenderer) choiceListbox
.getItemRenderer()).render(entity));
} else {
index.add(entity, String.valueOf(entity));
}
}
index.commit();
for (Object obj : index.search(searchTerm)) {
if (selectionModel.indexOf(obj) == -1) {
choiceModel.add(obj);
}
}
choiceListbox.selectAll();