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

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

goog.require('org.apache.royale.core.HTMLElementWrapper');
goog.require('org.apache.royale.core.IStrand');
goog.require('org.apache.royale.core.IUIBase');
goog.require('org.apache.royale.events.Event');
goog.require('org.apache.royale.events.IEventDispatcher');
goog.require('org.apache.royale.events.ValueEvent');
goog.require('org.apache.royale.core.IBead');
goog.require('org.apache.royale.utils.Language');



/**
 *  constructor.
 *
 *  @langversion 3.0
 *  @playerversion Flash 10.2
 *  @playerversion AIR 2.6
 *  @productversion Royale 0.9
 * @constructor
 * @implements {org.apache.royale.core.IBead}
 */
org.apache.royale.html.beads.DisableChildrenBead = function() {
};


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


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


/**
 * @private
 * @type {boolean}
 */
org.apache.royale.html.beads.DisableChildrenBead.prototype.org_apache_royale_html_beads_DisableChildrenBead__disabled;


/**
 * @private
 * @param {org.apache.royale.events.Event} e
 */
org.apache.royale.html.beads.DisableChildrenBead.prototype.org_apache_royale_html_beads_DisableChildrenBead_childrenAddedHandler = function(e) {
  this.org_apache_royale_html_beads_DisableChildrenBead_updateHost();
};


/**
 * @private
 * @type {string}
 */
org.apache.royale.html.beads.DisableChildrenBead.prototype.org_apache_royale_html_beads_DisableChildrenBead__lastTabVal;


/**
 * @royaleignorecoercion org.apache.royale.core.HTMLElementWrapper
 * @private
 */
org.apache.royale.html.beads.DisableChildrenBead.prototype.org_apache_royale_html_beads_DisableChildrenBead_updateHost = function() {
  if (!this.org_apache_royale_html_beads_DisableChildrenBead__strand)
    return;
  
  this.org_apache_royale_html_beads_DisableChildrenBead_setDecendants(this.org_apache_royale_html_beads_DisableChildrenBead__strand.element);
};


/**
 * @private
 * @param {HTMLElement} elem
 */
org.apache.royale.html.beads.DisableChildrenBead.prototype.org_apache_royale_html_beads_DisableChildrenBead_setDecendants = function(elem) {
  elem.style["pointerEvents"] = this.org_apache_royale_html_beads_DisableChildrenBead__disabled ? "none" : "";
  this.org_apache_royale_html_beads_DisableChildrenBead__disabled ? elem.setAttribute("tabindex", "-1") : elem.removeAttribute("tabindex");
  elem = org.apache.royale.utils.Language.as(elem.firstChild, HTMLElement);
  while (elem) {
    this.org_apache_royale_html_beads_DisableChildrenBead_setDecendants(elem);
    elem = org.apache.royale.utils.Language.as(elem.nextSibling, HTMLElement);
  }
};


/**
 * @private
 */
org.apache.royale.html.beads.DisableChildrenBead.prototype.org_apache_royale_html_beads_DisableChildrenBead_throwChangeEvent = function() {
  if (this.org_apache_royale_html_beads_DisableChildrenBead__strand) {
    org.apache.royale.utils.Language.as(this.org_apache_royale_html_beads_DisableChildrenBead__strand, org.apache.royale.events.IEventDispatcher, true).dispatchEvent(new org.apache.royale.events.ValueEvent("disabledChange", this.disabled));
  }
};


org.apache.royale.html.beads.DisableChildrenBead.prototype.set__strand = function(value) {
  this.org_apache_royale_html_beads_DisableChildrenBead__strand = value;
  this.org_apache_royale_html_beads_DisableChildrenBead_host.addEventListener("childrenAdded", org.apache.royale.utils.Language.closure(this.org_apache_royale_html_beads_DisableChildrenBead_childrenAddedHandler, this, 'childrenAddedHandler'));
};


org.apache.royale.html.beads.DisableChildrenBead.prototype.get__disabled = function() {
  return this.org_apache_royale_html_beads_DisableChildrenBead__disabled;
};


org.apache.royale.html.beads.DisableChildrenBead.prototype.set__disabled = function(value) {
  if (value != this.org_apache_royale_html_beads_DisableChildrenBead__disabled) {
    this.org_apache_royale_html_beads_DisableChildrenBead__disabled = value;
    this.org_apache_royale_html_beads_DisableChildrenBead_updateHost();
    this.org_apache_royale_html_beads_DisableChildrenBead_throwChangeEvent();
  }
};


org.apache.royale.html.beads.DisableChildrenBead.prototype.get__org_apache_royale_html_beads_DisableChildrenBead_host = function() {
  return org.apache.royale.utils.Language.as(this.org_apache_royale_html_beads_DisableChildrenBead__strand, org.apache.royale.core.IUIBase);
};


Object.defineProperties(org.apache.royale.html.beads.DisableChildrenBead.prototype, /** @lends {org.apache.royale.html.beads.DisableChildrenBead.prototype} */ {
/**
  * @export
  * @type {org.apache.royale.core.IStrand} */
strand: {
set: org.apache.royale.html.beads.DisableChildrenBead.prototype.set__strand},
/**
  * @export
  * @type {boolean} */
disabled: {
get: org.apache.royale.html.beads.DisableChildrenBead.prototype.get__disabled,
set: org.apache.royale.html.beads.DisableChildrenBead.prototype.set__disabled},
/**
  * @export
  * @type {org.apache.royale.core.IUIBase} */
org_apache_royale_html_beads_DisableChildrenBead_host: {
get: org.apache.royale.html.beads.DisableChildrenBead.prototype.get__org_apache_royale_html_beads_DisableChildrenBead_host}}
);


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



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