protected boolean canStopTasks() {
		if (!taskMgr.isBusy()) {
			return true;
		}

		int result = OptionDialog.showYesNoDialog(getToolFrame(), "Tool Busy Executing Task",
			"The tool is busy performing a background task.\n If you continue the" +
				" task may be terminated and some work may be lost!\n\nContinue anyway?");
		if (result != OptionDialog.YES_OPTION) {
			return false;
		}

		Task task = new Task("Stopping Tasks", true, false, true) {
			@Override
			public void run(TaskMonitor monitor) throws CancelledException {
				taskMgr.stop(monitor);
			}
		};
		TaskLauncher.launch(task);
		return !task.isCancelled();
	}
Checks if this tool has running tasks, with optionally giving the user an
opportunity to cancel them.

@return true if this tool has running tasks
Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/PluginTool.java