<commit_before>
Ui.Togglable.extend('Ui.CheckBox', 
/**Ui.CheckBox#*/
{
	graphic: undefined,
	contentBox: undefined,
	hbox: undefined,
	content: undefined,
	text: undefined,

	/**
	 * @constructs
	 * @class
	 * @extends Ui.Togglable
	 */
	constructor: function(config) {
		this.addEvents('change');

		this.setPadding(3);

		this.hbox = new Ui.HBox();
		this.append(this.hbox);
		
		this.graphic = new Ui.CheckBoxGraphic();
		this.hbox.append(this.graphic);

		this.connect(this, 'down', this.onCheckBoxDown);
		this.connect(this, 'up', this.onCheckBoxUp);
		this.connect(this, 'toggle', this.onCheckBoxToggle);
		this.connect(this, 'untoggle', this.onCheckBoxUntoggle);

		this.connect(this, 'focus', this.onCheckFocus);
		this.connect(this, 'blur', this.onCheckBlur);

	},

	getValue: function() {
		return this.getIsToggled();
	},

	setValue: function(value) {
		if(value)
			this.toggle();
		else
			this.untoggle();
	},

	setText: function(text) {
		if(text === undefined) {
			if(this.contentBox != undefined) {
				this.hbox.remove(this.contentBox);
				this.contentBox = undefined;
			}
			this.text = undefined;
			this.content = undefined;
		}
		else {
			if(this.text != undefined) {
				this.text = text;
				this.contentBox.setText(this.text);
			}
			else {
				if(this.content != undefined) {
					this.hbox.remove(this.contentBox);
					this.content = undefined;
				}
				this.text = text;
				this.contentBox = new Ui.Label({ margin: 8,  text: this.text });
				this.hbox.append(this.contentBox);
			}
		}
	},

	getText: function() {
		return this.text;
	},

	/**
	 *#@+ @private
	 */
	onCheckFocus: function() {
		this.graphic.setColor(this.getStyleProperty('focusColor'));
	},
	
	onCheckBlur: function() {
		this.graphic.setColor(this.getStyleProperty('color'));
	},

	onCheckBoxDown: function() {
		this.graphic.setIsDown(true);
	},

	onCheckBoxUp: function() {
		this.graphic.setIsDown(false);
	},<commit_msg>use Ui.Text in Ui.CheckBox to allow line return<commit_after>
Ui.Togglable.extend('Ui.CheckBox', 
/**Ui.CheckBox#*/
{
	graphic: undefined,
	contentBox: undefined,
	hbox: undefined,
	content: undefined,
	text: undefined,

	/**
	 * @constructs
	 * @class
	 * @extends Ui.Togglable
	 */
	constructor: function(config) {
		this.addEvents('change');

		this.setPadding(3);

		this.hbox = new Ui.HBox();
		this.append(this.hbox);
		
		this.graphic = new Ui.CheckBoxGraphic();
		this.hbox.append(this.graphic);

		this.connect(this, 'down', this.onCheckBoxDown);
		this.connect(this, 'up', this.onCheckBoxUp);
		this.connect(this, 'toggle', this.onCheckBoxToggle);
		this.connect(this, 'untoggle', this.onCheckBoxUntoggle);

		this.connect(this, 'focus', this.onCheckFocus);
		this.connect(this, 'blur', this.onCheckBlur);

	},

	getValue: function() {
		return this.getIsToggled();
	},

	setValue: function(value) {
		if(value)
			this.toggle();
		else
			this.untoggle();
	},

	setText: function(text) {
		if(text === undefined) {
			if(this.contentBox != undefined) {
				this.hbox.remove(this.contentBox);
				this.contentBox = undefined;
			}
			this.text = undefined;
			this.content = undefined;
		}
		else {
			if(this.text != undefined) {
				this.text = text;
				this.contentBox.setText(this.text);
			}
			else {
				if(this.content != undefined) {
					this.hbox.remove(this.contentBox);
					this.content = undefined;
				}
				this.text = text;
				this.contentBox = new Ui.Text({ margin: 8,  text: this.text });
				this.hbox.append(this.contentBox, true);
			}
		}
	},

	getText: function() {
		return this.text;
	},

	/**
	 *#@+ @private
	 */
	onCheckFocus: function() {
		this.graphic.setColor(this.getStyleProperty('focusColor'));
	},
	
	onCheckBlur: function() {
		this.graphic.setColor(this.getStyleProperty('color'));
	},

	onCheckBoxDown: function() {
		this.graphic.setIsDown(true);
	},

	onCheckBoxUp: function() {
		this.graphic.setIsDown(false);
	},
{'fraction_non_alphanumeric': 0.16636759805178158, 'fraction_numerical': 0.0010253781081773904, 'mean_word_length': 3.6507747318235997, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5151775', 'n_tokens_mistral': 1603, 'n_tokens_neox': 1392, 'n_words': 226}