/// class PD.Manage.Modules.EventDialogCommand

PD.Manage.Modules.EventDialogCommand =
PD.Commands.Command.extend({

    //===================================
    // PUBLIC METHODS
    //===================================

    setDefaults: function () {
        this.props("id", "event/view-dialog");
        this.props("enabled", false);
        this.props("icon", PD.Path.resolve("~/application/icons/16x16/MAGNIFYING_GLASS.png"));
        this.props("label", "Details");
        this.props("tooltip", "View details for the selected event.");
        this.state("event", null);
    },

    setState: function (state) {
        this._super(state);
        this.props("enabled", this._isEnabled());
    },

    execute: function (e) {
        this._super(e);

        var event = this.state("event");

        this._showDialog(event.id);

    },

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

    _isEnabled: function () {
        return this.state("event") != null
            && this.state("event").id != null;
    },

    _showDialog: function (id) {

        PDJS.Shared.Features.FeatureDialogForNhib.open({
            title: "Event Log Entry",
            args: {
                targetId: id,
                targetType: "ProspectDirector.Web.Manage.Modules.Events.EventUIO",
                arbiterType: "ProspectDirector.Web.Manage.Modules.Events.EventArbiter"
            }
        }, {
            height: 550,
            width: 650,
        });

    }

});