@Override
				public void actionPerformed(ActionContext context) {
					int[] selectedRows = PreviewTable.this.getSelectedRows();
					String val = "";
					for (int selectedRow : selectedRows) {

						val += getColumnValue(selectedRow, HEADER_COL_PREVIEW);

						String comment = searchData.getInstructions().get(selectedRow).getTextRep();

						if (comment != null) {
							StringBuilder builder = new StringBuilder();
							builder.append(val)
									.append("\t")
									.append("// ")
									.append(comment)
									.append(
										"\n");
							val = builder.toString();
						}
					}

					StringSelection sel = new StringSelection(val);
					Clipboard clip = GClipboard.getSystemClipboard();
					clip.setContents(sel, null);
				}
Creates a string from the selected items, with comments indicating the
mnemonic/operand types.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/instructionsearch/ui/PreviewTable.java