private Symbol getExternalSymbol(ListingActionContext context) {
		Symbol s = null;
		ProgramLocation location = context.getLocation();
		if (location instanceof OperandFieldLocation) {
			OperandFieldLocation opLoc = (OperandFieldLocation) location;
			Address address = opLoc.getAddress();
			int opIndex = opLoc.getOperandIndex();
			Program program = context.getProgram();
			ReferenceManager refMgr = program.getReferenceManager();
			Reference ref = refMgr.getPrimaryReferenceFrom(address, opIndex);
			if (ref != null) {
				s = program.getSymbolTable().getSymbol(ref);
			}
		}
		if (s == null || !s.isExternal()) {
			return null;
		}
		if (s.getSymbolType() == SymbolType.LABEL || s.getSymbolType() == SymbolType.FUNCTION) {
			return s;
		}
		return null;
	}
Creates the action for editing an existing external location or external function in the 
listing.
@param plugin the label manager plugin, which owns this action.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/label/EditExternalLabelAction.java