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

goog.provide('org.apache.royale.html.beads.DataItemRendererFactoryForHierarchicalData');

goog.require('org.apache.royale.collections.TreeData');
goog.require('org.apache.royale.core.ISelectableItemRenderer');
goog.require('org.apache.royale.core.IStrand');
goog.require('org.apache.royale.html.beads.DataItemRendererFactoryForCollectionView');
goog.require('org.apache.royale.html.supportClasses.TreeListData');
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.beads.DataItemRendererFactoryForCollectionView}
 */
org.apache.royale.html.beads.DataItemRendererFactoryForHierarchicalData = function() {
  org.apache.royale.html.beads.DataItemRendererFactoryForHierarchicalData.base(this, 'constructor');
};
goog.inherits(org.apache.royale.html.beads.DataItemRendererFactoryForHierarchicalData, org.apache.royale.html.beads.DataItemRendererFactoryForCollectionView);


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


/**
 * @private
 * @type {org.apache.royale.core.IStrand}
 */
org.apache.royale.html.beads.DataItemRendererFactoryForHierarchicalData.prototype.org_apache_royale_html_beads_DataItemRendererFactoryForHierarchicalData__strand;


/**
 * Sets the itemRenderer's data with additional tree-related data.
 *
 *  @langversion 3.0
 *  @playerversion Flash 10.2
 *  @playerversion AIR 2.6
 *  @productversion Royale 0.0
 * @protected
 * @override
 */
org.apache.royale.html.beads.DataItemRendererFactoryForHierarchicalData.prototype.setData = function(ir, data, index) {
  if (!this.dataProviderModel)
    return;
  var /** @type {org.apache.royale.collections.TreeData} */ treeData = org.apache.royale.utils.Language.as(this.dataProviderModel.dataProvider, org.apache.royale.collections.TreeData);
  var /** @type {number} */ depth = treeData.getDepth(data);
  var /** @type {boolean} */ isOpen = treeData.isOpen(data);
  var /** @type {boolean} */ hasChildren = treeData.hasChildren(data);
  var /** @type {org.apache.royale.html.supportClasses.TreeListData} */ treeListData = new org.apache.royale.html.supportClasses.TreeListData();
  treeListData.depth = depth;
  treeListData.isOpen = isOpen;
  treeListData.hasChildren = hasChildren;
  ir.listData = treeListData;
  org.apache.royale.html.beads.DataItemRendererFactoryForHierarchicalData.superClass_.setData.apply(this, [ ir, data, index] );
};


org.apache.royale.html.beads.DataItemRendererFactoryForHierarchicalData.prototype.set__strand = function(value) {
  this.org_apache_royale_html_beads_DataItemRendererFactoryForHierarchicalData__strand = value;
  org.apache.royale.html.beads.DataItemRendererFactoryForHierarchicalData.superClass_.set__strand.apply(this, [ value] );
};


Object.defineProperties(org.apache.royale.html.beads.DataItemRendererFactoryForHierarchicalData.prototype, /** @lends {org.apache.royale.html.beads.DataItemRendererFactoryForHierarchicalData.prototype} */ {
/**
  * @export
  * @type {org.apache.royale.core.IStrand} */
strand: {
set: org.apache.royale.html.beads.DataItemRendererFactoryForHierarchicalData.prototype.set__strand}}
);


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



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.html.beads.DataItemRendererFactoryForHierarchicalData.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {return {};},
    accessors: function () {
      return {
        'strand': { type: 'org.apache.royale.core.IStrand', access: 'writeonly', declaredBy: 'org.apache.royale.html.beads.DataItemRendererFactoryForHierarchicalData'}
      };
    },
    methods: function () {
      return {
        'DataItemRendererFactoryForHierarchicalData': { type: '', declaredBy: 'org.apache.royale.html.beads.DataItemRendererFactoryForHierarchicalData'}
      };
    },
    metadata: function () { return [  ]; }
  };
};