@Override
	public ListingField getField(ProxyObj<?> proxy, int varWidth) {
		Object obj = proxy.getObject();
		if (!enabled) {
			return null;
		}

		if (!(obj instanceof CodeUnit)) {
			return null;
		}

		CodeUnit cu = (CodeUnit) obj;
		List<Reference> xrefs = XReferenceUtils.getXReferences(cu, maxXRefs + 1);
		int maxOffcuts = Math.max(0, maxXRefs - xrefs.size());
		List<Reference> offcuts = XReferenceUtils.getOffcutXReferences(cu, maxOffcuts);
		if (sortChoice == SORT_CHOICE.Address) {
			xrefs.sort(null);
			offcuts.sort(null);
		}
		else {
			xrefs.sort(typeComparator);
			offcuts.sort(typeComparator);
		}

		if (groupByFunction) {
			return getFieldByFunction(proxy, varWidth, xrefs, offcuts);
		}
		return getFieldByAddress(proxy, varWidth, xrefs, offcuts);
	}
Constructs a new XRefFieldFactory based on the provider and model.

@param name the owner of this field factory
@param model the model that the field belongs to.
@param hlProvider the HightLightProvider.
@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/XRefFieldFactory.java