/// 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);

        ProspectDirector.Web.UI.FeatureSets.NHibTargetEditorDialog.open({
            config: {
                title: "New Extension",
                height: "400px",
                width: "450px"
            },
            data: {
                targetArbiter: "ProspectDirector.Web.Manage.Modules.Extensions.ExtensionArbiter",
                targetType: "ProspectDirector.Web.Manage.Modules.Extensions.ExtensionUIO",
                layoutType: ProspectDirector.Web.UI.FeatureSets.Layouts.TabStripLayout,
                properties: {
                    isList: this.state("isList")
                }
            },
            callbacks: {
                ok: function (sender, e) {
                    PD.context
                        .get_default()
                        .get_events()
                        .publish("extension/create", {
                            id: e.target.id
                        });
                }
            }
        });

    }

});