/// class PD.Manage.Modules.ExtensionCreateDialogCommand

PD.Manage.Modules.ExtensionCreateDialogCommand =
PD.Commands.Command.extend({

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

    setDefaults: function () {

        this.props("id", this.inits("id") || "extension/create");
        this.props("enabled", true);
        this.props("icon", PD.Path.to16x16("table_plus.png"));
        this.props("label", "New");
        this.props("tooltip", "Create a new Extension.");
        this.state("isList", false);

    },

    execute: function (e) {
        this._super(e);

        PDJS.Shared.Features.FeatureDialogForNhib.open({
            title: "New Extension",
            height: "400px",
            width: "450px",
            args: {
                arbiterType: "ProspectDirector.Web.Manage.Modules.Extensions.ExtensionArbiter",
                targetType: "ProspectDirector.Web.Manage.Modules.Extensions.ExtensionUIO",
                properties: {
                    isList: this.state("isList")
                }
            },
            callbacks: {
                ok: (sender, e) => {
                    PD.context
                        .get_default()
                        .get_events()
                        .publish("extension/create", {
                            id: e.target.id
                        });
                }
            }
        });

    }

});