/**
 * Generated by Apache Royale Compiler from org\apache\royale\html\supportClasses\DateItemRenderer.as
 * org.apache.royale.html.supportClasses.DateItemRenderer
 *
 * @fileoverview
 *
 * @suppress {checkTypes|accessControls}
 */

goog.provide('org.apache.royale.html.supportClasses.DateItemRenderer');

goog.require('org.apache.royale.html.supportClasses.StringItemRenderer');
goog.require('org.apache.royale.utils.Language');



/**
 *  constructor.
 *
 *  @langversion 3.0
 *  @playerversion Flash 10.2
 *  @playerversion AIR 2.6
 *  @productversion Royale 0.0
 * @constructor
 * @extends {org.apache.royale.html.supportClasses.StringItemRenderer}
 */
org.apache.royale.html.supportClasses.DateItemRenderer = function() {
  org.apache.royale.html.supportClasses.DateItemRenderer.base(this, 'constructor');
  this.className = "DateItemRenderer";
};
goog.inherits(org.apache.royale.html.supportClasses.DateItemRenderer, org.apache.royale.html.supportClasses.StringItemRenderer);


/**
 * Prevent renaming of class. Needed for reflection.
 */
goog.exportSymbol('org.apache.royale.html.supportClasses.DateItemRenderer', org.apache.royale.html.supportClasses.DateItemRenderer);


org.apache.royale.html.supportClasses.DateItemRenderer.prototype.set__data = function(value) {
  org.apache.royale.html.supportClasses.DateItemRenderer.superClass_.set__data.apply(this, [ value] );
  
  if (org.apache.royale.utils.Language.is(value, Date)) {
    this.text = String(org.apache.royale.utils.Language.as(value, Date).getDate());
    
    this.element.style["pointer-events"] = "";
  } else {
    this.text = "";
    
    this.element.style["pointer-events"] = "none";
  }
};


org.apache.royale.html.supportClasses.DateItemRenderer.prototype.set__height = function(value) {
  org.apache.royale.html.supportClasses.DateItemRenderer.superClass_.set__height.apply(this, [ value] );
  this.element.style["line-height"] = String(value) + "px";
};


Object.defineProperties(org.apache.royale.html.supportClasses.DateItemRenderer.prototype, /** @lends {org.apache.royale.html.supportClasses.DateItemRenderer.prototype} */ {
/**
  * @export
  * @type {Object} */
data: {
get: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__data,
set: org.apache.royale.html.supportClasses.DateItemRenderer.prototype.set__data},
/**
  * @export
  * @type {number} */
height: {
get: org.apache.royale.core.UIBase.prototype.get__height,
set: org.apache.royale.html.supportClasses.DateItemRenderer.prototype.set__height}}
);


/**
 * Metadata
 *
 * @type {Object.<string, Array.<Object>>}
 */
org.apache.royale.html.supportClasses.DateItemRenderer.prototype.ROYALE_CLASS_INFO = { names: [{ name: 'DateItemRenderer', qName: 'org.apache.royale.html.supportClasses.DateItemRenderer', kind: 'class' }] };



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.html.supportClasses.DateItemRenderer.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {return {};},
    accessors: function () {
      return {
        'data': { type: 'Object', access: 'writeonly', declaredBy: 'org.apache.royale.html.supportClasses.DateItemRenderer'},
        'height': { type: 'Number', access: 'writeonly', declaredBy: 'org.apache.royale.html.supportClasses.DateItemRenderer'}
      };
    },
    methods: function () {
      return {
        'DateItemRenderer': { type: '', declaredBy: 'org.apache.royale.html.supportClasses.DateItemRenderer'}
      };
    }
  };
};