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

goog.provide('org.apache.royale.jewel.List');

goog.require('org.apache.royale.core.DataContainerBase');
goog.require('org.apache.royale.core.IDataProviderModel');
goog.require('org.apache.royale.core.IListPresentationModel');
goog.require('org.apache.royale.core.IRollOverModel');
goog.require('org.apache.royale.core.ISelectionModel');
goog.require('org.apache.royale.events.Event');
goog.require('org.apache.royale.events.IEventDispatcher');
goog.require('org.apache.royale.jewel.beads.models.IJewelSelectionModel');
goog.require('org.apache.royale.jewel.beads.models.ListPresentationModel');
goog.require('org.apache.royale.utils.Language');



/**
 *  constructor.
 *
 *  @langversion 3.0
 *  @playerversion Flash 10.2
 *  @playerversion AIR 2.6
 *  @productversion Royale 0.9.4
 * @constructor
 * @extends {org.apache.royale.core.DataContainerBase}
 */
org.apache.royale.jewel.List = function() {
  org.apache.royale.jewel.List.base(this, 'constructor');
  this.typeNames = "jewel list";
  this.addEventListener('initComplete', org.apache.royale.utils.Language.closure(this.org_apache_royale_jewel_List_setupModelChangeListener, this, 'setupModelChangeListener'));
};
goog.inherits(org.apache.royale.jewel.List, org.apache.royale.core.DataContainerBase);


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


/**
 * @royaleignorecoercion org.apache.royale.events.IEventDispatcher
 * @royaleignorecoercion org.apache.royale.jewel.beads.models.IJewelSelectionModel
 * @private
 * @param {org.apache.royale.events.Event} event
 */
org.apache.royale.jewel.List.prototype.org_apache_royale_jewel_List_setupModelChangeListener = function(event) {
  this.removeEventListener('initComplete', org.apache.royale.utils.Language.closure(this.org_apache_royale_jewel_List_setupModelChangeListener, this, 'setupModelChangeListener'));
  this.model.addEventListener('change', org.apache.royale.utils.Language.closure(this.org_apache_royale_jewel_List_modelChangeDispatcher, this, 'modelChangeDispatcher'));
  this.model.dispatchChangeOnDataProviderChange = true;
};


/**
 * @private
 * @type {boolean}
 */
org.apache.royale.jewel.List.prototype.org_apache_royale_jewel_List_respondingToProgrammaticChange;


/**
 * @private
 * @param {org.apache.royale.events.Event} event
 */
org.apache.royale.jewel.List.prototype.org_apache_royale_jewel_List_modelChangeDispatcher = function(event) {
  this.org_apache_royale_jewel_List_respondingToProgrammaticChange = true;
  this.dispatchEvent(new org.apache.royale.events.Event("change"));
  this.org_apache_royale_jewel_List_respondingToProgrammaticChange = false;
};


org.apache.royale.jewel.List.prototype.get__labelField = function() {
  return this.model.labelField;
};


org.apache.royale.jewel.List.prototype.set__labelField = function(value) {
  this.model.labelField = value;
};


org.apache.royale.jewel.List.prototype.get__dataProvider = function() {
  return this.model.dataProvider;
};


org.apache.royale.jewel.List.prototype.set__dataProvider = function(value) {
  this.model.dataProvider = value;
};


org.apache.royale.jewel.List.prototype.get__selectedIndex = function() {
  return this.model.selectedIndex;
};


org.apache.royale.jewel.List.prototype.set__selectedIndex = function(value) {
  this.model.selectedIndex = value;
};


org.apache.royale.jewel.List.prototype.get__rollOverIndex = function() {
  return this.model.rollOverIndex;
};


org.apache.royale.jewel.List.prototype.set__rollOverIndex = function(value) {
  this.model.rollOverIndex = value;
};


org.apache.royale.jewel.List.prototype.get__rowHeight = function() {
  return org.apache.royale.utils.Language.as(this.presentationModel, org.apache.royale.core.IListPresentationModel).rowHeight;
};


org.apache.royale.jewel.List.prototype.set__rowHeight = function(value) {
  org.apache.royale.utils.Language.as(this.presentationModel, org.apache.royale.core.IListPresentationModel).rowHeight = value;
};


org.apache.royale.jewel.List.prototype.get__selectedItem = function() {
  return this.model.selectedItem;
};


org.apache.royale.jewel.List.prototype.set__selectedItem = function(value) {
  this.model.selectedItem = value;
};


org.apache.royale.jewel.List.prototype.get__presentationModel = function() {
  var /** @type {org.apache.royale.core.IListPresentationModel} */ presModel = this.getBeadByType(org.apache.royale.core.IListPresentationModel);
  if (presModel == null) {
    presModel = new org.apache.royale.jewel.beads.models.ListPresentationModel();
    this.addBead(presModel);
  }
  return presModel;
};


Object.defineProperties(org.apache.royale.jewel.List.prototype, /** @lends {org.apache.royale.jewel.List.prototype} */ {
/**
  * @export
  * @type {string} */
labelField: {
get: org.apache.royale.jewel.List.prototype.get__labelField,
set: org.apache.royale.jewel.List.prototype.set__labelField},
/**
  * @export
  * @type {Object} */
dataProvider: {
get: org.apache.royale.jewel.List.prototype.get__dataProvider,
set: org.apache.royale.jewel.List.prototype.set__dataProvider},
/**
  * @export
  * @type {number} */
selectedIndex: {
get: org.apache.royale.jewel.List.prototype.get__selectedIndex,
set: org.apache.royale.jewel.List.prototype.set__selectedIndex},
/**
  * @export
  * @type {number} */
rollOverIndex: {
get: org.apache.royale.jewel.List.prototype.get__rollOverIndex,
set: org.apache.royale.jewel.List.prototype.set__rollOverIndex},
/**
  * @export
  * @type {number} */
rowHeight: {
get: org.apache.royale.jewel.List.prototype.get__rowHeight,
set: org.apache.royale.jewel.List.prototype.set__rowHeight},
/**
  * @export
  * @type {Object} */
selectedItem: {
get: org.apache.royale.jewel.List.prototype.get__selectedItem,
set: org.apache.royale.jewel.List.prototype.set__selectedItem},
/**
  * @export
  * @type {org.apache.royale.core.IListPresentationModel} */
presentationModel: {
get: org.apache.royale.jewel.List.prototype.get__presentationModel}}
);


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



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.jewel.List.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {return {};},
    accessors: function () {
      return {
        'labelField': { type: 'String', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.List'},
        'dataProvider': { type: 'Object', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.List'},
        'selectedIndex': { type: 'int', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.List', metadata: function () { return [ { name: 'Bindable', args: [ { key: '', value: 'change' } ] } ]; }},
        'rollOverIndex': { type: 'int', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.List'},
        'rowHeight': { type: 'Number', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.List'},
        'selectedItem': { type: 'Object', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.List', metadata: function () { return [ { name: 'Bindable', args: [ { key: '', value: 'change' } ] } ]; }},
        'presentationModel': { type: 'org.apache.royale.core.IListPresentationModel', access: 'readonly', declaredBy: 'org.apache.royale.jewel.List'}
      };
    },
    methods: function () {
      return {
        'List': { type: '', declaredBy: 'org.apache.royale.jewel.List'}
      };
    },
    metadata: function () { return [  ]; }
  };
};