@Override
	public boolean applyTo(Program program) {

		ReferenceManager refMgr = program.getReferenceManager();

		// Remove existing references
//		Reference[] refs = refMgr.getReferencesFrom(fromAddr, opIndex);
//		for (int i = 0; i < refs.length; i++) {
//			refMgr.delete(refs[i]);
//		}

		try {
			refMgr.addExternalReference(fromAddr, extName, extLabel, extAddr, source, opIndex,
				refType);
			return true;
		}
		catch (DuplicateNameException e) {
			errMsg = e.getMessage();
		}
		catch (InvalidInputException e) {
			errMsg = e.getMessage();
		}
		return false;
	}
@see ghidra.framework.cmd.Command#applyTo(ghidra.framework.model.DomainObject)
Ghidra/Features/Base/src/main/java/ghidra/app/cmd/refs/SetExternalRefCmd.java