private IndexedOffset getIndexedOffsetForCharPosition(int charPosition) {
		int n = 0;
		for (int i = 0; i < fieldElements.length; i++) {
			int len = fieldElements[i].getText().length();
			if (charPosition < n + len) {
				return new IndexedOffset(i, charPosition - n);
			}
			n += len;
		}

		return new IndexedOffset(fieldElements.length - 1,
			fieldElements[fieldElements.length - 1].getText().length());
	}
A FieldElement that is composed of other FieldElements.  The elements are laid out horizontally.
Ghidra/Framework/Docking/src/main/java/docking/widgets/fieldpanel/field/CompositeFieldElement.java