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

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

goog.require('org.apache.royale.core.IItemRenderer');
goog.require('org.apache.royale.core.IItemRendererClassFactory');
goog.require('org.apache.royale.core.UIBase');
goog.require('org.apache.royale.html.TextButton');
goog.require('org.apache.royale.html.supportClasses.TreeListData');
goog.require('org.apache.royale.html.supportClasses.UIItemRendererBase');
goog.require('org.apache.royale.core.IItemRendererParent');
goog.require('org.apache.royale.utils.Language');



/**
 * @constructor
 * @extends {org.apache.royale.html.supportClasses.UIItemRendererBase}
 * @implements {org.apache.royale.core.IItemRendererParent}
 */
org.apache.royale.html.supportClasses.TreeGridControlItemRenderer = function() {
  org.apache.royale.html.supportClasses.TreeGridControlItemRenderer.base(this, 'constructor');
  this.org_apache_royale_html_supportClasses_TreeGridControlItemRenderer__controlButton = new org.apache.royale.html.TextButton();
};
goog.inherits(org.apache.royale.html.supportClasses.TreeGridControlItemRenderer, org.apache.royale.html.supportClasses.UIItemRendererBase);


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


/**
 * @private
 * @type {org.apache.royale.html.TextButton}
 */
org.apache.royale.html.supportClasses.TreeGridControlItemRenderer.prototype.org_apache_royale_html_supportClasses_TreeGridControlItemRenderer__controlButton;


/**
 * @private
 * @type {org.apache.royale.core.IItemRendererClassFactory}
 */
org.apache.royale.html.supportClasses.TreeGridControlItemRenderer.prototype.org_apache_royale_html_supportClasses_TreeGridControlItemRenderer__originalItemRenderer;


/**
 * @private
 * @type {org.apache.royale.core.UIBase}
 */
org.apache.royale.html.supportClasses.TreeGridControlItemRenderer.prototype.org_apache_royale_html_supportClasses_TreeGridControlItemRenderer_child;


/**
 * @export
 * @override
 */
org.apache.royale.html.supportClasses.TreeGridControlItemRenderer.prototype.adjustSize = function() {
  var /** @type {org.apache.royale.html.supportClasses.TreeListData} */ treeData = org.apache.royale.utils.Language.as(this.listData, org.apache.royale.html.supportClasses.TreeListData);
  var /** @type {string} */ controlLabel = treeData.hasChildren ? (treeData.isOpen ? "▼" : "▶") : " ";
  this.org_apache_royale_html_supportClasses_TreeGridControlItemRenderer__controlButton.text = controlLabel;
  this.org_apache_royale_html_supportClasses_TreeGridControlItemRenderer__controlButton.x = 0;
  this.org_apache_royale_html_supportClasses_TreeGridControlItemRenderer__controlButton.y = 0;
  this.org_apache_royale_html_supportClasses_TreeGridControlItemRenderer__controlButton.setWidthAndHeight(20, this.height);
  this.org_apache_royale_html_supportClasses_TreeGridControlItemRenderer_child.x = this.org_apache_royale_html_supportClasses_TreeGridControlItemRenderer__controlButton.width;
  this.org_apache_royale_html_supportClasses_TreeGridControlItemRenderer_child.y = 0;
  this.org_apache_royale_html_supportClasses_TreeGridControlItemRenderer_child.setWidthAndHeight(this.width - this.org_apache_royale_html_supportClasses_TreeGridControlItemRenderer__controlButton.width, this.height);
};


/**
 * @export
 * @param {org.apache.royale.core.IItemRenderer} renderer
 * @param {boolean} dispatchAdded
 */
org.apache.royale.html.supportClasses.TreeGridControlItemRenderer.prototype.addItemRenderer = function(renderer, dispatchAdded) {
  this.addElement(renderer, dispatchAdded);
};


/**
 * @export
 * @param {org.apache.royale.core.IItemRenderer} renderer
 * @param {number} index
 */
org.apache.royale.html.supportClasses.TreeGridControlItemRenderer.prototype.addItemRendererAt = function(renderer, index) {
  this.addElementAt(renderer, index);
};


/**
 * @export
 * @param {org.apache.royale.core.IItemRenderer} renderer
 */
org.apache.royale.html.supportClasses.TreeGridControlItemRenderer.prototype.removeItemRenderer = function(renderer) {
  this.removeElement(renderer);
};


/**
 * @export
 * @param {number} index
 * @return {org.apache.royale.core.IItemRenderer}
 */
org.apache.royale.html.supportClasses.TreeGridControlItemRenderer.prototype.getItemRendererForIndex = function(index) {
  return org.apache.royale.utils.Language.as(this.org_apache_royale_html_supportClasses_TreeGridControlItemRenderer_child, org.apache.royale.core.IItemRenderer);
};


/**
 * @export
 * @param {number} index
 * @return {org.apache.royale.core.IItemRenderer}
 */
org.apache.royale.html.supportClasses.TreeGridControlItemRenderer.prototype.getItemRendererAt = function(index) {
  return org.apache.royale.utils.Language.as(this.org_apache_royale_html_supportClasses_TreeGridControlItemRenderer_child, org.apache.royale.core.IItemRenderer);
};


/**
 * @export
 */
