private void updatePasteState() {
		if (tool == null) {
			return; // this can happen during shutdown, when we lose ownership
		}

		JFrame toolFrame = tool.getToolFrame();
		if (toolFrame == null) {
			return; // this can happen during shutdown, when we lose ownership
		}

		Clipboard systemClipboard = getSystemClipboard();
		DataFlavor[] availableDataFlavors = getAvailableDataFlavors(systemClipboard);
		Set<Entry<ClipboardContentProviderService, List<DockingAction>>> entrySet =
			serviceActionMap.entrySet();
		for (Map.Entry<ClipboardContentProviderService, List<DockingAction>> entry : entrySet) {
			ClipboardContentProviderService clipboardService = entry.getKey();
			List<DockingAction> actionList = entry.getValue();
			for (DockingAction pluginAction : actionList) {
				if (pluginAction instanceof IPaste) {
					pluginAction.setEnabled(clipboardService.canPaste(availableDataFlavors));
				}
			}
		}
	}
@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