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

		Address currAddr = cu.getMinAddress();

		Program prog = cu.getProgram();

		Listing list = prog.getListing();
		Function func = list.getFunctionAt(currAddr);

		Symbol[] symbols = cu.getSymbols();

		// check to see if there is an offcut reference to this code unit
		// if there is, then create a "OFF" label
		List<Address> offcuts = getOffcutReferenceAddress(cu);
		boolean hasOffcuts = offcuts.size() > 0;

		// if there is only a function symbol and we are not showing function symbols, get out.
		if (!hasOffcuts && symbols.length == 1 && func != null && !displayFunctionLabel) {
			return null;
		}

		makePrimaryLastItem(symbols);

		int length = symbols.length;
		if (!displayFunctionLabel && func != null) {
			length = symbols.length - 1;
		}

		if (hasOffcuts) {
			length += offcuts.size();
		}

		if (length == 0) {
			return null;
		}

		List<FieldElement> elements = new ArrayList<>(length);

		if (hasOffcuts) {
			for (Address offcut : offcuts) {
				AttributedString as = getAttributedOffsetText(obj, cu, currAddr, offcut);
				if (as == null) {
					as = new AttributedString(EMPTY_ICON,
						SymbolUtilities.getDynamicOffcutName(currAddr),
						inspector.getOffcutSymbolColor(),
						getMetrics(inspector.getOffcutSymbolStyle()), false, null);
				}
				elements.add(new TextFieldElement(as, elements.size(), 0));
			}
		}

		if (currAddr.isExternalAddress() && length == 1) {
			// Show extenal address and original imported name (not supported by field location)
			ExternalLocation extLoc = prog.getExternalManager().getExternalLocation(symbols[0]);
			if (extLoc != null) {
				StringBuilder externalLocationDetails = new StringBuilder();
				Address addr = extLoc.getAddress();
				if (addr != null) {
					externalLocationDetails.append(addr.toString());
				}
				String origImportedName = extLoc.getOriginalImportedName();
				if (origImportedName != null) {
					if (!externalLocationDetails.isEmpty()) {
						externalLocationDetails.append(": ");
					}
					externalLocationDetails.append(origImportedName);
				}
				if (!externalLocationDetails.isEmpty()) {
					AttributedString as =
						new AttributedString(EMPTY_ICON, externalLocationDetails.toString(),
							OptionsGui.LABELS_NON_PRIMARY.getColor(),
							getMetrics(OptionsGui.LABELS_NON_PRIMARY.getStyle()), false, null);
					elements.add(new TextFieldElement(as, elements.size(), 0));
				}
			}
		}

		for (Symbol symbol : symbols) {
			if (func != null && symbol.isPrimary() && !displayFunctionLabel) {
				continue;
			}

			Icon icon = symbol.isPinned() ? ANCHOR_ICON : EMPTY_ICON;
			ColorAndStyle c = inspector.getColorAndStyle(symbol);
			AttributedString as = new AttributedString(icon, checkLabelString(symbol, prog),
				c.getColor(), getMetrics(c.getStyle()), false, null);
			elements.add(new TextFieldElement(as, elements.size(), 0));
		}

		return ListingTextField.createMultilineTextField(this, proxy, elements, x, width,
			hlProvider);
	}
@see ghidra.app.util.viewer.field.FieldFactory#getField(ProxyObj, int)
Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/LabelFieldFactory.java