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

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

goog.require('org.apache.royale.collections.ArrayList');
goog.require('org.apache.royale.core.ISelectionModel');
goog.require('org.apache.royale.events.Event');
goog.require('org.apache.royale.html.supportClasses.DataProviderNotifierBase');
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.supportClasses.DataProviderNotifierBase}
 */
org.apache.royale.html.beads.DataProviderCollectionChangeNotifier = function() {
  org.apache.royale.html.beads.DataProviderCollectionChangeNotifier.base(this, 'constructor');
};
goog.inherits(org.apache.royale.html.beads.DataProviderCollectionChangeNotifier, org.apache.royale.html.supportClasses.DataProviderNotifierBase);


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


/**
 * @protected
 * @override
 */
org.apache.royale.html.beads.DataProviderCollectionChangeNotifier.prototype.destinationChangedHandler = function(event) {
  var /** @type {Object} */ object = this.document[this.sourceID];
  if (this.dataProvider) {
    if (object[this.propertyName] == this.dataProvider)
      return;
    this.dataProvider.removeEventListener(this.changeEventName == null ? "collectionChanged" : this.changeEventName, org.apache.royale.utils.Language.closure(this.org_apache_royale_html_beads_DataProviderCollectionChangeNotifier_handleCollectionChanged, this, 'handleCollectionChanged'));
  }
  this.dataProvider = org.apache.royale.utils.Language.as(object[this.propertyName], org.apache.royale.collections.ArrayList);
  this.dataProvider.addEventListener(this.changeEventName == null ? "collectionChanged" : this.changeEventName, org.apache.royale.utils.Language.closure(this.org_apache_royale_html_beads_DataProviderCollectionChangeNotifier_handleCollectionChanged, this, 'handleCollectionChanged'));
};


/**
 * @private
 * @param {org.apache.royale.events.Event} event
 */
org.apache.royale.html.beads.DataProviderCollectionChangeNotifier.prototype.org_apache_royale_html_beads_DataProviderCollectionChangeNotifier_handleCollectionChanged = function(event) {
  var /** @type {org.apache.royale.core.ISelectionModel} */ selectionModel = org.apache.royale.utils.Language.as(this._strand.getBeadByType(org.apache.royale.core.ISelectionModel), org.apache.royale.core.ISelectionModel);
  selectionModel.dispatchEvent(new org.apache.royale.events.Event("dataProviderChanged"));
};


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



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