void (@NotNull DataContext dataContext) { TableModel model = myTable.getModel(); StringBuilder sb = new StringBuilder(); for (int row : myTable.getSelectedRows()) { RevisionItem r = (RevisionItem)model.getValueAt(row, 0); LabelsAndColor labelsAndColor = getLabelsAndColor(r); String time = DateFormatUtil.formatDateTime(r.revision.getTimestamp()); String title = labelsAndColor.title; String filesCount = labelsAndColor.filesCount; if (sb.length() != 0) sb.append("\n"); sb.append(time).append(", ") .append(filesCount).append(": ") .append(title); } CopyPasteManager.getInstance().setContents(new TextTransferable(sb)); }