use of com.intellij.ui.speedSearch.ListWithFilter in project intellij-community by JetBrains.
the class ContentChooser method rebuildListContent.
private void rebuildListContent() {
ArrayList<Item> items = new ArrayList<>();
int i = 0;
List<Data> contents = new ArrayList<>(getContents());
for (Data content : contents) {
String longText = getStringRepresentationFor(content);
if (StringUtil.isEmpty(longText))
continue;
items.add(new Item(i++, longText));
}
myAllContents = contents;
FilteringListModel listModel = (FilteringListModel) myList.getModel();
((CollectionListModel) listModel.getOriginalModel()).removeAll();
listModel.addAll(items);
ListWithFilter listWithFilter = UIUtil.getParentOfType(ListWithFilter.class, myList);
if (listWithFilter != null) {
listWithFilter.getSpeedSearch().update();
if (listModel.getSize() == 0)
listWithFilter.resetFilter();
}
}
Aggregations