boolean deleteView(TreeViewProvider treeViewProvider) {
		if (providerMap.size() == 1) {
			tool.setStatusInfo("Cannot delete the last tree view");
			return false;
		}
		String treeName = treeViewProvider.getViewName();
		DeleteTreeCmd cmd = new DeleteTreeCmd(treeName);
		if (!tool.execute(cmd, currentProgram)) {
			tool.setStatusInfo(cmd.getStatusMsg());
			return false;
		}
		return true;
	}
Notification that the view is deleted

@param treeViewProvider the deleted provider
@return true if the view can be deleted
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/programtree/ProgramTreePlugin.java