/**
 * Generated by Apache Royale Compiler from org\apache\royale\jewel\beads\views\TitleBarView.mxml
 * org.apache.royale.jewel.beads.views.TitleBarView
 *
 * @fileoverview
 *
 * @suppress {checkTypes|accessControls}
 */

goog.provide('org.apache.royale.jewel.beads.views.TitleBarView');
/* Royale Static Dependency List: org.apache.royale.jewel.beads.views.TitleBarView*/

goog.require('org.apache.royale.html.MXMLBeadView');
goog.require('org.apache.royale.binding.MXMLBeadViewDataBinding');
goog.require('org.apache.royale.html.beads.layouts.LayoutChangeNotifier');
goog.require('org.apache.royale.jewel.Label');
goog.require('org.apache.royale.jewel.Button');
goog.require('org.apache.royale.core.ITitleBarModel');
goog.require('org.apache.royale.core.UIBase');
goog.require('org.apache.royale.events.Event');
goog.require('org.apache.royale.events.MouseEvent');



/**
 * @constructor
 * @extends {org.apache.royale.html.MXMLBeadView}
 */
org.apache.royale.jewel.beads.views.TitleBarView = function() {
  org.apache.royale.jewel.beads.views.TitleBarView.base(this, 'constructor');
  
  /**
   * @private
   * @type {org.apache.royale.binding.MXMLBeadViewDataBinding}
   */
  this.$ID0_;
  
  /**
   * @private
   * @type {org.apache.royale.html.beads.layouts.LayoutChangeNotifier}
   */
  this.$ID1_;
  
  /**
   * @private
   * @type {org.apache.royale.jewel.Label}
   */
  this.titleLabel_;
  
  /**
   * @private
   * @type {org.apache.royale.jewel.Button}
   */
  this.closeButton_;
  
  /**
   * @private
   * @type {Array}
   */
  this.mxmldd;
  
  /**
   * @private
   * @type {Array}
   */
  this.mxmldp;

  this.generateMXMLAttributes
  ([1,
'beads',
null, [org.apache.royale.binding.MXMLBeadViewDataBinding, 1, '_id', true, '$ID0', 0, 0, null, org.apache.royale.html.beads.layouts.LayoutChangeNotifier, 1, '_id', true, '$ID1', 0, 0, null],
0,
0
  ]);
  
};
goog.inherits(org.apache.royale.jewel.beads.views.TitleBarView, org.apache.royale.html.MXMLBeadView);


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



/**
 * @private
 */
org.apache.royale.jewel.beads.views.TitleBarView.prototype.org_apache_royale_jewel_beads_views_TitleBarView_clickHandler = function() {
  var /** @type {org.apache.royale.events.Event} */ newEvent = new org.apache.royale.events.Event('close');
  org.apache.royale.utils.Language.as(this._strand, org.apache.royale.core.UIBase, true).dispatchEvent(newEvent);
};


/**
 * @export
 * @param {org.apache.royale.events.MouseEvent} event
 */
org.apache.royale.jewel.beads.views.TitleBarView.prototype.$EH0 = function(event)
{
  this.org_apache_royale_jewel_beads_views_TitleBarView_clickHandler();
};


Object.defineProperties(org.apache.royale.jewel.beads.views.TitleBarView.prototype, /** @lends {org.apache.royale.jewel.beads.views.TitleBarView.prototype} */ {
/** @export */
    titleLabel: {
    /** @this {org.apache.royale.jewel.beads.views.TitleBarView} */
    get: function() {
      return this.titleLabel_;
    },
    /** @this {org.apache.royale.jewel.beads.views.TitleBarView} */
    set: function(value) {
      if (value != this.titleLabel_) {
        this.titleLabel_ = value;
        this.dispatchEvent(org.apache.royale.events.ValueChangeEvent.createUpdateEvent(this, 'titleLabel', null, value));
      }
    }
  },
  /** @export */
    closeButton: {
    /** @this {org.apache.royale.jewel.beads.views.TitleBarView} */
    get: function() {
      return this.closeButton_;
    },
    /** @this {org.apache.royale.jewel.beads.views.TitleBarView} */
    set: function(value) {
      if (value != this.closeButton_) {
        this.closeButton_ = value;
        this.dispatchEvent(org.apache.royale.events.ValueChangeEvent.createUpdateEvent(this, 'closeButton', null, value));
      }
    }
  },
  'MXMLDescriptor': {
    /** @this {org.apache.royale.jewel.beads.views.TitleBarView} */
    get: function() {
      {
        if (this.mxmldd == undefined)
        {
          /** @type {Array} */
          var arr = org.apache.royale.jewel.beads.views.TitleBarView.superClass_.get__MXMLDescriptor.apply(this);
          /** @type {Array} */
          var data = [
      org.apache.royale.jewel.Label,
1,
'_id',
true,
'titleLabel',
0,
0,
null,
org.apache.royale.jewel.Button,
2,
'_id',
true,
'closeButton',
'className',
true,
'closebutton',
0,
1,
'click',
this.$EH0,
null
      ];
        
          if (arr)
            this.mxmldd = arr.concat(data);
          else
            this.mxmldd = data;
        }
        return this.mxmldd;
      }
      }
    }
  });
  /**
   * @export
   */
  org.apache.royale.jewel.beads.views.TitleBarView.prototype._bindings = [
  2,
  ["titleLabel", "text"],
  null,
  ["$ID1", "watchedProperty"],
  function() { return org.apache.royale.utils.Language.as(this.model, org.apache.royale.core.ITitleBarModel, true).title; },
  null,
  ["titleLabel", "text"],
  0,
  2,
  "titleLabel",
  "valueChange",
  0,
  null,
  [
  1,
  2,
  "text",
  "textChange",
  0,
  null,
  null,
  null],
  2,
  2,
  "model",
  "__NoChangeEvent__",
  1,
  null,
  [
  3,
  2,
  "title",
  "titleChange",
  1,
  null,
  null,
  null]];
  /**
   * Metadata
   *
   * @type {Object.<string, Array.<Object>>}
   */
  org.apache.royale.jewel.beads.views.TitleBarView.prototype.ROYALE_CLASS_INFO = { names: [{ name: 'TitleBarView', qName: 'org.apache.royale.jewel.beads.views.TitleBarView', kind: 'class'  }] };



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

  
  