void (Collection<T> schemes) { if (schemes.isEmpty()) { Messages.showMessageDialog(IdeBundle.message("message.there.are.no.available.schemes.to.import"), IdeBundle.message("dialog.title.import"), Messages.getWarningIcon()); return; } final JList list = new JBList(new CollectionListModel<>(schemes)); list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); list.setCellRenderer(new SchemesToImportListCellRenderer()); Runnable selectAction = () -> onSchemeSelected((T)list.getSelectedValue()); showList(list, selectAction); }