private boolean setOptions(final Program program) {
		AtomicBoolean analyze = new AtomicBoolean();
		int id = program.startTransaction("analysis");
		try {
			Swing.runNow(() -> {
				AnalysisOptionsDialog dialog =
					new AnalysisOptionsDialog(getValidProgramsByArchitecture());
				tool.showDialog(dialog);
				boolean shouldAnalyze = dialog.wasAnalyzeButtonSelected();
				analyze.set(shouldAnalyze);
			});
		}
		finally {
			program.endTransaction(id, true);
		}

		if (!analyze.get()) {
			return false;
		}

		return true;
	}
The program that is used for a source of analysis options
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AnalyzeAllOpenProgramsTask.java