/// class PD.Manage.Modules.DocumentTypeDefaultFormDialogCommand

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

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

    setDefaults: function () {

        this.props("id", "document-type/default-form-dialog");
        this.props("enabled", true);
        this.props("icon", PD.Path.to16x16("form.png"));
        this.props("label", "Edit Canvas");
        this.props("tooltip", "Edit the Canvas associated with<br/>the selected Document Type.");

        this.state("documentType", null);
    },


    setState: function (state) {
        this._super(state);
        this.props("enabled", this.isEnabled());
    },

    isEnabled: function () {
        return this.state("documentType") != null;
    },

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

        var that = this;
        var documentType = this.state("documentType");

        PDJS.Canvas.Design.DesignerDialog.open({
            documentId: documentType.canvasId,
            isFileBased: true,
            canvasType: PDJS.Canvas.Core.CanvasType.DocumentType,
            callbacks: {
                ok: function () { }
            }

        });

    }

});