// Generated by CoffeeScript 1.12.7
var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
  hasProp = {}.hasOwnProperty;

ez5.PdfCreator.Template.Row = (function(superClass) {
  extend(Row, superClass);

  function Row() {
    return Row.__super__.constructor.apply(this, arguments);
  }

  Row.prototype.initOpts = function() {
    Row.__super__.initOpts.call(this);
    this.addOpts({
      template: {
        check: ez5.PdfCreator.Template
      }
    });
    return this;
  };

  Row.prototype.readOpts = function() {
    Row.__super__.readOpts.call(this);
    this.__labelName = new CUI.Label({
      text: ""
    });
    this.__labelDateCreated = new CUI.Label({
      text: ""
    });
    this.__labelDateLastModified = new CUI.Label({
      text: ""
    });
    this.__labelUserCreate = new CUI.Label({
      text: ""
    });
    this.__labelUserLastModify = new CUI.Label({
      text: ""
    });
    this.addColumn(new CUI.ListViewColumn({
      element: this.__labelName
    }));
    this.addColumn(new CUI.ListViewColumn({
      element: this.__labelDateCreated
    }));
    this.addColumn(new CUI.ListViewColumn({
      element: this.__labelDateLastModified
    }));
    this.addColumn(new CUI.ListViewColumn({
      element: this.__labelUserCreate
    }));
    this.addColumn(new CUI.ListViewColumn({
      element: this.__labelUserLastModify
    }));
    this.reload();
  };

  Row.prototype.getData = function() {
    return this._template.getData();
  };

  Row.prototype.reload = function() {
    var data;
    data = this.getData();
    this.__labelName.setText(this._template.getDisplayName());
    this.__labelDateCreated.setText(ez5.format_date_and_time(data.date_created));
    this.__labelDateLastModified.setText(ez5.format_date_and_time(data.date_last_modified));
    this.__labelUserCreate.setText(data.user_create);
    this.__labelUserLastModify.setText(data.user_last_modify);
  };

  Row.getHeader = function() {
    var header;
    header = new CUI.ListViewRow({
      selectable: false
    });
    header.addColumn(new CUI.ListViewHeaderColumn({
      label: {
        text: $$("pdf-creator.list.header.template-name|text")
      }
    }));
    header.addColumn(new CUI.ListViewHeaderColumn({
      label: {
        text: $$("pdf-creator.list.header.date-created|text")
      }
    }));
    header.addColumn(new CUI.ListViewHeaderColumn({
      label: {
        text: $$("pdf-creator.list.header.date-last-modified|text")
      }
    }));
    header.addColumn(new CUI.ListViewHeaderColumn({
      label: {
        text: $$("pdf-creator.list.header.user-create|text")
      }
    }));
    header.addColumn(new CUI.ListViewHeaderColumn({
      label: {
        text: $$("pdf-creator.list.header.user-last-modify|text")
      }
    }));
    return header;
  };

  return Row;

})(CUI.ListViewRow);
