private boolean validLocationName() {
		// Will this generate a duplicate name conflict?
		String extLibName = getExtLibName();
		if (extLibName == null || extLibName.length() == 0) {
			return true; // Any name is considered valid until we have a external library for it.
		}
		String locationName = getLocationName();
		if (locationName != null && locationName.length() > 0) {
			ExternalManager externalManager = program.getExternalManager();
			Set<ExternalLocation> externalLocations =
				externalManager.getExternalLocations(extLibName, locationName);
			if (externalLocations.size() == 1 && !externalLocations.contains(externalLocation)) {
				int result = OptionDialog.showYesNoDialog(null, "Duplicate External Name",
					"Another symbol named '" + locationName + "' already exists in the '" +
						extLibName + "' library. Are you sure you want to create another?");
				if (result == OptionDialog.NO_OPTION) {
					selectLocationName();
					return false;
				}
			}
		}
		return true;
	}
Pop up the data tree dialog so the user can choose the external program.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/symboltree/EditExternalLocationPanel.java