<commit_before>package org.openforis.collect.presenter {
	import mx.controls.TextInput;
	
	import org.openforis.collect.i18n.Message;
	import org.openforis.collect.model.proxy.AttributeProxy;
	import org.openforis.collect.model.proxy.FieldProxy;
	import org.openforis.collect.ui.component.input.BooleanInputField;
	import org.openforis.collect.util.StringUtil;
	
	/**
	 * 
	 * @author <NAME>
	 * */
	public class BooleanInputFieldPresenter extends InputFieldPresenter {
		
		private static const TRUE:String = Message.get("edit.booleanValue.true");
		private static const FALSE:String = Message.get("edit.booleanValue.false");
		private static const RESTRICT_PATTERN:String = "[" + TRUE + FALSE + TRUE.toLowerCase() + FALSE.toLowerCase() + "\*\-\?]";
		
		private var _view:BooleanInputField;
		
		public function BooleanInputFieldPresenter(inputField:BooleanInputField) {
			_view = inputField;
			
			(inputField.textInput as TextInput).restrict = RESTRICT_PATTERN;
			super(inputField);
		}
		
		override protected function textToRequestValue():String {
			var value:String = null;
			var text:String = StringUtil.trim(_view.text);
			switch(text) {
				case TRUE:
				case TRUE.toLowerCase():
					value = "true";
					break;
				case FALSE:
				case FALSE.toLowerCase():
					value = "false";
					break;
				default:
					value = text;
			}
			return value;
		}
		
		override protected function getTextFromValue():String {
			var attribute:AttributeProxy = _view.attribute;
			if(attribute != null) {
				var field:FieldProxy = attribute.getField(0);
				var value:Object = field.value;
				if(field.symbol != null) {
					var shortCut:String = getShortCutForReasonBlank(field.symbol);
					if(shortCut != null) {
						return shortCut;<commit_msg>OFC-337 Boolean Input field allows to enter numbers<commit_after>package org.openforis.collect.presenter {
	import org.openforis.collect.i18n.Message;
	import org.openforis.collect.model.proxy.AttributeProxy;
	import org.openforis.collect.model.proxy.FieldProxy;
	import org.openforis.collect.ui.component.input.BooleanInputField;
	import org.openforis.collect.ui.component.input.TextInput;
	import org.openforis.collect.util.StringUtil;
	
	/**
	 * 
	 * @author <NAME>
	 * */
	public class BooleanInputFieldPresenter extends InputFieldPresenter {
		
		private static const TRUE:String = Message.get("edit.booleanValue.true");
		private static const FALSE:String = Message.get("edit.booleanValue.false");
		private static const RESTRICT_PATTERN:String = "^(\\*|-|\\?|" + TRUE + "|" + TRUE.toLowerCase() + "|" + FALSE + "|" + FALSE.toLowerCase() + ")$";
		
		private var _view:BooleanInputField;
		
		public function BooleanInputFieldPresenter(inputField:BooleanInputField) {
			_view = inputField;
			_view.restrict = RESTRICT_PATTERN;
			super(inputField);
		}
		
		override protected function textToRequestValue():String {
			var value:String = null;
			var text:String = StringUtil.trim(_view.text);
			switch(text) {
				case TRUE:
				case TRUE.toLowerCase():
					value = "true";
					break;
				case FALSE:
				case FALSE.toLowerCase():
					value = "false";
					break;
				default:
					value = text;
			}
			return value;
		}
		
		override protected function getTextFromValue():String {
			var attribute:AttributeProxy = _view.attribute;
			if(attribute != null) {
				var field:FieldProxy = attribute.getField(0);
				var value:Object = field.value;
				if(field.symbol != null) {
					var shortCut:String = getShortCutForReasonBlank(field.symbol);
					if(shortCut != null) {
						return shortCut;
{'fraction_non_alphanumeric': 0.11731686780802694, 'fraction_numerical': 0.0025259612685938817, 'mean_word_length': 3.888888888888889, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3322288', 'n_tokens_mistral': 1289, 'n_tokens_neox': 1071, 'n_words': 216}