private void copy(final ClipboardContentProviderService clipboardService) {
		Task copyTask = new Task("Copying", true, false, true) {
			@Override
			public void run(TaskMonitor monitor) {
				monitor.setMessage("Setting Clipboard Contents");
				Clipboard systemClipboard = getSystemClipboard();
				Transferable transferable = clipboardService.copy(monitor);
				if (removeQuotes && transferable instanceof StringTransferable stringTransferable) {
					stringTransferable.removeOuterQuotesAndStandardStringPrefix();
				}

				if (transferable == null) {
					return;
				}
				if (clipboardOwnerProvider != null) {
					clipboardOwnerProvider.lostOwnership(null);
				}

				setClipboardContents(systemClipboard, transferable);
				clipboardOwnerProvider = clipboardService;
				updatePasteState();
			}
		};

		new TaskLauncher(copyTask, clipboardService.getComponentProvider().getComponent(), 250);
	}
@see java.awt.datatransfer.ClipboardOwner#lostOwnership(java.awt.datatransfer.Clipboard,
     java.awt.datatransfer.Transferable)
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/clipboard/ClipboardPlugin.java