protected List<FieldRow> layoutElements(List<FieldElement> textElements, int maxLines) {
		List<FieldRow> newSubFields = new ArrayList<>();

		boolean tooManyLines = textElements.size() > maxLines;
		int currentRow = 0;
		for (int i = 0; i < textElements.size() && i < maxLines; i++) {
			FieldElement element = textElements.get(i);
			if (tooManyLines && (i == maxLines - 1)) {
				FieldElement[] elements = new FieldElement[2];
				elements[0] = element;
				elements[1] = new StrutFieldElement(element, 500);
				element = new CompositeFieldElement(elements);
			}
			TextField field = createFieldForLine(element);
			int modelRow = currentRow;
			int screenRow = newSubFields.size();
			newSubFields.add(new FieldRow(field, modelRow, screenRow));
			isClipped |= field.isClipped();

			currentRow += field.getNumRows();
		}

		isClipped |= tooManyLines;
		return newSubFields;
	}
Sets the primary State.
@param state the state to set.
Ghidra/Framework/Docking/src/main/java/docking/widgets/fieldpanel/field/VerticalLayoutTextField.java