/// class PD.Manage.Modules.DocumentTypeCreateDialogCommand

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

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

    setDefaults: function () {

        this.props("id", "document-type/create-dialog");
        this.props("enabled", true);
        this.props("icon", PD.Path.to16x16("plus.png"));
        this.props("label", "New");
        this.props("tooltip", "Create a new Document Type.");

    },

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

        ProspectDirector.Web.UI.FeatureSets.NHibTargetEditorDialog.open({
            config: {
                title: "New Document Type",
                height: "550px",
                width: "550px"
            },
            data: {
                targetArbiter: "ProspectDirector.Web.Manage.Modules.DocumentTypes.DocumentTypeArbiter",
                targetType: "ProspectDirector.Web.Shared.Modules.DocumentTypes.DocumentTypeUIO",
                layoutType: ProspectDirector.Web.UI.FeatureSets.Layouts.TabStripLayout
            },
            callbacks: {
                ok: function (sender, e) {

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

                }
            }
        });

    }

});