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

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

goog.require('org.apache.royale.core.IChild');
goog.require('org.apache.royale.core.IStrand');
goog.require('org.apache.royale.core.ITitleBarModel');
goog.require('org.apache.royale.events.Event');
goog.require('org.apache.royale.html.Panel');
goog.require('org.apache.royale.html.TitleBar');
goog.require('org.apache.royale.html.beads.PanelView');
goog.require('org.apache.royale.core.ISelectableItemRenderer');
goog.require('org.apache.royale.html.supportClasses.ICollapsible');
goog.require('org.apache.royale.utils.Language');



/**
 * @constructor
 * @extends {org.apache.royale.html.Panel}
 * @implements {org.apache.royale.core.ISelectableItemRenderer}
 * @implements {org.apache.royale.html.supportClasses.ICollapsible}
 */
org.apache.royale.html.supportClasses.AccordionItemRenderer = function() {
  org.apache.royale.html.supportClasses.AccordionItemRenderer.base(this, 'constructor');
  this.percentWidth = 100;
};
goog.inherits(org.apache.royale.html.supportClasses.AccordionItemRenderer, org.apache.royale.html.Panel);


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


/**
 * @private
 * @type {number}
 */
org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.org_apache_royale_html_supportClasses_AccordionItemRenderer__index = 0;


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


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


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


/**
 * @private
 * @type {Object}
 */
org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.org_apache_royale_html_supportClasses_AccordionItemRenderer_value;


/**
 * @private
 * @type {boolean}
 */
org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.org_apache_royale_html_supportClasses_AccordionItemRenderer__selectable = true;


/**
 * @private
 * @type {boolean}
 */
org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.org_apache_royale_html_supportClasses_AccordionItemRenderer__hoverable = true;


/**
 * @export
 */
org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.collapse = function() {
  this.height = this.collapsedHeight;
};


org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.get__selectable = function() {
  return this.org_apache_royale_html_supportClasses_AccordionItemRenderer__selectable;
};


org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.set__selectable = function(value) {
  this.org_apache_royale_html_supportClasses_AccordionItemRenderer__selectable = value;
};


org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.get__hoverable = function() {
  return this.org_apache_royale_html_supportClasses_AccordionItemRenderer__hoverable;
};


org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.set__hoverable = function(value) {
  this.org_apache_royale_html_supportClasses_AccordionItemRenderer__hoverable = value;
};


org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.get__selected = function() {
  return this.org_apache_royale_html_supportClasses_AccordionItemRenderer__selected;
};


org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.set__selected = function(value) {
  this.org_apache_royale_html_supportClasses_AccordionItemRenderer__selected = value;
};


org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.get__index = function() {
  return this.org_apache_royale_html_supportClasses_AccordionItemRenderer__index;
};


org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.set__index = function(value) {
  this.org_apache_royale_html_supportClasses_AccordionItemRenderer__index = value;
  this.id = "item" + this.index;
};


org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.get__labelField = function() {
  return null;
};


org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.set__labelField = function(value) {
};


org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.get__hovered = function() {
  return this.org_apache_royale_html_supportClasses_AccordionItemRenderer__hovered;
};


org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.set__hovered = function(value) {
  this.org_apache_royale_html_supportClasses_AccordionItemRenderer__hovered = value;
};


org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.get__down = function() {
  return this.org_apache_royale_html_supportClasses_AccordionItemRenderer__down;
};


org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.set__down = function(value) {
  this.org_apache_royale_html_supportClasses_AccordionItemRenderer__down = value;
};


org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.get__data = function() {
  return this.numElements > 0 ? this.getElementAt(0) : null;
};


org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.set__data = function(value) {
  while (this.numElements > 0) {
    this.removeElement(this.getElementAt(0));
  }
  this.addElement(org.apache.royale.utils.Language.as(value, org.apache.royale.core.IChild));
  var /** @type {org.apache.royale.core.IStrand} */ dataAsStrand = org.apache.royale.utils.Language.as(value, org.apache.royale.core.IStrand);
  if (dataAsStrand) {
    var /** @type {org.apache.royale.core.ITitleBarModel} */ dataTitleModel = org.apache.royale.utils.Language.as(dataAsStrand.getBeadByType(org.apache.royale.core.ITitleBarModel), org.apache.royale.core.ITitleBarModel);
    if (dataTitleModel) {
      this.titleBar.title = dataTitleModel.title;
    }
  }
  this.dispatchEvent(new org.apache.royale.events.Event("dataChange"));
};


org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.set__height = function(value) {
  org.apache.royale.html.supportClasses.AccordionItemRenderer.superClass_.set__height.apply(this, [ value] );
};


