@Override
	protected FieldMatcher createFieldMatcher(DataTypeAndFields typeAndFields) {

		DataType dt = typeAndFields.dataType();
		String message = "Find uses of '" + dt.getName() + "' field by name or offset";
		String userChoice = OptionDialog.showEditableInputChoiceDialog(null, "Choose Field",
			message, typeAndFields.fieldNames(), null, OptionDialog.QUESTION_MESSAGE);
		if (userChoice == null) {
			return null; // cancelled
		}

		try {
			return new FieldMatcher(dt, NumericUtilities.parseInt(userChoice));
		}
		catch (NumberFormatException e) {
			return new FieldMatcher(dt, userChoice);
		}
	}
An action that can be used on a {@link Composite} or {@link Enum} to find references to a field
by name or offset.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/actions/FindReferencesToFieldByNameOrOffsetAction.java