void (final @NotNull Consumer<? super VcsFullCommitDetails> listener) { myTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(final ListSelectionEvent e) { ListSelectionModel lsm = (ListSelectionModel)e.getSource(); int i = lsm.getMaxSelectionIndex(); int j = lsm.getMinSelectionIndex(); if (i >= 0 && i == j) { listener.consume(myCommits.get(i)); } } }); }