/// class PD.Manage.Modules.ObjectModel.ProcessListContextMenu
// using PD.Web.UI.Controls.ContextMenuSegment

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

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

    onRegisterItems: function (e) {

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

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

        e.addSeparator();

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

    },

    onOpen: function (e) {

        var grid = this.get_context()["grid"],
            item = grid.getSelections().first();

        PD.context.get_default().get_commands().setState({
            "pd/process/context-menu": {
                processId: item.id,
                processName: item.Name
            }
        });

    }

});