void (final List<VcsFileRevision> revisions, final Project project, final Consumer<? super VcsFileRevision> selectedRevisionConsumer, final boolean showComments) { ColumnInfo[] columns = new ColumnInfo[] { Holder.REVISION_TABLE_COLUMN, Holder.DATE_TABLE_COLUMN, Holder.AUTHOR_TABLE_COLUMN }; for(VcsFileRevision revision: revisions) { if (revision.getBranchName() != null) { columns = new ColumnInfo[] { Holder.REVISION_TABLE_COLUMN, Holder.BRANCH_TABLE_COLUMN, Holder.DATE_TABLE_COLUMN, Holder.AUTHOR_TABLE_COLUMN }; break; } } final TableView<VcsFileRevision> table = new TableView<>(new ListTableModel<>(columns, revisions, 0)); table.setShowHorizontalLines(false); table.setTableHeader(null); Runnable runnable = () -> { VcsFileRevision revision = table.getSelectedObject(); if (revision != null) { selectedRevisionConsumer.consume(revision); } }; if (table.getModel().getRowCount() == 0) { table.clearSelection(); } SpeedSearchBase<TableView> search = new SpeedSearchBase<>(table, null) { @Override protected int getSelectedIndex() { return table.getSelectedRow(); } @Override protected int getElementCount() { return revisions.size(); } @Override protected Object getElementAt(int viewIndex) { return revisions.get(table.convertRowIndexToModel(viewIndex)); } @Override protected String getElementText(Object element) { VcsFileRevision revision = (VcsFileRevision)element; return revision.getRevisionNumber().asString() + " " + revision.getBranchName() + " " + revision.getAuthor(); } @Override protected void selectElement(Object element, String selectedText) { VcsFileRevision revision = (VcsFileRevision)element; TableUtil.selectRows(myComponent, new int[]{myComponent.convertRowIndexToView(revisions.indexOf(revision))}); TableUtil.scrollSelectionToVisible(myComponent); } }; search.setupListeners(); table.setMinimumSize(new JBDimension(300, 50)); final PopupChooserBuilder builder = new PopupChooserBuilder(table); if (showComments) { builder.setSouthComponent(createCommentsPanel(table)); } builder.setTitle(VcsBundle.message("lookup.title.vcs.file.revisions")). setItemChosenCallback(runnable). setResizable(true). setMovable(true). setDimensionServiceKey("Vcs.CompareWithSelectedRevision.Popup").setMinSize(new JBDimension(300, 300)); final JBPopup popup = builder.createPopup(); popup.showCenteredInCurrentWindow(project); }