Initialize the checkbox.

@param {jQuery} checkbox
@param {Object} [options]
974088
function(checkbox, options) {
        this.element = checkbox = $(checkbox);
        options = this.setOptions(options, checkbox);
        this.wrapper = this._buildWrapper();

        // Create custom input
        this.input = this.render(options.checkboxTemplate)
            .attr('for', checkbox.attr('id'))
            .insertAfter(checkbox);

        // Initialize events
        this.initialize();
    }
661217
private void createCheckboxes() {
    node.getChildren().clear();
    checkboxes.clear();

    for (int i = 0; i < field.getItems().size(); i++) {
      CheckBox cb = new CheckBox();

      cb.setText(field.getItems().get(i).toString());
      cb.setSelected(field.getSelection().contains(field.getItems().get(i)));

      checkboxes.add(cb);
    }

    node.getChildren().addAll(checkboxes);
  }
990754
function(element, options) {
        this.setElement(element);
        this.setOptions(options, this.element);

        // Set events
        this.addEvent('horizontalresize', 'window', $.debounce(this.onResize.bind(this)));

        this.initialize();

        // Render the matrix
        this.refresh();
    }
1110733
function init() {
        CodeMirror.defineOption("foldGutter", false, function (cm, val, old) {
            if (old && old !== CodeMirror.Init) {
                cm.clearGutter(cm.state.foldGutter.options.gutter);
                cm.state.foldGutter = null;
                cm.off("gutterClick", old.onGutterClick);
                cm.off("change", onChange);
                cm.off("viewportChange", onViewportChange);
                cm.off("cursorActivity", onCursorActivity);

                cm.off("fold", onFold);
                cm.off("unfold", onUnFold);
                cm.off("swapDoc", updateInViewport);
            }
            if (val) {
                cm.state.foldGutter = new State(parseOptions(val));
                updateInViewport(cm);
                cm.on("gutterClick", val.onGutterClick);
                cm.on("change", onChange);
                cm.on("viewportChange", onViewportChange);
                cm.on("cursorActivity", onCursorActivity);
                cm.on("fold", onFold);
                cm.on("unfold", onUnFold);
                cm.on("swapDoc", updateInViewport);
            }
        });
    }
351756
private void setupCheckboxBindings() {
    for (CheckBox checkbox : checkboxes) {
      checkbox.disableProperty().bind(field.editableProperty().not());
    }
  }
173668
public function init()
    {
        parent::init();

        Html::addCssClass($this->options, ['container' => 'switch']);

        if ($this->hasModel()) {
            if (!isset($this->inputOptions['name'])) {
                $this->inputOptions['name'] = Html::getInputName($this->model, $this->attribute);
            }

            if (!isset($this->inputOptions['id'])) {
                $this->inputOptions['id'] = Html::getInputId($this->model, $this->attribute);
            }
        } else {
            $this->inputOptions['name'] = $this->name;
        }

        $this->inputOptions['uncheck'] = isset($this->uncheck) ? $this->uncheck : is_null($this->uncheck) ? null : '0';
        $this->inputOptions['value'] = isset($this->value) ? $this->value : '1';
    }
279428
private void setupCheckBoxes() {

        m_includeResource.setValue(new Boolean(true));
        m_includeUnchanged.setValue(new Boolean(true));
        m_includeSystem.setValue(new Boolean(true));
        m_recursive.setValue(new Boolean(true));
    }
1034466
public function checkbox()
    {
        $this->element = Angular::checkbox('{model}', '{label}', [
            'fieldid' => $this->form->getFieldId($this->attribute),
            'ng-init' => '{initValue}',
        ]);

        return $this;
    }
723294
function(element) {
            var $element = $(element);
            if ($element.is(':selected')) {
                $element.prop('selected', true);
            }

            // Support the label attribute on options.
            var label = this.options.optionLabel(element);
            var value = $element.val();
            var inputType = this.options.multiple ? "checkbox" : "radio";

            var $li = $(this.options.templates.li);
            var $label = $('label', $li);
            $label.addClass(inputType);

            if (this.options.enableHTML) {
                $label.html(" " + label);
            }
            else {
                $label.text(" " + label);
            }

            var $checkbox = $('<input/>').attr('type', inputType);

            if (this.options.checkboxName) {
                $checkbox.attr('name', this.options.checkboxName);
            }
            $label.prepend($checkbox);

            var selected = $element.prop('selected') || false;
            $checkbox.val(value);

            if (value === this.options.selectAllValue) {
                $li.addClass("multiselect-item multiselect-all");
                $checkbox.parent().parent()
                    .addClass('multiselect-all');
            }

            $label.attr('title', $element.attr('title'));

            this.$ul.append($li);

            if ($element.is(':disabled')) {
                $checkbox.attr('disabled', 'disabled')
                    .prop('disabled', true)
                    .closest('a')
                    .attr("tabindex", "-1")
                    .closest('li')
                    .addClass('disabled');
            }

            $checkbox.prop('checked', selected);

            if (selected && this.options.selectedClass) {
                $checkbox.closest('li')
                    .addClass(this.options.selectedClass);
            }
        }
