clipboard
Enables system-clipboard copy/cut export and paste import on the component, over the same transfer handler draggable and dropTarget use.
Copy and cut export the value transferable produces to the system clipboard; copy completes as a TransferHandler.COPY and cut as a TransferHandler.MOVE, the action reported through onExportDone, where a source implementing cut semantics removes the moved data. Paste reads the system clipboard and, when canImport accepts the available flavors, hands the clipboard Transferable to onPaste, which returns whether the import succeeded. canImport defaults to accepting any flavor.
Declaring a clipboard takes over both directions: copy and cut export transferable and a paste imports through onPaste, in place of whatever the component exported and imported on its own.
When bindKeys is true (the default), the platform copy/cut/paste keystrokes (the menu-shortcut modifier with C/X/V) are bound on the component so the standard shortcuts trigger these operations while it is focused; pass false to enable the operations without installing key bindings (e.g. to drive them from your own menu). Requires a JComponent target. All callbacks are read live, so passing fresh lambdas across recompositions takes effect immediately.
Pass a handle from rememberClipboardHandle to also trigger copy/cut/paste programmatically. The handle binds to the component this modifier is applied to, so ClipboardHandle.copy, ClipboardHandle.cut and ClipboardHandle.paste drive these same operations from an event handler (e.g. a menu item) without the caller ever touching the JComponent.
Return
this modifier with clipboard support declared on it.
Parameters
produces the value a copy or a cut puts on the clipboard; null puts nothing there and leaves the previous contents standing.
imports the clipboard contents; its result is what ClipboardHandle.paste returns.
gates a paste by the flavors the clipboard offers.
whether the platform copy/cut/paste keystrokes are bound on the component; toggling it binds or unbinds them in place.
a programmatic trigger bound to this component for as long as the modifier applies, or null to declare none.