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

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

goog.require('org.apache.royale.core.IChild');
goog.require('org.apache.royale.events.Event');
goog.require('org.apache.royale.events.IEventDispatcher');
goog.require('org.apache.royale.html.beads.PanelView');
goog.require('org.apache.royale.html.supportClasses.AccordionItemRenderer');
goog.require('org.apache.royale.html.supportClasses.ICollapsible');
goog.require('org.apache.royale.utils.Language');



/**
 *  The AccordionItemRendererView class is the default view for
 *  the org.apache.royale.html.supportClasses.AccordionItemRenderer classes.
 *  It provides some layout optimizations that can be attained by assuming
 *  the strand to be an org.apache.royale.html.supportClasses.ICollapsible.
 *  
 *  @langversion 3.0
 *  @playerversion Flash 10.2
 *  @playerversion AIR 2.6
 *  @productversion Royale 0.0
 * @constructor
 * @extends {org.apache.royale.html.beads.PanelView}
 */
org.apache.royale.html.beads.AccordionItemRendererView = function() {
  org.apache.royale.html.beads.AccordionItemRendererView.base(this, 'constructor');
};
goog.inherits(org.apache.royale.html.beads.AccordionItemRendererView, org.apache.royale.html.beads.PanelView);


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


/**
 * @protected
 * @override
 */
org.apache.royale.html.beads.AccordionItemRendererView.prototype.completeSetup = function() {
  org.apache.royale.utils.Language.as(this._strand, org.apache.royale.events.IEventDispatcher).addEventListener("dataChange", org.apache.royale.utils.Language.closure(this.org_apache_royale_html_beads_AccordionItemRendererView_dataChangeHandler, this, 'dataChangeHandler'));
};


/**
 * @private
 * @param {org.apache.royale.events.Event} event
 */
org.apache.royale.html.beads.AccordionItemRendererView.prototype.org_apache_royale_html_beads_AccordionItemRendererView_dataChangeHandler = function(event) {
  if (this.titleBar.parent == null) {
    org.apache.royale.utils.Language.as(this._strand, org.apache.royale.html.supportClasses.AccordionItemRenderer).$addElement(this.titleBar);
  }
  if (this.contentArea.parent == null) {
    org.apache.royale.utils.Language.as(this._strand, org.apache.royale.html.supportClasses.AccordionItemRenderer).$addElement(org.apache.royale.utils.Language.as(this.contentArea, org.apache.royale.core.IChild));
  }
  org.apache.royale.html.beads.AccordionItemRendererView.superClass_.completeSetup.apply(this);
  this.performLayout(null);
};


/**
 * @protected
 * @override
 */
org.apache.royale.html.beads.AccordionItemRendererView.prototype.performLayout = function(event) {
  var /** @type {org.apache.royale.html.supportClasses.ICollapsible} */ collapsibleStrand = org.apache.royale.utils.Language.as(this._strand, org.apache.royale.html.supportClasses.ICollapsible);
  if (!collapsibleStrand.collapsed) {
    org.apache.royale.utils.Language.as(this._strand, org.apache.royale.events.IEventDispatcher, true).dispatchEvent(new org.apache.royale.events.Event("layoutNeeded"));
  } else {
    
  }
};


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



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.html.beads.AccordionItemRendererView.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {return {};},
    accessors: function () {return {};},
    methods: function () {
      return {
        'AccordionItemRendererView': { type: '', declaredBy: 'org.apache.royale.html.beads.AccordionItemRendererView'}
      };
    }
  };
};