org.apache.royale.html.supportClasses.TreeGridControlItemRenderer.prototype.removeAllItemRenderers = function() {
  this.removeElement(this.org_apache_royale_html_supportClasses_TreeGridControlItemRenderer_child);
};


/**
 * @export
 */
org.apache.royale.html.supportClasses.TreeGridControlItemRenderer.prototype.updateAllItemRenderers = function() {
};


org.apache.royale.html.supportClasses.TreeGridControlItemRenderer.prototype.get__controlButton = function() {
  return this.org_apache_royale_html_supportClasses_TreeGridControlItemRenderer__controlButton;
};


org.apache.royale.html.supportClasses.TreeGridControlItemRenderer.prototype.get__originalItemRenderer = function() {
  return this.org_apache_royale_html_supportClasses_TreeGridControlItemRenderer__originalItemRenderer;
};


org.apache.royale.html.supportClasses.TreeGridControlItemRenderer.prototype.set__originalItemRenderer = function(value) {
  this.org_apache_royale_html_supportClasses_TreeGridControlItemRenderer__originalItemRenderer = value;
  this.org_apache_royale_html_supportClasses_TreeGridControlItemRenderer_child = org.apache.royale.utils.Language.as(value.createItemRenderer(this), org.apache.royale.core.UIBase);
  org.apache.royale.utils.Language.as(this.org_apache_royale_html_supportClasses_TreeGridControlItemRenderer_child, org.apache.royale.core.IItemRenderer).data = this.data;
  this.addElement(this.org_apache_royale_html_supportClasses_TreeGridControlItemRenderer_child);
};


org.apache.royale.html.supportClasses.TreeGridControlItemRenderer.prototype.get__numItemRenderers = function() {
  return 1;
};


Object.defineProperties(org.apache.royale.html.supportClasses.TreeGridControlItemRenderer.prototype, /** @lends {org.apache.royale.html.supportClasses.TreeGridControlItemRenderer.prototype} */ {
/**
  * @export
  * @type {org.apache.royale.html.TextButton} */
controlButton: {
get: org.apache.royale.html.supportClasses.TreeGridControlItemRenderer.prototype.get__controlButton},
/**
  * @export
  * @type {org.apache.royale.core.IItemRendererClassFactory} */
originalItemRenderer: {
get: org.apache.royale.html.supportClasses.TreeGridControlItemRenderer.prototype.get__originalItemRenderer,
set: org.apache.royale.html.supportClasses.TreeGridControlItemRenderer.prototype.set__originalItemRenderer},
/**
  * @export
  * @type {number} */
numItemRenderers: {
get: org.apache.royale.html.supportClasses.TreeGridControlItemRenderer.prototype.get__numItemRenderers}}
);


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



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.html.supportClasses.TreeGridControlItemRenderer.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {return {};},
    accessors: function () {
      return {
        'controlButton': { type: 'org.apache.royale.html.TextButton', access: 'readonly', declaredBy: 'org.apache.royale.html.supportClasses.TreeGridControlItemRenderer'},
        'originalItemRenderer': { type: 'org.apache.royale.core.IItemRendererClassFactory', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.TreeGridControlItemRenderer'},
        'numItemRenderers': { type: 'int', access: 'readonly', declaredBy: 'org.apache.royale.html.supportClasses.TreeGridControlItemRenderer'}
      };
    },
    methods: function () {
      return {
        'TreeGridControlItemRenderer': { type: '', declaredBy: 'org.apache.royale.html.supportClasses.TreeGridControlItemRenderer'},
        'adjustSize': { type: 'void', declaredBy: 'org.apache.royale.html.supportClasses.TreeGridControlItemRenderer'},
        'addItemRenderer': { type: 'void', declaredBy: 'org.apache.royale.html.supportClasses.TreeGridControlItemRenderer', parameters: function () { return [  { index: 1, type: 'org.apache.royale.core.IItemRenderer', optional: false },{ index: 2, type: 'Boolean', optional: false } ]; }},
        'addItemRendererAt': { type: 'void', declaredBy: 'org.apache.royale.html.supportClasses.TreeGridControlItemRenderer', parameters: function () { return [  { index: 1, type: 'org.apache.royale.core.IItemRenderer', optional: false },{ index: 2, type: 'int', optional: false } ]; }},
        'removeItemRenderer': { type: 'void', declaredBy: 'org.apache.royale.html.supportClasses.TreeGridControlItemRenderer', parameters: function () { return [  { index: 1, type: 'org.apache.royale.core.IItemRenderer', optional: false } ]; }},
        'getItemRendererForIndex': { type: 'org.apache.royale.core.IItemRenderer', declaredBy: 'org.apache.royale.html.supportClasses.TreeGridControlItemRenderer', parameters: function () { return [  { index: 1, type: 'int', optional: false } ]; }},
        'getItemRendererAt': { type: 'org.apache.royale.core.IItemRenderer', declaredBy: 'org.apache.royale.html.supportClasses.TreeGridControlItemRenderer', parameters: function () { return [  { index: 1, type: 'int', optional: false } ]; }},
        'removeAllItemRenderers': { type: 'void', declaredBy: 'org.apache.royale.html.supportClasses.TreeGridControlItemRenderer'},
        'updateAllItemRenderers': { type: 'void', declaredBy: 'org.apache.royale.html.supportClasses.TreeGridControlItemRenderer'}
      };
    }
  };
};