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

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

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

    onRegisterItems: function (e) {

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

    },

    onOpen: function (e) {

        var grid = this.get_context().viewGrid,
            selections = grid.getSelections().toArray();

        PD.context.get_default().get_commands().setState({
            "pd/view/context-menu": {
                view: _.first(selections)
            }
        });

    }

});