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

goog.provide('org.apache.royale.jewel.Label');

goog.require('org.apache.royale.core.StyledUIBase');
goog.require('org.apache.royale.core.WrappedHTMLElement');
goog.require('org.apache.royale.html.util.addElementToWrapper');
goog.require('org.apache.royale.utils.Language');



/**
 *  Constructor.
 *
 *  @langversion 3.0
 *  @playerversion Flash 10.2
 *  @playerversion AIR 2.6
 *  @productversion Royale 0.9.4
 * @constructor
 * @extends {org.apache.royale.core.StyledUIBase}
 */
org.apache.royale.jewel.Label = function() {
  org.apache.royale.jewel.Label.base(this, 'constructor');
  this.typeNames = "jewel label";
};
goog.inherits(org.apache.royale.jewel.Label, org.apache.royale.core.StyledUIBase);


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


/**
 * @protected
 * @type {Text}
 */
org.apache.royale.jewel.Label.prototype.textNode;


/**
 * @private
 * @type {string}
 */
org.apache.royale.jewel.Label.prototype.org_apache_royale_jewel_Label__text = "";


/**
 * @private
 * @type {boolean}
 */
org.apache.royale.jewel.Label.prototype.org_apache_royale_jewel_Label__multiline;


/**
 * @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement
 * @protected
 * @override
 */
org.apache.royale.jewel.Label.prototype.createElement = function() {
  org.apache.royale.html.util.addElementToWrapper(this, 'div');
  this.textNode = org.apache.royale.utils.Language.as(document.createTextNode(this.org_apache_royale_jewel_Label__text), Text);
  this.element.appendChild(this.textNode);
  this.positioner = this.element;
  return this.element;
};


org.apache.royale.jewel.Label.prototype.get__text = function() {
  
  return this.org_apache_royale_jewel_Label__text;
};


org.apache.royale.jewel.Label.prototype.set__text = function(value) {
  
  if (this.textNode) {
    this.org_apache_royale_jewel_Label__text = value;
    this.textNode.nodeValue = value;
    this.dispatchEvent('textChange');
  }
};


org.apache.royale.jewel.Label.prototype.get__html = function() {
  
  return this.element.innerHTML;
};


org.apache.royale.jewel.Label.prototype.set__html = function(value) {
  
  this.element.innerHTML = value;
  this.dispatchEvent('textChange');
};


org.apache.royale.jewel.Label.prototype.get__multiline = function() {
  return this.org_apache_royale_jewel_Label__multiline;
};


org.apache.royale.jewel.Label.prototype.set__multiline = function(value) {
  if (this.org_apache_royale_jewel_Label__multiline != value) {
    this.org_apache_royale_jewel_Label__multiline = value;
    this.toggleClass("multiline", this.org_apache_royale_jewel_Label__multiline);
  }
};


Object.defineProperties(org.apache.royale.jewel.Label.prototype, /** @lends {org.apache.royale.jewel.Label.prototype} */ {
/**
  * @export
  * @type {string} */
text: {
get: org.apache.royale.jewel.Label.prototype.get__text,
set: org.apache.royale.jewel.Label.prototype.set__text},
/**
  * @export
  * @type {string} */
html: {
get: org.apache.royale.jewel.Label.prototype.get__html,
set: org.apache.royale.jewel.Label.prototype.set__html},
/**
  * @export
  * @type {boolean} */
multiline: {
get: org.apache.royale.jewel.Label.prototype.get__multiline,
set: org.apache.royale.jewel.Label.prototype.set__multiline}}
);


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



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.jewel.Label.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {return {};},
    accessors: function () {
      return {
        'text': { type: 'String', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.Label', metadata: function () { return [ { name: 'Bindable', args: [ { key: '', value: 'textChange' } ] } ]; }},
        'html': { type: 'String', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.Label', metadata: function () { return [ { name: 'Bindable', args: [ { key: '', value: 'htmlChange' } ] } ]; }},
        'multiline': { type: 'Boolean', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.Label'}
      };
    },
    methods: function () {
      return {
        'Label': { type: '', declaredBy: 'org.apache.royale.jewel.Label'}
      };
    },
    metadata: function () { return [  ]; }
  };
};