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

goog.provide('org.apache.royale.jewel.beads.models.TableArrayListSelectionModel');

goog.require('org.apache.royale.collections.IArrayList');
goog.require('org.apache.royale.core.IStrand');
goog.require('org.apache.royale.events.Event');
goog.require('org.apache.royale.events.EventDispatcher');
goog.require('org.apache.royale.core.IRollOverModel');
goog.require('org.apache.royale.core.ISelectionModel');
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.events.EventDispatcher}
 * @implements {org.apache.royale.core.ISelectionModel}
 * @implements {org.apache.royale.core.IRollOverModel}
 */
org.apache.royale.jewel.beads.models.TableArrayListSelectionModel = function() {
  org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.base(this, 'constructor');
};
goog.inherits(org.apache.royale.jewel.beads.models.TableArrayListSelectionModel, org.apache.royale.events.EventDispatcher);


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


/**
 * @private
 * @type {org.apache.royale.core.IStrand}
 */
org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__strand;


/**
 * @private
 * @type {org.apache.royale.collections.IArrayList}
 */
org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__dataProvider;


/**
 * @private
 * @type {number}
 */
org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__selectedIndex = -1;


/**
 * @private
 * @type {number}
 */
org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__rollOverIndex = -1;


/**
 * @private
 * @type {string}
 */
org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__labelField = null;


/**
 * @private
 * @type {Object}
 */
org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__selectedItem;


/**
 * @private
 * @type {string}
 */
org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__selectedString;


org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.set__strand = function(value) {
  this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__strand = value;
};


org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.get__dataProvider = function() {
  return this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__dataProvider;
};


org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.set__dataProvider = function(value) {
  if (value == this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__dataProvider)
    return;
  this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__dataProvider = org.apache.royale.utils.Language.as(value, org.apache.royale.collections.IArrayList);
  if (!this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__dataProvider || this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__selectedIndex >= this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__dataProvider.length)
    this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__selectedIndex = -1;
  this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__selectedItem = this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__selectedIndex == -1 ? null : this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__dataProvider.getItemAt(this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__selectedIndex);
  this.dispatchEvent(new org.apache.royale.events.Event("dataProviderChanged"));
};


org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.get__labelField = function() {
  return this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__labelField;
};


org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.set__labelField = function(value) {
  if (value != this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__labelField) {
    this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__labelField = value;
    this.dispatchEvent(new org.apache.royale.events.Event("labelFieldChanged"));
  }
};


org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.get__selectedIndex = function() {
  return this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__selectedIndex;
};


org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.set__selectedIndex = function(value) {
  if (value == this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__selectedIndex)
    return;
  this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__selectedIndex = value;
  this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__selectedItem = (value == -1 || this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__dataProvider == null) ? null : (value < this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__dataProvider.length) ? this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__dataProvider.getItemAt(value) : null;
  this.dispatchEvent(new org.apache.royale.events.Event("selectedIndexChanged"));
};


org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.get__rollOverIndex = function() {
  return this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__rollOverIndex;
};


org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.set__rollOverIndex = function(value) {
  if (value != this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__rollOverIndex) {
    this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__rollOverIndex = value;
    this.dispatchEvent(new org.apache.royale.events.Event("rollOverIndexChanged"));
  }
};


org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.get__selectedItem = function() {
  return this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__selectedItem;
};


org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.set__selectedItem = function(value) {
  if (value == this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__selectedItem)
    return;
  this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__selectedItem = value;
  var /** @type {number} */ n = this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__dataProvider.length;
  for (var /** @type {number} */ i = 0; i < n; i++) {
    if (this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__dataProvider.getItemAt(i) == value) {
      this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__selectedIndex = i;
      break;
    }
  }
  this.dispatchEvent(new org.apache.royale.events.Event("selectedItemChanged"));
  this.dispatchEvent(new org.apache.royale.events.Event("selectedIndexChanged"));
};


org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.get__selectedString = function() {
  return String(this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__selectedItem);
};


org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.set__selectedString = function(value) {
  this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__selectedString = value;
  var /** @type {number} */ n = this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__dataProvider.length;
  for (var /** @type {number} */ i = 0; i < n; i++) {
    if (String(this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__dataProvider.getItemAt(i)) == value) {
      this.org_apache_royale_jewel_beads_models_TableArrayListSelectionModel__selectedIndex = i;
      break;
    }
  }
  this.dispatchEvent(new org.apache.royale.events.Event("selectedItemChanged"));
  this.dispatchEvent(new org.apache.royale.events.Event("selectedIndexChanged"));
};


Object.defineProperties(org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype, /** @lends {org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype} */ {
/**
  * @export
  * @type {org.apache.royale.core.IStrand} */
strand: {
set: org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.set__strand},
/**
  * @export
  * @type {Object} */
dataProvider: {
get: org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.get__dataProvider,
set: org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.set__dataProvider},
/**
  * @export
  * @type {string} */
labelField: {
get: org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.get__labelField,
set: org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.set__labelField},
/**
  * @export
  * @type {number} */
selectedIndex: {
get: org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.get__selectedIndex,
set: org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.set__selectedIndex},
/**
  * @export
  * @type {number} */
rollOverIndex: {
get: org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.get__rollOverIndex,
set: org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.set__rollOverIndex},
/**
  * @export
  * @type {Object} */
selectedItem: {
get: org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.get__selectedItem,
set: org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.set__selectedItem},
/**
  * @export
  * @type {string} */
selectedString: {
get: org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.get__selectedString,
set: org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.set__selectedString}}
);


/**
 * Metadata
 *
 * @type {Object.<string, Array.<Object>>}
 */
org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.prototype.ROYALE_CLASS_INFO = { names: [{ name: 'TableArrayListSelectionModel', qName: 'org.apache.royale.jewel.beads.models.TableArrayListSelectionModel', kind: 'class' }], interfaces: [org.apache.royale.core.ISelectionModel, org.apache.royale.core.IRollOverModel] };



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.jewel.beads.models.TableArrayListSelectionModel.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.jewel.beads.models.TableArrayListSelectionModel'},
        'dataProvider': { type: 'Object', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.beads.models.TableArrayListSelectionModel', metadata: function () { return [ { name: 'Bindable', args: [ { key: '', value: 'dataProviderChanged' } ] } ]; }},
        'labelField': { type: 'String', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.beads.models.TableArrayListSelectionModel'},
        'selectedIndex': { type: 'int', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.beads.models.TableArrayListSelectionModel'},
        'rollOverIndex': { type: 'int', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.beads.models.TableArrayListSelectionModel'},
        'selectedItem': { type: 'Object', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.beads.models.TableArrayListSelectionModel'},
        'selectedString': { type: 'String', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.beads.models.TableArrayListSelectionModel'}
      };
    },
    methods: function () {
      return {
        'TableArrayListSelectionModel': { type: '', declaredBy: 'org.apache.royale.jewel.beads.models.TableArrayListSelectionModel'}
      };
    }
  };
};