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

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

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

    onRegisterItems: function (e) {

        e.registerItem(new PD.Web.UI.Controls.ContextMenuCommandItem({
            commandId: "pd/data-model:extension-column/properties-dialog"
        }));

        e.addSeparator();

        e.registerItem(new PD.Web.UI.Controls.ContextMenuCommandItem({
            commandId: "pd/data-model:extension-column/delete-dialog"
        }));

    },

    onOpen: function (e) {

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

        PD.context.get_default().get_commands().setState({
            "pd/data-model/context-menu": {
                extension: selection
            }
        });

    }

});