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

PD.Manage.Modules.SelectionListContextMenu =
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/properties-dialog"
        }));

        e.addSeparator();

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

    },

    onOpen: function (e) {

        var grid = this.get_context()["grid"],
            selectionList = _.first(grid.getSelections().toArray);

        PD.context.get_default().get_commands().setState({
            "pd/selection-list/context-menu": {
                selectionList: selectionList
            }
        });

    }

});