org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.get__listData = function() {
  return null;
};


org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.set__listData = function(value) {
};


org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.get__itemRendererParent = function() {
  return null;
};


org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.set__itemRendererParent = function(value) {
};


org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.get__titleBar = function() {
  return org.apache.royale.utils.Language.as(org.apache.royale.utils.Language.as(this.getBeadByType(org.apache.royale.html.beads.PanelView), org.apache.royale.html.beads.PanelView).titleBar, org.apache.royale.html.TitleBar);
};


org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.get__collapsedHeight = function() {
  return this.titleBar ? this.titleBar.height : NaN;
};


org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.get__collapsedWidth = function() {
  return 0;
};


org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.get__collapsed = function() {
  return this.height == this.collapsedHeight;
};


Object.defineProperties(org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype, /** @lends {org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype} */ {
/**
  * @export
  * @type {boolean} */
selectable: {
get: org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.get__selectable,
set: org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.set__selectable},
/**
  * @export
  * @type {boolean} */
hoverable: {
get: org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.get__hoverable,
set: org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.set__hoverable},
/**
  * @export
  * @type {boolean} */
selected: {
get: org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.get__selected,
set: org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.set__selected},
/**
  * @export
  * @type {number} */
index: {
get: org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.get__index,
set: org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.set__index},
/**
  * @export
  * @type {string} */
labelField: {
get: org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.get__labelField,
set: org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.set__labelField},
/**
  * @export
  * @type {boolean} */
hovered: {
get: org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.get__hovered,
set: org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.set__hovered},
/**
  * @export
  * @type {boolean} */
down: {
get: org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.get__down,
set: org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.set__down},
/**
  * @export
  * @type {Object} */
data: {
get: org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.get__data,
set: org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.set__data},
/**
  * @export
  * @type {number} */
height: {
get: org.apache.royale.core.UIBase.prototype.get__height,
set: org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.set__height},
/**
  * @export
  * @type {Object} */
listData: {
get: org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.get__listData,
set: org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.set__listData},
/**
  * @export
  * @type {Object} */
itemRendererParent: {
get: org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.get__itemRendererParent,
set: org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.set__itemRendererParent},
/**
  * @export
  * @type {org.apache.royale.html.TitleBar} */
titleBar: {
get: org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.get__titleBar},
/**
  * @export
  * @type {number} */
collapsedHeight: {
get: org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.get__collapsedHeight},
/**
  * @export
  * @type {number} */
collapsedWidth: {
get: org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.get__collapsedWidth},
/**
  * @export
  * @type {boolean} */
collapsed: {
get: org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.get__collapsed}}
);


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



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.html.supportClasses.AccordionItemRenderer.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {return {};},
    accessors: function () {
      return {
        'selectable': { type: 'Boolean', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.AccordionItemRenderer'},
        'hoverable': { type: 'Boolean', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.AccordionItemRenderer'},
        'selected': { type: 'Boolean', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.AccordionItemRenderer'},
        'index': { type: 'int', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.AccordionItemRenderer'},
        'labelField': { type: 'String', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.AccordionItemRenderer'},
        'hovered': { type: 'Boolean', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.AccordionItemRenderer'},
        'down': { type: 'Boolean', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.AccordionItemRenderer'},
        'data': { type: 'Object', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.AccordionItemRenderer'},
        'height': { type: 'Number', access: 'writeonly', declaredBy: 'org.apache.royale.html.supportClasses.AccordionItemRenderer'},
        'listData': { type: 'Object', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.AccordionItemRenderer'},
        'itemRendererParent': { type: 'Object', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.AccordionItemRenderer'},
        'titleBar': { type: 'org.apache.royale.html.TitleBar', access: 'readonly', declaredBy: 'org.apache.royale.html.supportClasses.AccordionItemRenderer'},
        'collapsedHeight': { type: 'Number', access: 'readonly', declaredBy: 'org.apache.royale.html.supportClasses.AccordionItemRenderer'},
        'collapsedWidth': { type: 'Number', access: 'readonly', declaredBy: 'org.apache.royale.html.supportClasses.AccordionItemRenderer'},
        'collapsed': { type: 'Boolean', access: 'readonly', declaredBy: 'org.apache.royale.html.supportClasses.AccordionItemRenderer'}
      };
    },
    methods: function () {
      return {
        'AccordionItemRenderer': { type: '', declaredBy: 'org.apache.royale.html.supportClasses.AccordionItemRenderer'},
        'collapse': { type: 'void', declaredBy: 'org.apache.royale.html.supportClasses.AccordionItemRenderer'}
      };
    }
  };
};