1291726
private void initSelectButtons() {

        m_selectGroup = new CmsTriStateCheckBox("");
        m_selectGroup.addStyleName(I_CmsInputLayoutBundle.INSTANCE.inputCss().inlineBlock());
        m_selectGroup.setNextStateAfterIntermediateState(State.on);
        m_selectGroup.addValueChangeHandler(new ValueChangeHandler<CmsTriStateCheckBox.State>() {

            public void onValueChange(ValueChangeEvent<State> event) {

                State state = event.getValue();
                if (state == State.on) {
                    m_model.signalGroup(Signal.publish, m_groupIndex);
                } else if (state == State.off) {
                    m_model.signalGroup(Signal.unpublish, m_groupIndex);
                }
            }

        });
        m_header.add(m_selectGroup);
    }
486542
function setCheckbox (input, value) {
  if (!value || value === "true" || value === "on") {
    value = "yes";
  }
  input.val([value]);
}
938917
public static function init(PDO $pdo, $options = [])
    {
        DB::init($pdo);
        self::$initOptions = $options;
    }
1166415
function() {
    if(lang.isArray(this.checkboxOptions)) {
        var checkboxOption, checkboxValue, checkboxId, elLabel, j, len;
        
        // Create the checkbox buttons in an IE-friendly way...
        for(j=0,len=this.checkboxOptions.length; j<len; j++) {
            checkboxOption = this.checkboxOptions[j];
            checkboxValue = lang.isValue(checkboxOption.value) ?
                    checkboxOption.value : checkboxOption;

            checkboxId = this.getId() + "-chk" + j;
            this.getContainerEl().innerHTML += "<input type=\"checkbox\"" +
                    " id=\"" + checkboxId + "\"" + // Needed for label
                    " value=\"" + checkboxValue + "\" />";
            
            // Create the labels in an IE-friendly way
            elLabel = this.getContainerEl().appendChild(document.createElement("label"));
            elLabel.htmlFor = checkboxId;
            elLabel.innerHTML = lang.isValue(checkboxOption.label) ?
                    checkboxOption.label : checkboxOption;
        }
        
        // Store the reference to the checkbox elements
        var allCheckboxes = [];
        for(j=0; j<len; j++) {
            allCheckboxes[allCheckboxes.length] = this.getContainerEl().childNodes[j*2];
        }
        this.checkboxes = allCheckboxes;

        if(this.disableBtns) {
            this.handleDisabledBtns();
        }
    }
    else {
    }
}
156895
function(element, options) {
        element = this.setElement(element);
        options = this.setOptions(options);

        if (!options.target || !options.marker) {
            throw new Error('A marker and target is required');
        }

        if (element.css('overflow') === 'auto') {
            this.container = element;
        }

        // Initialize events
        this.addEvents([
            ['scroll', 'container', $.throttle(this.onScroll.bind(this), options.throttle)],
            ['ready', 'document', 'onScroll']
        ]);

        this.initialize();

        // Gather markets and targets
        this.refresh();
    }
1091281
function init(options) {
    self.email = options.email;
    self.key = options.token;
    self.cloudflareClient = new CloudFlareClient(options.email, options.token);
  }
1264587
public function checkbox($name, $value = 1, $label = null, $checked = null, $options = array())
    {
        if ($this->hasErrors($name)) {
            $options = $this->appendClassToOptions('is-invalid', $options);
        }

        $checkable = parent::checkbox($name, $value, $checked, $options);

        return $this->wrapCheckable($label, 'checkbox', $checkable);
    }
139001
public function init()
	{
		if(isset($this->checkBoxHtmlOptions['name']))
			$name=$this->checkBoxHtmlOptions['name'];
		else
		{
			$name=$this->id;
			if(substr($name,-2)!=='[]')
				$name.='[]';
			$this->checkBoxHtmlOptions['name']=$name;
		}
		$name=strtr($name,array('['=>"\\[",']'=>"\\]"));

		if($this->selectableRows===null)
		{
			if(isset($this->checkBoxHtmlOptions['class']))
				$this->checkBoxHtmlOptions['class'].=' select-on-check';
			else
				$this->checkBoxHtmlOptions['class']='select-on-check';
			return;
		}

		$cball=$cbcode='';
		if($this->selectableRows==0)
		{
			//.. read only
			$cbcode="return false;";
		}
		elseif($this->selectableRows==1)
		{
			//.. only one can be checked, uncheck all other
			$cbcode="jQuery(\"input:not(#\"+this.id+\")[name='$name']\").prop('checked',false);";
		}
		elseif(strpos($this->headerTemplate,'{item}')!==false)
		{
			//.. process check/uncheck all
			$cball=<<<CBALL
jQuery(document).on('click','#{$this->id}_all',function() {
	var checked=this.checked;
	jQuery("input[name='$name']:enabled").each(function() {this.checked=checked;});
});

CBALL;
			$cbcode="jQuery('#{$this->id}_all').prop('checked', jQuery(\"input[name='$name']\").length==jQuery(\"input[name='$name']:checked\").length);";
		}

		if($cbcode!=='')
		{
			$js=$cball;
			$js.=<<<EOD
jQuery(document).on('click', "input[name='$name']", function() {
	$cbcode
});
EOD;
			Yii::app()->getClientScript()->registerScript(__CLASS__.'#'.$this->id,$js);
		}
	}