private static String getTextForFieldsInLayout(Layout layout, FieldRange fieldRange,
			int startFieldNumber, int endFieldNumber) {
		StringBuilder buffy = new StringBuilder();
		for (int i = startFieldNumber; i < endFieldNumber; i++) {
			Field field = layout.getField(i);
			buffy.append(field.getTextWithLineSeparators());
			if (i != endFieldNumber - 1) {
				buffy.append(' ');
			}
		}
		return buffy.toString();
	}
Returns the text within the given selection.
@param selection the selection
@param panel the field panel
@return the text
Ghidra/Framework/Docking/src/main/java/docking/widgets/fieldpanel/support/FieldSelectionHelper.java