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

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

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



/**
 *  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.AlternatingBackgroundColorStringItemRenderer = function() {
  org.apache.royale.html.supportClasses.AlternatingBackgroundColorStringItemRenderer.base(this, 'constructor');
};
goog.inherits(org.apache.royale.html.supportClasses.AlternatingBackgroundColorStringItemRenderer, org.apache.royale.html.supportClasses.StringItemRenderer);


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


/**
 * @private
 * @type {string}
 */
org.apache.royale.html.supportClasses.AlternatingBackgroundColorStringItemRenderer.prototype.org_apache_royale_html_supportClasses_AlternatingBackgroundColorStringItemRenderer__color0;


/**
 * @private
 * @type {string}
 */
org.apache.royale.html.supportClasses.AlternatingBackgroundColorStringItemRenderer.prototype.org_apache_royale_html_supportClasses_AlternatingBackgroundColorStringItemRenderer__color1;


/**
 * @private
 * @type {boolean}
 */
org.apache.royale.html.supportClasses.AlternatingBackgroundColorStringItemRenderer.prototype.org_apache_royale_html_supportClasses_AlternatingBackgroundColorStringItemRenderer_oddIndex;


/**
 * @export
 * @override
 */
org.apache.royale.html.supportClasses.AlternatingBackgroundColorStringItemRenderer.prototype.addedToParent = function() {
  org.apache.royale.html.supportClasses.AlternatingBackgroundColorStringItemRenderer.superClass_.addedToParent.apply(this);
  var /** @type {number} */ index = this.parent.getElementIndex(this);
  this.org_apache_royale_html_supportClasses_AlternatingBackgroundColorStringItemRenderer_oddIndex = ((index % 2) == 1);
  this.element.style.backgroundColor = this.org_apache_royale_html_supportClasses_AlternatingBackgroundColorStringItemRenderer_oddIndex ? this.org_apache_royale_html_supportClasses_AlternatingBackgroundColorStringItemRenderer__color1 : this.org_apache_royale_html_supportClasses_AlternatingBackgroundColorStringItemRenderer__color0;
};


/**
 * @asprivate
 * @export
 * @override
 */
org.apache.royale.html.supportClasses.AlternatingBackgroundColorStringItemRenderer.prototype.updateRenderer = function() {
  org.apache.royale.html.supportClasses.AlternatingBackgroundColorStringItemRenderer.superClass_.updateRenderer.apply(this);
  if (this.element.style.backgroundColor == null || this.element.style.backgroundColor == "")
    this.element.style.backgroundColor = this.org_apache_royale_html_supportClasses_AlternatingBackgroundColorStringItemRenderer_oddIndex ? this.org_apache_royale_html_supportClasses_AlternatingBackgroundColorStringItemRenderer__color1 : this.org_apache_royale_html_supportClasses_AlternatingBackgroundColorStringItemRenderer__color0;
};


org.apache.royale.html.supportClasses.AlternatingBackgroundColorStringItemRenderer.prototype.get__backgroundColor0 = function() {
  return this.org_apache_royale_html_supportClasses_AlternatingBackgroundColorStringItemRenderer__color0;
};


org.apache.royale.html.supportClasses.AlternatingBackgroundColorStringItemRenderer.prototype.set__backgroundColor0 = function(value) {
  this.org_apache_royale_html_supportClasses_AlternatingBackgroundColorStringItemRenderer__color0 = value;
};


org.apache.royale.html.supportClasses.AlternatingBackgroundColorStringItemRenderer.prototype.get__backgroundColor1 = function() {
  return this.org_apache_royale_html_supportClasses_AlternatingBackgroundColorStringItemRenderer__color1;
};


org.apache.royale.html.supportClasses.AlternatingBackgroundColorStringItemRenderer.prototype.set__backgroundColor1 = function(value) {
  this.org_apache_royale_html_supportClasses_AlternatingBackgroundColorStringItemRenderer__color1 = value;
};


Object.defineProperties(org.apache.royale.html.supportClasses.AlternatingBackgroundColorStringItemRenderer.prototype, /** @lends {org.apache.royale.html.supportClasses.AlternatingBackgroundColorStringItemRenderer.prototype} */ {
/**
  * @export
  * @type {string} */
backgroundColor0: {
get: org.apache.royale.html.supportClasses.AlternatingBackgroundColorStringItemRenderer.prototype.get__backgroundColor0,
set: org.apache.royale.html.supportClasses.AlternatingBackgroundColorStringItemRenderer.prototype.set__backgroundColor0},
/**
  * @export
  * @type {string} */
backgroundColor1: {
get: org.apache.royale.html.supportClasses.AlternatingBackgroundColorStringItemRenderer.prototype.get__backgroundColor1,
set: org.apache.royale.html.supportClasses.AlternatingBackgroundColorStringItemRenderer.prototype.set__backgroundColor1}}
);


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



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.html.supportClasses.AlternatingBackgroundColorStringItemRenderer.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {return {};},
    accessors: function () {
      return {
        'backgroundColor0': { type: 'String', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.AlternatingBackgroundColorStringItemRenderer'},
        'backgroundColor1': { type: 'String', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.AlternatingBackgroundColorStringItemRenderer'}
      };
    },
    methods: function () {
      return {
        'AlternatingBackgroundColorStringItemRenderer': { type: '', declaredBy: 'org.apache.royale.html.supportClasses.AlternatingBackgroundColorStringItemRenderer'},
        'addedToParent': { type: 'void', declaredBy: 'org.apache.royale.html.supportClasses.AlternatingBackgroundColorStringItemRenderer'},
        'updateRenderer': { type: 'void', declaredBy: 'org.apache.royale.html.supportClasses.AlternatingBackgroundColorStringItemRenderer'}
      };
    }
  };
};