private boolean shouldEnableLoadLibraries(Program program) {
		if (program == null) {
			return false;
		}
		ByteProvider provider = ImporterUtilities.getProvider(program);
		if (provider == null) {
			return false;
		}
		LoadSpec loadSpec = ImporterUtilities.getLoadSpec(provider, program);
		if (loadSpec == null) {
			return false;
		}
		return loadSpec.getLoader()
				.getDefaultOptions(provider, loadSpec, null, false)
				.stream()
				.anyMatch(e -> e.getName()
						.equals(AbstractLibrarySupportLoader.LOAD_ONLY_LIBRARIES_OPTION_NAME));
	}
A {@link Plugin} that supplies menu items and tasks to import files into Ghidra.
Ghidra/Features/Base/src/main/java/ghidra/plugin/importer/ImporterPlugin.java