@Override
	public ProgramLocation getProgramLocation(int row, int col, ListingField bf) {
		Object obj = bf.getProxy().getObject();
		if (!(obj instanceof CodeUnit) || row < 0 || col < 0) {
			return null;
		}

		CodeUnit cu = (CodeUnit) obj;
		int[] cpath = null;
		if (cu instanceof Data) {
			cpath = ((Data) cu).getComponentPath();
		}

		ListingTextField btf = (ListingTextField) bf;
		RowColLocation fieldLoc = btf.screenToDataLocation(row, col);
		int tokenIndex = fieldLoc.row();
		int tokenCharPos = fieldLoc.col();

		// compute tokens associated with code unit bytes (excluding trailing alignment bytes)
		int size = cu.getLength();
		int len = size / byteGroupSize;
		int residual = size % byteGroupSize;
		if (residual != 0) {
			len++;
		}

		// compensate for split group containing optional alignment bytes
		if (tokenIndex >= len && residual != 0) {
			if (tokenIndex == len) {
				tokenCharPos += residual * CHARS_IN_BYTE;
			}
			--tokenIndex;
		}

		int byteIndex = tokenIndex * byteGroupSize + getByteIndexInToken(tokenCharPos);
		int charOffset = computeCharOffset(tokenCharPos);
		return new BytesFieldLocation(cu.getProgram(), cu.getMinAddress(),
			cu.getMinAddress().add(byteIndex), cpath, charOffset);
	}
Constructor
@param model the model that the field belongs to.
@param hlProvider the HightLightStringProvider.
@param displayOptions the Options for display properties.
@param fieldOptions the Options for field specific properties.
Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/BytesFieldFactory.java