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

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

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.
 *
 *  @langversion 3.0
 *  @playerversion Flash 10.2
 *  @playerversion AIR 2.6
 *  @productversion Royale 0.9
 * @constructor
 * @extends {org.apache.royale.html.supportClasses.DataItemRenderer}
 * @implements {org.apache.royale.html.beads.ITextItemRenderer}
 */
org.apache.royale.html.supportClasses.MenuItemRenderer = function() {
  org.apache.royale.html.supportClasses.MenuItemRenderer.base(this, 'constructor');
  this.typeNames = "MenuItemRenderer";
};
goog.inherits(org.apache.royale.html.supportClasses.MenuItemRenderer, org.apache.royale.html.supportClasses.DataItemRenderer);


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


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


/**
 * @export
 * @override
 */
org.apache.royale.html.supportClasses.MenuItemRenderer.prototype.addedToParent = function() {
  org.apache.royale.html.supportClasses.MenuItemRenderer.superClass_.addedToParent.apply(this);
  this.org_apache_royale_html_supportClasses_MenuItemRenderer_label = new org.apache.royale.html.Label();
  this.org_apache_royale_html_supportClasses_MenuItemRenderer_label.typeNames = "MenuItemLabel";
  this.addElement(this.org_apache_royale_html_supportClasses_MenuItemRenderer_label);
  this.org_apache_royale_html_supportClasses_MenuItemRenderer_label.setParentEventTarget(this);
};


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


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


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


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


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


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



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