/// class PD.Manage.Modules.SystemVariables.SystemVariableCreateCommand

PD.Manage.Modules.SystemVariables.SystemVariableCreateCommand =
PD.Commands.Command.extend({

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

    setDefaults: function () {
        this.props("id", "variable/create");
        this.props("enabled", true);
        this.props("icon", PD.Path.to16x16("plus.png"));
        this.props("label", "New");
        this.props("tooltip", "Create a new System Variable.");
        this.state("tag", null);
    },

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

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

    _openDialog: function () {

        PDJS.Shared.Features.FeatureDialogForNhib.open({
            title: "New System Variable",
            args: {
                targetType: "ProspectDirector.Web.Manage.Modules.SystemVariables.SystemVariableUIO",
                arbiterType: "ProspectDirector.Web.Manage.Modules.SystemVariables.SystemVariableArbiter"
            },
            callbacks: {
                "ok": (sender, e) => {

                    PD.context
                        .get_default()
                        .get_events()
                        .publish("variable/create", {
                            id: e.target.id
                        });

                }
            }
        }, {
            height: 450,
            width: 500,
        });

    }

});