@Override
	protected DataTypeAndFields getSelectedType(ActionContext context) {

		ComponentProvider provider = context.getComponentProvider();
		if (!(provider instanceof EnumEditorProvider enumProvider)) {
			return null;
		}

		String fieldName = enumProvider.getSelectedFieldName();
		if (fieldName == null) {
			return null;
		}

		updateMenuName(fieldName);
		DataType dt = enumProvider.getEnum();
		return new DataTypeAndFields(dt, new String[] { fieldName });
	}
Finds references to a member of an enum.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/editor/FindReferencesToEnumFieldAction.java