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

goog.provide('org.apache.royale.html.Accordion');

goog.require('org.apache.royale.events.Event');
goog.require('org.apache.royale.events.IEventDispatcher');
goog.require('org.apache.royale.html.List');
goog.require('org.apache.royale.html.beads.IAccordionCollapseBead');
goog.require('org.apache.royale.utils.loadBeadFromValuesManager');
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.List}
 */
org.apache.royale.html.Accordion = function() {
  org.apache.royale.html.Accordion.base(this, 'constructor');
};
goog.inherits(org.apache.royale.html.Accordion, org.apache.royale.html.List);


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


/**
 * @private
 * @type {org.apache.royale.html.beads.IAccordionCollapseBead}
 */
org.apache.royale.html.Accordion.prototype.org_apache_royale_html_Accordion__collapseBead;


/**
 * @export
 * @override
 */
org.apache.royale.html.Accordion.prototype.addedToParent = function() {
  org.apache.royale.html.Accordion.superClass_.addedToParent.apply(this);
  this.accordionCollapseBead;
  if (this.selectedIndex < 0) {
    this.selectedIndex = 0;
  } else {
    org.apache.royale.utils.Language.as(this.model, org.apache.royale.events.IEventDispatcher).dispatchEvent(new org.apache.royale.events.Event("selectedIndexChanged"));
  }
};


org.apache.royale.html.Accordion.prototype.get__accordionCollapseBead = function() {
  if (!this.org_apache_royale_html_Accordion__collapseBead)
    this.org_apache_royale_html_Accordion__collapseBead = org.apache.royale.utils.Language.as(org.apache.royale.utils.loadBeadFromValuesManager(org.apache.royale.html.beads.IAccordionCollapseBead, "iAccordionCollapseBead", this), org.apache.royale.html.beads.IAccordionCollapseBead);
  return this.org_apache_royale_html_Accordion__collapseBead;
};


Object.defineProperties(org.apache.royale.html.Accordion.prototype, /** @lends {org.apache.royale.html.Accordion.prototype} */ {
/**
  * @export
  * @type {org.apache.royale.html.beads.IAccordionCollapseBead} */
accordionCollapseBead: {
get: org.apache.royale.html.Accordion.prototype.get__accordionCollapseBead}}
);


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



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