private boolean delete(ProgramDnDTree tree, TreePath[] paths) {

		boolean changesMade = false;
		StringBuilder sb = new StringBuilder();

		for (TreePath element : paths) {
			ProgramNode node = (ProgramNode) element.getLastPathComponent();
			if (tree.removeGroup(node, sb)) {
				changesMade = true;
			}
		}

		if (sb.length() > 0) {
			sb.insert(0, "Failed to delete the following:\n");
			Msg.showWarn(getClass(), null, "Delete Failed", sb.toString());
		}
		return changesMade;
	}
Delete node(s) from the tree; called from the action listener
on the menu.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/programtree/ProgramTreeActionManager.java