public String getTextBeforeCursor(JTextField where) {
		int i = findField(where);
		if (i == -1) {
			throw new IllegalArgumentException("" + where);
		}
		return state.getTextBeforeCursor(i);
	}
Get the text preceding the caret in the given field

@param where the field whose caret to consider
@return the text
Ghidra/Framework/Docking/src/main/java/docking/widgets/textfield/TextFieldLinker.java