void (final List<TreeItem<VcsFileRevision>> roots, final Project project, final Consumer<? super VcsFileRevision> selectedRevisionConsumer) { final TreeTableView treeTable = new TreeTableView(new ListTreeTableModelOnColumns(new TreeNodeAdapter(null, null, roots), new ColumnInfo[]{Holder.BRANCH_COLUMN, Holder.REVISION_COLUMN, Holder.DATE_COLUMN, Holder.AUTHOR_COLUMN})); Runnable runnable = () -> { int index = treeTable.getSelectionModel().getMinSelectionIndex(); if (index == -1) { return; } VcsFileRevision revision = getRevisionAt(treeTable, index); if (revision != null) { selectedRevisionConsumer.consume(revision); } }; treeTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); new PopupChooserBuilder(treeTable). setTitle(VcsBundle.message("lookup.title.vcs.file.revisions")). setItemChosenCallback(runnable). setSouthComponent(createCommentsPanel(treeTable)). setResizable(true). setDimensionServiceKey("Vcs.CompareWithSelectedRevision.Popup"). createPopup(). showCenteredInCurrentWindow(project); final int lastRow = treeTable.getRowCount() - 1; if (lastRow < 0) return; treeTable.getSelectionModel().addSelectionInterval(lastRow, lastRow); treeTable.scrollRectToVisible(treeTable.getCellRect(lastRow, 0, true)); }