/// class PD.Manage.Modules.ExpressionCreateDialogCommand

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

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

    setDefaults: function () {
        this.props("id", "expression/create-dialog");
        this.props("enabled", true);
        this.props("icon", PD.Path.to16x16("plus.png"));
        this.props("label", "New");
        this.props("tooltip", "Create a new Expression.");
        this.state("tag", null);
    },

    execute: function (e) {
        this._super(e);
        this._openDialog();
    },

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

    _openDialog: function () {

        PDJS.Shared.Features.FeatureDialogForNhib.open({
            title: "New Expression",
            args: {
                targetType: "ProspectDirector.Web.Manage.Modules.Tags.ExpressionUIO",
                arbiterType: "ProspectDirector.Web.Manage.Modules.Tags.ExpressionArbiter"
            },
            callbacks: {
                "ok": (sender, e) => {

                    PD.context
                        .get_default()
                        .get_events()
                        .publish("expression/create", {
                            id: e.target.id
                        });

                }
            }
        }, {
            height: 400,
            width: 500,
        });
    }

});