/// 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 () {

        PDJS.Shared.Features.FeatureDialogForNhib.open({
            title: "New Rule Script",
            height: "400px",
            width: "450px",
            args: {
                targetType: "ProspectDirector.Web.Manage.Modules.Rules.RuleScriptUIO",
                arbiterType: "ProspectDirector.Web.Manage.Modules.Rules.RuleScriptArbiter"
            },
            callbacks: {
                "ok": (sender, e) => {

                    PD.context
                        .get_default()
                        .get_events()
                        .publish("rule-script/create", e.target);

                }
            }
        });

    }

});