private static PluginTool getActiveTool(Program program) {
		WeakSet<PluginTool> toolSet = toolMap.get(program);
		if (toolSet.isEmpty()) {
			return null;
		}

		PluginTool anyTool = null;
		for (PluginTool tool : toolSet) {
			anyTool = tool;
			JFrame toolFrame = tool.getToolFrame();
			if (toolFrame != null && toolFrame.isActive()) {
				return tool;
			}
		}

		return anyTool;
	}
Returns the tool being used for analysis.  <b>This can be null</b> if analysis has never
been run or if the tool that previously ran analysis has been closed.
@return the tool being used for analysis.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AutoAnalysisManager.java