/// class PD.Manage.Modules.ReportsContextMenu
// using PD.Web.UI.Controls.ContextMenuSegment

PD.Manage.Modules.ReportsContextMenu =
PD.Web.UI.Controls.ContextMenuSegment.extend({

    //===================================
    // EVENT HANDLERS
    //===================================

    onRegisterItems: function (e) {

        e.registerItem(new PD.Web.UI.Controls.ContextMenuCommandItem({
            commandId: "pd/reports/context-menu:report/edit-dialog"
        }));

        e.addSeparator();

        e.registerItem(new PD.Web.UI.Controls.ContextMenuCommandItem({
            commandId: "pd/reports/context-menu:report/delete"
        }));

        e.addSeparator();

        e.registerItem(new PD.Web.UI.Controls.ContextMenuCommandItem({
            commandId: "pd/reports/context-menu:report/download-template"
        }));

    },

    onOpen: function (e) {

        var grid = this.get_context().viewGrid;

        PD.context.get_default().get_commands().setState({
            "pd/reports/context-menu": {
                report: _.first(grid.getSelections().toArray())
            }
        });

    }

});