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

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

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

    onRegisterItems: function (e) {

        e.registerItem(new PD.Web.UI.Controls.ContextMenuCommandItem({
            commandId: "pd/selection-list:selection-list-item/edit-dialog"
        }));

        e.addSeparator();

        e.registerItem(new PD.Web.UI.Controls.ContextMenuCommandItem({
            commandId: "pd/selection-list:selection-list-item/delete"
        }));

    },

    onOpen: function (e) {
        
        var grid = this.get_context()["grid"];

        PD.context.get_default().get_commands().setState({
            "pd/selection-list/context-menu": {
                selectionListItems: grid.getSelections().toArray()
            }
        });

    }

});