@Override
	public void initialize(CodeUnit fromCu, Reference ref) {
		isValidState = false;
		this.fromCodeUnit = fromCu;

		Program program = fromCu.getProgram();

		Address toAddr = ref.getToAddress();
		if (!toAddr.isExternalAddress()) {
			throw new IllegalArgumentException("Expected external reference");
		}
		this.editRef = (ExternalReference) ref;
		ExternalLocation extLoc = editRef.getExternalLocation();

		populateExternalNames();
		String name = extLoc.getLibraryName();
		extLibName.setSelectedItem(name);
		extProgNameChanged();

		updateExtLibPath();

		extLabel.setText(extLoc.getLabel());
		extAddr.setProgram(program);
		Address addr = extLoc.getAddress();
		if (addr != null) {
			extAddr.setAddress(addr);
		}
		else {
			extAddr.clear();
		}

		extLibName.requestFocus();

		isValidState = 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/references/EditExternalReferencePanel.java