private static Set<DomainFile> doPostImportProcessing(PluginTool pluginTool,
			ProgramManager programManager, FSRL fsrl,
			LoadResults<? extends DomainObject> loadResults, Object consumer, String importMessages,
			TaskMonitor monitor) throws CancelledException {

		boolean firstProgram = true;
		Set<DomainFile> importedFilesSet = new HashSet<>();
		for (Loaded<? extends DomainObject> loaded : loadResults) {
			monitor.checkCancelled();

			if (loaded.getDomainObject() instanceof Program program) {
				if (programManager != null) {
					int openState = firstProgram
							? ProgramManager.OPEN_CURRENT
							: ProgramManager.OPEN_VISIBLE;
					programManager.openProgram(program, openState);
				}
				importedFilesSet.add(program.getDomainFile());
			}
			if (firstProgram) {
				// currently we only show results for the imported program, not any libraries
				displayResults(pluginTool, loaded.getDomainObject(),
					loaded.getDomainObject().getDomainFile(), importMessages);

				// Optionally echo loader message log to application.log
				if (!Loader.loggingDisabled && !importMessages.isEmpty()) {
					Msg.info(ImporterUtilities.class, "Additional info:\n" + importMessages);
				}
			}
			loaded.release(consumer);
			firstProgram = false;
		}

		selectFiles(importedFilesSet);
		return importedFilesSet;
	}
Perform file import and open using optional programManager
@param tool tool to which popup dialogs should be associated
@param programManager program manager to open imported file with or null
@param fsrl import file location
@param destFolder project destination folder
@param loadSpec import {@link LoadSpec}
@param programName program name
@param options import options
@param monitor task monitor
Ghidra/Features/Base/src/main/java/ghidra/plugin/importer/ImporterUtilities.java