Search in sources :

Example 1 with ListWithFilter

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();
    }
}
Also used : ListWithFilter(com.intellij.ui.speedSearch.ListWithFilter) ArrayList(java.util.ArrayList) FilteringListModel(com.intellij.ui.speedSearch.FilteringListModel) SplitterProportionsData(com.intellij.openapi.ui.SplitterProportionsData)

Aggregations

SplitterProportionsData (com.intellij.openapi.ui.SplitterProportionsData)1 FilteringListModel (com.intellij.ui.speedSearch.FilteringListModel)1 ListWithFilter (com.intellij.ui.speedSearch.ListWithFilter)1 ArrayList (java.util.ArrayList)1