/// class PD.Web.MonitoredDownloadManagerDialog
/// using PD.Web.UI.Dialog

PD.Web.MonitoredDownloadManagerDialog =
PD.Web.UI.Dialog.extend({

    //===================================
    // FIELDS
    //===================================

    _grid: null,
    _uploadComponent: null,

    //===================================
    // CONSTRUCTOR
    //===================================

    init: function (options) {

        this._super($.extend(true, {
            config: {
                height: "60px",
                width: "250px",
                resizable: false,
                title: "Download File"
            }
        }, options));

    },

    //===================================
    // PROPERTIES
    //===================================

    get_progress: function () {
        return this.get_node().find("[data-id=progress]");
    },

    //===================================
    // PROTECTED EVENT HANDLERS
    //===================================

    template: function (options) {

        var message = this.get_options()["message"];

        return [
            "<div class='-pd-monitored-download'>",
                "<table>",
                    "<tr>",
                        "<td>",
                            message != null ? message : "Downloading your file.<br/>Please wait...",
                        "</td>",
                    "</tr>",
                "</table>",
            "</div>"
        ];

    },

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

    updateMessage: function (message) {
        this.get_node().html(message);
    }

});

PD.Web.MonitoredDownloadManagerDialog.open = function (options) {
    return new PD.Web.MonitoredDownloadManagerDialog(options);
};