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

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

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

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

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

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

    onRegisterItems: function (e) {
        
        var that = this;

        e.registerItem(new PD.Web.UI.Controls.ContextMenuItem({
            text: "Edit",
            imageUrl: PD.Path.to16x16("pencil.png", "shared"),
            command: function (e) {
                that.getSettingService().edit();
            },
            enable: function (e) {
                return that.get_setting() != null;
            }
        }));
        
    },

    //===================================
    // PRIVATE METHODS
    //===================================

    getSettingService: function () {
        return new PD.Manage.Modules.SystemSettingsService(
                this.get_viewGrid(),
                this.get_setting());
    }

});