/// class PD.Manage.Modules.ViewCreateDialogCommand

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

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

    setDefaults: function () {
        this.props("id", "view/create-dialog");
        this.props("enabled", true);
        this.props("icon", PD.Path.to16x16("plus.png"));
        this.props("label", "New");
        this.props("tooltip", "Create a new View.");
    },

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

        ProspectDirector.Web.UI.FeatureSets.NHibTargetEditorDialog.open({
            config: {
                title: "New View"
            },
            data: {
                layoutType: ProspectDirector.Web.UI.FeatureSets.Layouts.TabStripLayout,
                targetArbiter: "ProspectDirector.Web.Manage.Modules.Views.ViewArbiter",
                targetType: "ProspectDirector.Web.Manage.Modules.Views.ViewUIO"
            },
            callbacks: {
                ok: function (sender, e) {
                    PD.context.get_default().get_events().publish("view/create", {
                        id: e.target.id
                    })
                }
            }
        });

    }

});
