/// class PD.Manage.Modules.BooleanSettingFeature

/**
@class BooleanSettingFeature
@constructor
@namespace Web.UI.Canvas.Charts
@extends Web.UI.FeatureSets.MacroEditorBase
**/
PD.Manage.Modules.BooleanSettingFeature =
ProspectDirector.Web.UI.FeatureSets.MacroEditorBase.extend({

    //==============================
    // PROPERTIES
    //==============================

    get_trueRadioButton: function () {
        return this.get_container().find("INPUT[type=radio][value=true]");
    },

    get_falseRadioButton: function () {
        return this.get_container().find("INPUT[type=radio][value=false]");
    },

    //==============================
    // EVENT HANDLERS
    //==============================

    //==============================
    // OVERRIDDEN METHODS
    //==============================

    activate: function () {
        var that = this;
        if (this.getValue("value") === true) {
            this.get_trueRadioButton().prop("checked", true);
        }
        else {
            this.get_falseRadioButton().prop("checked", true);
        }
        this.get_container().find("[type=radio]:checked").focus();

        this.get_trueRadioButton().prop("disabled", this.getValue("isReadOnly"));
        this.get_falseRadioButton().prop("disabled", this.getValue("isReadOnly"));

    },

    commit: function () {
        this.setValue("value", this.get_trueRadioButton().prop("checked"));
    },

    render: function () {

        var result = [
            "<div id='" + this.getId() + "' style='padding:10px 10px 10px 10px;font-size:12px;'>",
                "<label style='display:inline-block;margin-bottom:10px;font-weight:bold;'>" + this.getValue("label") + "</label>",
                "<div style='padding:0 10px 0 10px;'>",
                    "<label style='display:inline-block;margin-bottom:10px;'><input type='radio' name='value' value='true' class='-pd-macro-editor-input' />&nbsp;True</label><br/>",
                    "<label style='display:inline-block;'><input type='radio' name='value' value='false' class='-pd-macro-editor-input' />&nbsp;False</label><br/>",
                "</div>",
            "</div>"
        ];

        return result.join("");

    }

});