
module.exports = new Class({
	Extends: Htk.Field
	,Tag: 'htk-check'

	,render() {
		var node = this.createRoot('input');
		node.type = 'checkbox';
		node.addEventListener('change', this.changed.bind(this));
	}

	,changed() {
		this.valueChanged(this.node.checked);
	}

	,putValue(value) {
		if (value)
			this.node.checked = true;
		else
			this.node.checked = false;
	}

	,setEditable(editable) {
		this.node.disabled = !editable;
	}
});
