/// class PD.Web.UI.Controls.ViewGridOptionsMenuSegment
/// using PD.Web.UI.Controls.ContextMenuSegment

PD.Web.UI.Controls.ViewGridOptionsMenuSegment =
PD.Web.UI.Controls.ContextMenuSegment.extend({

    //===================================
    // PROPERTIES
    //===================================

    get_viewGrid: function () {
        return this.get_context();
    },

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

    onRegisterItems: function (e) {

        var contextId = this.get_viewGrid().get_id();

        e.registerItem(new PD.Web.UI.Controls.ContextMenuCommandItem({
            contextId: contextId,
            commandId: "pd/view-grid:view-grid/anchor-dialog"
        }));

        e.registerItem(new PD.Web.UI.Controls.ContextMenuCommandItem({
            contextId: contextId,
            commandId: "pd/view-grid:view-grid/design-columns-dialog"
        }));

        e.registerItem(new PD.Web.UI.Controls.ContextMenuCommandItem({
            contextId: contextId,
            commandId: "pd/view-grid:view-grid/design-filters-dialog"
        }));

        e.addSeparator();

        e.registerItem(new PD.Web.UI.Controls.ContextMenuCommandItem({
            contextId: contextId,
            commandId: "pd/view-grid:view-grid/bounds-columns-dialog"
        }));

        e.registerItem(new PD.Web.UI.Controls.ContextMenuCommandItem({
            contextId: contextId,
            commandId: "pd/view-grid:view-grid/bounds-filters-dialog"
        }));

        e.registerItem(new PD.Web.UI.Controls.ContextMenuCommandItem({
            contextId: contextId,
            commandId: "pd/view-grid:view-grid/find-in-results-dialog"
        }));

        e.addSeparator();
        
        e.registerItem(new PD.Web.UI.Controls.ContextMenuCommandItem({
            contextId: contextId,
            commandId: "pd/view-grid:view-grid/refresh"
        }));

        e.registerItem(new PD.Web.UI.Controls.ContextMenuCommandItem({
            contextId: contextId,
            commandId: "pd/view-grid:view-grid/undo"
        }));

        e.addSeparator();

        e.registerItem(new PD.Web.UI.Controls.ContextMenuCommandItem({
            contextId: contextId,
            commandId: "pd/view-grid:view-grid/export-unformatted"
        }));

        e.registerItem(new PD.Web.UI.Controls.ContextMenuCommandItem({
            contextId: contextId,
            commandId: "pd/view-grid:view-grid/export-formatted"
        }));

    }

});