/// class PD.Web.UI.Controls.ViewGridShowAnchorDialogCommand
/// using PD.Web.UI.Controls.ViewGridCommand

PD.Web.UI.Controls.ViewGridShowAnchorDialogCommand =
PD.Web.UI.Controls.ViewGridCommand.extend({

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

    setDefaults: function () {
        this._super();
        this.props("id", "view-grid/anchor-dialog");
        this.props("enabled", true);
        this.props("icon", PD.Path.to16x16("anchor.png"));
        this.props("label", "Anchor...");
        this.props("tooltip", "Anchor");
    },

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

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

        //var that = this;

        //ProspectDirector.Types.Core.Dialogs.ViewAnchor.show({
        //    params: {
        //        viewStateId: this.get_viewStateId()
        //    },
        //    callbacks: {
        //        ok: function () {
        //            that.get_viewGrid().build();
        //        }
        //    }
        //});

        PDJS.Shared.Features.FeatureDialogForNhib.open({
            args: {
                targetType: "ProspectDirector.Web.Shared.Modules.Views.ViewAnchorsUIO",
                arbiterType: "ProspectDirector.Web.Shared.Modules.Views.ViewAnchorsArbiter",
                properties: {
                    viewStateId: this.get_viewStateId()
                }
            },
            callbacks: {
                "ok": (sender, data) => {

                }
            }
        }, {
            title: "View Anchors",
            width: 600,
            height: 500
        });

    },

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

    _isVisible: function () {
        return this.get_viewGrid().get_configuration().get_settings().allowAnchor;
    }

});