private void removeFromView(ProgramTreeActionContext context) {

		ProgramDnDTree tree = context.getTree();
		TreePath[] paths = context.getSelectionPaths();
		if (paths.length == 1) {
			TreePath path = paths[0];
			if (viewList.contains(path)) {
				tree.removeFromView(path);
			}
			else {
				// remove all descendants from the view				
				ProgramNode node = (ProgramNode) path.getLastPathComponent();
				removeChildFromView(tree, node);
			}
		}
		else {
			for (TreePath path : paths) {
				tree.removeFromView(path);
			}
		}

		tree.fireTreeViewChanged();
	}
Clear the system clipboard if there is tree transferable data on it.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/programtree/ProgramTreeActionManager.java