/// class PD.Manage.Modules.Rules.RuleScriptCreateDialogCommand

PD.Manage.Modules.Rules.RuleScriptCreateDialogCommand =
PD.Commands.Command.extend({

    //===================================
    // PUBLIC METHODS
    //===================================

    setDefaults: function () {

        this.props("id", "rule-script/create-dialog");
        this.props("enabled", true);
        this.props("icon", PD.Path.to16x16("plus.png"));
        this.props("label", "New");
        this.props("tooltip", "Create a new Rule Script.");

    },

    execute: function (e) {
        this._super(e);
        this._showDialog();
    },

    //===================================
    // PRIVATE METHODS
    //===================================

    _showDialog: function () {

        ProspectDirector.Web.UI.FeatureSets.NHibTargetEditorDialog.open({
            config: {
                title: "New Rule Script",
                height: "400px",
                width: "450px"
            },
            data: {
                targetArbiter: "ProspectDirector.Web.Manage.Modules.Rules.RuleScriptArbiter",
                targetType: "ProspectDirector.Web.Manage.Modules.Rules.RuleScriptUIO",
                layoutType: ProspectDirector.Web.UI.FeatureSets.Layouts.TabStripLayout
            },
            callbacks: {
                ok: function (sender, e) {
                    PD.context.get_default().get_events().publish("rule-script/create", e.target);
                }
            }
        });

    }

});