/// class PD.Manage.Modules.ConfigureSearchGroupsCommand

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

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

    setDefaults: function () {

        this.props("id", "document-type/configure-search-groups");
        this.props("enabled", true);
        this.props("icon", PD.Path.to16x16("magnifying_glass.PNG"));
        this.props("label", "Search Groups");
        this.props("tooltip", "Configure Search Groups for the selected Document Type.<br/><br/>Search groups control what data associated with this Document Type is available for inclusion in Views and Charts.");

        this.state("documentType", null);

    },

    setState: function (state) {
        this._super(state);
        this.props("enabled", this.state("documentType") != null)
    },

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

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

        PDJS.Manage.Views.SearchGroupsDialog.open({
            title: documentType.name + " Search Groups",
            documentTypeId: documentType.id
        });

    }

});