private int addElement(Instruction inst, List<OperandFieldElement> elements, Object opElem,
			boolean underline, int opIndex, int subOpIndex, int characterOffset) {

		if (opElem instanceof VariableOffset) {
			List<Object> objList = ((VariableOffset) opElem).getObjects();
			return addElements(inst, elements, objList, opIndex, subOpIndex, underline,
				characterOffset);
		}

		if (opElem instanceof List) {
			return addElements(inst, elements, (List<?>) opElem, opIndex, subOpIndex, underline,
				characterOffset);
		}

		ColorStyleAttributes attributes = getOpAttributes(opElem, inst, opIndex);

		AttributedString as = new AttributedString(opElem.toString(), attributes.colorAttribute,
			getMetrics(attributes.styleAttribute), underline, ListingColors.UNDERLINE);

		elements.add(new OperandFieldElement(as, opIndex, subOpIndex, characterOffset));
		if (wrapOnSemicolon && opElem instanceof Character c && c == ';') {
			elements.add(LINE_BREAK);
		}
		return characterOffset + as.length();
	}
Constructor
@param name the name of the field.
@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/OperandFieldHelper.java