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

goog.provide('org.apache.royale.html.supportClasses.MenuBarItemRenderer');

goog.require('org.apache.royale.html.Label');
goog.require('org.apache.royale.html.supportClasses.DataItemRenderer');
goog.require('org.apache.royale.html.util.getLabelFromData');
goog.require('org.apache.royale.html.beads.ITextItemRenderer');



/**
 * @constructor
 * @extends {org.apache.royale.html.supportClasses.DataItemRenderer}
 * @implements {org.apache.royale.html.beads.ITextItemRenderer}
 */
org.apache.royale.html.supportClasses.MenuBarItemRenderer = function() {
  org.apache.royale.html.supportClasses.MenuBarItemRenderer.base(this, 'constructor');
  this.typeNames = "MenuBarItemRenderer";
  this.org_apache_royale_html_supportClasses_MenuBarItemRenderer_label = new org.apache.royale.html.Label();
};
goog.inherits(org.apache.royale.html.supportClasses.MenuBarItemRenderer, org.apache.royale.html.supportClasses.DataItemRenderer);


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


/**
 * @private
 * @type {org.apache.royale.html.Label}
 */
org.apache.royale.html.supportClasses.MenuBarItemRenderer.prototype.org_apache_royale_html_supportClasses_MenuBarItemRenderer_label;


/**
 * @export
 * @override
 */
org.apache.royale.html.supportClasses.MenuBarItemRenderer.prototype.addedToParent = function() {
  org.apache.royale.html.supportClasses.MenuBarItemRenderer.superClass_.addedToParent.apply(this);
  this.addElement(this.org_apache_royale_html_supportClasses_MenuBarItemRenderer_label);
  this.org_apache_royale_html_supportClasses_MenuBarItemRenderer_label.setParentEventTarget(this);
};


/**
 * @asprivate
 * @export
 * @override
 */
org.apache.royale.html.supportClasses.MenuBarItemRenderer.prototype.adjustSize = function() {
  var /** @type {number} */ cy = this.height / 2;
  this.org_apache_royale_html_supportClasses_MenuBarItemRenderer_label.x = 0;
  this.org_apache_royale_html_supportClasses_MenuBarItemRenderer_label.y = cy - this.org_apache_royale_html_supportClasses_MenuBarItemRenderer_label.height / 2;
  this.org_apache_royale_html_supportClasses_MenuBarItemRenderer_label.width = this.width;
  var /** @type {number} */ h = this.height;
  var /** @type {number} */ w = this.width;
  this.updateRenderer();
};


org.apache.royale.html.supportClasses.MenuBarItemRenderer.prototype.set__data = function(value) {
  org.apache.royale.html.supportClasses.MenuBarItemRenderer.superClass_.set__data.apply(this, [ value] );
  this.org_apache_royale_html_supportClasses_MenuBarItemRenderer_label.text = org.apache.royale.html.util.getLabelFromData(this, value);
  this.adjustSize();
};


org.apache.royale.html.supportClasses.MenuBarItemRenderer.prototype.get__text = function() {
  return this.org_apache_royale_html_supportClasses_MenuBarItemRenderer_label.text;
};


org.apache.royale.html.supportClasses.MenuBarItemRenderer.prototype.set__text = function(value) {
  this.org_apache_royale_html_supportClasses_MenuBarItemRenderer_label.text = this.text;
};


Object.defineProperties(org.apache.royale.html.supportClasses.MenuBarItemRenderer.prototype, /** @lends {org.apache.royale.html.supportClasses.MenuBarItemRenderer.prototype} */ {
/**
  * @export
  * @type {Object} */
data: {
get: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__data,
set: org.apache.royale.html.supportClasses.MenuBarItemRenderer.prototype.set__data},
/**
  * @export
  * @type {string} */
text: {
get: org.apache.royale.html.supportClasses.MenuBarItemRenderer.prototype.get__text,
set: org.apache.royale.html.supportClasses.MenuBarItemRenderer.prototype.set__text}}
);


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



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.html.supportClasses.MenuBarItemRenderer.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {return {};},
    accessors: function () {
      return {
        'data': { type: 'Object', access: 'writeonly', declaredBy: 'org.apache.royale.html.supportClasses.MenuBarItemRenderer'},
        'text': { type: 'String', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.MenuBarItemRenderer'}
      };
    },
    methods: function () {
      return {
        'MenuBarItemRenderer': { type: '', declaredBy: 'org.apache.royale.html.supportClasses.MenuBarItemRenderer'},
        'addedToParent': { type: 'void', declaredBy: 'org.apache.royale.html.supportClasses.MenuBarItemRenderer'},
        'adjustSize': { type: 'void', declaredBy: 'org.apache.royale.html.supportClasses.MenuBarItemRenderer'}
      };
    }
  };
};