copyToSystemClipboard

Puts this selection on the system clipboard as tab-separated text, reporting whether it got there.

This is what DataTable does for you when no onCopy is supplied. Call it from inside an onCopy handler that wants to observe or log a copy and still perform it:

onCopy = { selection ->
auditLog.record(selection.rows.size)
selection.copyToSystemClipboard()
}

Parameters

includeHeader

Whether to lead with a row of column titles, as in toTabSeparated.


Puts text on the system clipboard, reporting whether it got there.

Exposed for onCopy handlers that build their own format — CSV, or a single column joined by commas — and still want it on the clipboard.

Returns false rather than throwing when there is no clipboard to write to: a headless JVM, or a desktop session where another application is holding it. A failed copy should leave the table working, not take the application down.