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

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

goog.require('org.apache.royale.core.IChild');
goog.require('org.apache.royale.core.IPanelModel');
goog.require('org.apache.royale.core.IStrand');
goog.require('org.apache.royale.core.IUIBase');
goog.require('org.apache.royale.core.UIBase');
goog.require('org.apache.royale.events.Event');
goog.require('org.apache.royale.html.ControlBar');
goog.require('org.apache.royale.html.Panel');
goog.require('org.apache.royale.html.beads.PanelView');
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.beads.PanelView}
 */
org.apache.royale.html.beads.PanelWithControlBarView = function() {
  org.apache.royale.html.beads.PanelWithControlBarView.base(this, 'constructor');
};
goog.inherits(org.apache.royale.html.beads.PanelWithControlBarView, org.apache.royale.html.beads.PanelView);


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


/**
 * @private
 * @type {org.apache.royale.html.ControlBar}
 */
org.apache.royale.html.beads.PanelWithControlBarView.prototype.org_apache_royale_html_beads_PanelWithControlBarView__controlBar;


/**
 * @protected
 * @override
 */
org.apache.royale.html.beads.PanelWithControlBarView.prototype.completeSetup = function() {
  if (this.titleBar.parent == null) {
    org.apache.royale.utils.Language.as(this._strand, org.apache.royale.html.Panel).$addElement(this.titleBar);
  }
  if (this.contentArea.parent == null) {
    org.apache.royale.utils.Language.as(this._strand, org.apache.royale.html.Panel).$addElement(org.apache.royale.utils.Language.as(this.contentArea, org.apache.royale.core.IChild));
  }
  if (this.controlBar.parent == null) {
    org.apache.royale.utils.Language.as(this._strand, org.apache.royale.html.Panel).$addElement(this.controlBar);
  }
  var /** @type {org.apache.royale.core.UIBase} */ host = org.apache.royale.utils.Language.as(this._strand, org.apache.royale.core.UIBase, true);
  var /** @type {Array} */ controlBarItems = org.apache.royale.utils.Language.as(host.model, org.apache.royale.core.IPanelModel).controlBar;
  if (controlBarItems && controlBarItems.length > 0) {
    var foreachiter0_target = controlBarItems;
    for (var foreachiter0 in foreachiter0_target) 
    {
    var comp = foreachiter0_target[foreachiter0];
    {
      this.controlBar.addElement(comp, false);
    }}
    
    this.controlBar.childrenAdded();
  }
  org.apache.royale.html.beads.PanelWithControlBarView.superClass_.completeSetup.apply(this);
  this.performLayout(null);
};


/**
 * @protected
 * @override
 */
org.apache.royale.html.beads.PanelWithControlBarView.prototype.handleSizeChange = function(event) {
  this.titleBar.percentWidth = 100;
  this.contentArea.percentWidth = 100;
  this.controlBar.percentWidth = 100;
  this.performLayout(event);
};


org.apache.royale.html.beads.PanelWithControlBarView.prototype.get__controlBar = function() {
  return this.org_apache_royale_html_beads_PanelWithControlBarView__controlBar;
};


org.apache.royale.html.beads.PanelWithControlBarView.prototype.set__strand = function(value) {
  org.apache.royale.html.beads.PanelWithControlBarView.superClass_.set__strand.apply(this, [ value] );
  var /** @type {org.apache.royale.core.UIBase} */ host = org.apache.royale.utils.Language.as(this._strand, org.apache.royale.core.UIBase, true);
  this.org_apache_royale_html_beads_PanelWithControlBarView__controlBar = new org.apache.royale.html.ControlBar();
  this.org_apache_royale_html_beads_PanelWithControlBarView__controlBar.id = "panelControlBar";
  
  this.org_apache_royale_html_beads_PanelWithControlBarView__controlBar.element.style["flex-grow"] = "0";
  this.org_apache_royale_html_beads_PanelWithControlBarView__controlBar.element.style["order"] = "3";
};


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


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



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.html.beads.PanelWithControlBarView.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {return {};},
    accessors: function () {
      return {
        'controlBar': { type: 'org.apache.royale.html.ControlBar', access: 'readonly', declaredBy: 'org.apache.royale.html.beads.PanelWithControlBarView'},
        'strand': { type: 'org.apache.royale.core.IStrand', access: 'writeonly', declaredBy: 'org.apache.royale.html.beads.PanelWithControlBarView'}
      };
    },
    methods: function () {
      return {
        'PanelWithControlBarView': { type: '', declaredBy: 'org.apache.royale.html.beads.PanelWithControlBarView'}
      };
    }
  };
};