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

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

goog.require('org.apache.royale.core.IBeadModel');
goog.require('org.apache.royale.core.IDataGridModel');
goog.require('org.apache.royale.core.ISelectionModel');
goog.require('org.apache.royale.core.IStrand');
goog.require('org.apache.royale.events.Event');
goog.require('org.apache.royale.events.IEventDispatcher');
goog.require('org.apache.royale.html.beads.IDataGridView');
goog.require('org.apache.royale.html.supportClasses.DataGridColumnList');
goog.require('org.apache.royale.core.IChangePropagator');
goog.require('org.apache.royale.utils.Language');



/**
 * @constructor
 * @implements {org.apache.royale.core.IChangePropagator}
 */
org.apache.royale.html.beads.DataGridColumnForceChangePropagator = function() {
};


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


/**
 * @private
 * @type {org.apache.royale.core.IStrand}
 */
org.apache.royale.html.beads.DataGridColumnForceChangePropagator.prototype.org_apache_royale_html_beads_DataGridColumnForceChangePropagator__strand;


/**
 * @protected
 * @param {org.apache.royale.events.Event} e
 */
org.apache.royale.html.beads.DataGridColumnForceChangePropagator.prototype.handleDataProviderChanged = function(e) {
  var /** @type {org.apache.royale.html.beads.IDataGridView} */ dataGridView = org.apache.royale.utils.Language.as(this.org_apache_royale_html_beads_DataGridColumnForceChangePropagator__strand.getBeadByType(org.apache.royale.html.beads.IDataGridView), org.apache.royale.html.beads.IDataGridView);
  var /** @type {Array} */ lists = dataGridView.columnLists;
  var /** @type {org.apache.royale.core.IDataGridModel} */ sharedModel = org.apache.royale.utils.Language.as(this.org_apache_royale_html_beads_DataGridColumnForceChangePropagator__strand.getBeadByType(org.apache.royale.core.IBeadModel), org.apache.royale.core.IDataGridModel);
  for (var /** @type {number} */ i = 0; i < lists.length; i++) {
    var /** @type {org.apache.royale.html.supportClasses.DataGridColumnList} */ list = org.apache.royale.utils.Language.as(lists[i], org.apache.royale.html.supportClasses.DataGridColumnList);
    var /** @type {org.apache.royale.core.ISelectionModel} */ listModel = org.apache.royale.utils.Language.as(list.getBeadByType(org.apache.royale.core.IBeadModel), org.apache.royale.core.ISelectionModel);
    if (listModel.dataProvider != sharedModel.dataProvider) {
      listModel.dataProvider = sharedModel.dataProvider;
    } else {
      org.apache.royale.utils.Language.as(listModel, org.apache.royale.events.IEventDispatcher).dispatchEvent(new org.apache.royale.events.Event('dataProviderChanged'));
    }
  }
};


org.apache.royale.html.beads.DataGridColumnForceChangePropagator.prototype.set__strand = function(value) {
  this.org_apache_royale_html_beads_DataGridColumnForceChangePropagator__strand = value;
  var /** @type {org.apache.royale.events.IEventDispatcher} */ model = org.apache.royale.utils.Language.as(value.getBeadByType(org.apache.royale.core.IBeadModel), org.apache.royale.events.IEventDispatcher);
  model.addEventListener('dataProviderChanged', org.apache.royale.utils.Language.closure(this.handleDataProviderChanged, this, 'handleDataProviderChanged'));
};


Object.defineProperties(org.apache.royale.html.beads.DataGridColumnForceChangePropagator.prototype, /** @lends {org.apache.royale.html.beads.DataGridColumnForceChangePropagator.prototype} */ {
/**
  * @export
  * @type {org.apache.royale.core.IStrand} */
strand: {
set: org.apache.royale.html.beads.DataGridColumnForceChangePropagator.prototype.set__strand}}
);


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



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.html.beads.DataGridColumnForceChangePropagator.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.html.beads.DataGridColumnForceChangePropagator'}
      };
    },
    methods: function () {
      return {
        'DataGridColumnForceChangePropagator': { type: '', declaredBy: 'org.apache.royale.html.beads.DataGridColumnForceChangePropagator'}
      };
    }
  };
};