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

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

goog.require('goog.events');
goog.require('org.apache.royale.core.WrappedHTMLElement');
goog.require('org.apache.royale.html.util.addElementToWrapper');
goog.require('org.apache.royale.jewel.supportClasses.textinput.TextInputBase');
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.jewel.supportClasses.textinput.TextInputBase}
 */
org.apache.royale.jewel.TextArea = function() {
  org.apache.royale.jewel.TextArea.base(this, 'constructor');
  this.typeNames = "jewel textarea";
};
goog.inherits(org.apache.royale.jewel.TextArea, org.apache.royale.jewel.supportClasses.textinput.TextInputBase);


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


/**
 * @private
 * @type {number}
 */
org.apache.royale.jewel.TextArea.prototype.org_apache_royale_jewel_TextArea__rows = 2;


/**
 * @private
 * @type {number}
 */
org.apache.royale.jewel.TextArea.prototype.org_apache_royale_jewel_TextArea__maxrows = 0;


/**
 * @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement
 * @royaleignorecoercion HTMLDivElement
 * @royaleignorecoercion HTMLInputElement
 * @royaleignorecoercion HTMLLabelElement
 * @royaleignorecoercion Text
 * @protected
 * @override
 */
org.apache.royale.jewel.TextArea.prototype.createElement = function() {
  this.div = document.createElement('div');
  this.input = org.apache.royale.html.util.addElementToWrapper(this, 'textarea');
  this.input.setAttribute('type', 'text');
  this.input.setAttribute('rows', this.rows);
  goog.events.listen(this.input, 'input', org.apache.royale.utils.Language.closure(this.textChangeHandler, this, 'textChangeHandler'));
  this.div.appendChild(this.input);
  this.positioner = this.div;
  this.positioner.royale_wrapper = this;
  return this.element;
};


org.apache.royale.jewel.TextArea.prototype.get__rows = function() {
  return this.org_apache_royale_jewel_TextArea__rows;
};


org.apache.royale.jewel.TextArea.prototype.set__rows = function(value) {
  this.org_apache_royale_jewel_TextArea__rows = value;
  this.input.setAttribute('rows', this.org_apache_royale_jewel_TextArea__rows);
};


org.apache.royale.jewel.TextArea.prototype.get__maxrows = function() {
  return this.org_apache_royale_jewel_TextArea__maxrows;
};


org.apache.royale.jewel.TextArea.prototype.set__maxrows = function(value) {
  this.org_apache_royale_jewel_TextArea__maxrows = value;
  this.input.setAttribute('maxrows', this.org_apache_royale_jewel_TextArea__maxrows);
};


Object.defineProperties(org.apache.royale.jewel.TextArea.prototype, /** @lends {org.apache.royale.jewel.TextArea.prototype} */ {
/**
  * @export
  * @type {number} */
rows: {
get: org.apache.royale.jewel.TextArea.prototype.get__rows,
set: org.apache.royale.jewel.TextArea.prototype.set__rows},
/**
  * @export
  * @type {number} */
maxrows: {
get: org.apache.royale.jewel.TextArea.prototype.get__maxrows,
set: org.apache.royale.jewel.TextArea.prototype.set__maxrows}}
);


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



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.jewel.TextArea.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {return {};},
    accessors: function () {
      return {
        'rows': { type: 'int', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.TextArea'},
        'maxrows': { type: 'int', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.TextArea'}
      };
    },
    methods: function () {
      return {
        'TextArea': { type: '', declaredBy: 'org.apache.royale.jewel.TextArea'}
      };
    }
  };
};