/// class PD.Manage.Modules.TagCreateDialogCommand

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

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

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

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

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

    _openDialog: function () {

        ProspectDirector.Web.UI.FeatureSets.NHibTargetEditorDialog.open({
            config: {
                title: "New Tag",
                height: 400,
                width: 500
            },
            data: {
                targetArbiter: "ProspectDirector.Web.Manage.Modules.Tags.TagArbiter",
                targetType: "ProspectDirector.Web.Manage.Modules.Tags.TagUIO",
                layoutType: ProspectDirector.Web.UI.FeatureSets.Layouts.TabStripLayout
            },
            callbacks: {
                ok: function (sender, e) {
                    PD.context.get_default().get_events().publish("tag/create", {
                        id: e.target.id
                    });
                }
            }
        });

    }

});