/// class PD.Manage.ModuleOpenInNewWindowCommand

PD.Manage.ModuleOpenInNewWindowCommand =
PD.Commands.Command.extend({

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

    setDefaults: function () {
        this.props("id", "module/open-in-new-window");
        this.props("enabled", true);
        this.props("label", "Open in new window");
        this.props("tooltip", "Open in new window");
        this.state("module", null);
    },

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

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

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

        if (module != null) {
            window.open(PD.Path.resolve("~/Manage/" + module.route));
        }
        
    },

    _isEnabled: function () {
        return this.state("module") != null;
    }

});