protected String getPrefix(JTextField field) {
		try {
			return field.getText(0, field.getCaretPosition());
		}
		catch (BadLocationException e) {
			throw new AssertionError("INTERNAL: Should not be here", e);
		}
	}
Gets the prefix from the given text field, used to query the model.

@param field an attached field, usually the one with focus.
@return the prefix to use as the query.
Ghidra/Framework/Docking/src/main/java/docking/widgets/autocomplete/TextFieldAutocompleter.java