void (@NotNull List<? extends FileNameMatcher> matchers) { clearList(); List<FileNameMatcher> copy = new ArrayList<>(matchers); copy.sort(Comparator.comparing(FileNameMatcher::getPresentableString)); DefaultListModel<Pair<FileNameMatcher, Language>> model = (DefaultListModel<Pair<FileNameMatcher, Language>>)myList.getModel(); for (FileNameMatcher matcher : copy) { Language language = myTempTemplateDataLanguages.findAssociatedFileType(matcher); model.addElement(Pair.create(matcher, language)); } ScrollingUtil.ensureSelectionExists(myList); }