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

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

goog.require('org.apache.royale.core.IChild');
goog.require('org.apache.royale.core.ITextModel');
goog.require('org.apache.royale.events.Event');
goog.require('org.apache.royale.jewel.Group');
goog.require('org.apache.royale.jewel.beads.models.FormItemModel');
goog.require('org.apache.royale.jewel.beads.views.FormItemView');
goog.require('org.apache.royale.core.IContainerBaseStrandChildrenHost');
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.Group}
 * @implements {org.apache.royale.core.IContainerBaseStrandChildrenHost}
 */
org.apache.royale.jewel.FormItem = function() {
  org.apache.royale.jewel.FormItem.base(this, 'constructor');
  this.typeNames = "jewel formitem";
};
goog.inherits(org.apache.royale.jewel.FormItem, org.apache.royale.jewel.Group);


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


/**
 * @export
 * @param {org.apache.royale.core.IChild} c
 * @param {boolean=} dispatchEvent
 */
org.apache.royale.jewel.FormItem.prototype.$addElement = function(c, dispatchEvent) {
  dispatchEvent = typeof dispatchEvent !== 'undefined' ? dispatchEvent : true;
  org.apache.royale.jewel.FormItem.superClass_.addElement.apply(this, [ c, dispatchEvent] );
};


/**
 * @asprivate
 * @suppress {undefinedNames}
 * Support strandChildren.
 * @export
 * @param {org.apache.royale.core.IChild} c
 * @param {number} index
 * @param {boolean=} dispatchEvent
 */
org.apache.royale.jewel.FormItem.prototype.$addElementAt = function(c, index, dispatchEvent) {
  dispatchEvent = typeof dispatchEvent !== 'undefined' ? dispatchEvent : true;
  org.apache.royale.jewel.FormItem.superClass_.addElementAt.apply(this, [ c, index, dispatchEvent] );
};


/**
 * @export
 * @param {number} index
 * @return {org.apache.royale.core.IChild}
 */
org.apache.royale.jewel.FormItem.prototype.$getElementAt = function(index) {
  return org.apache.royale.jewel.FormItem.superClass_.getElementAt.apply(this, [ index] );
};


/**
 * @asprivate
 * @suppress {undefinedNames}
 * Support strandChildren.
 * @export
 * @param {org.apache.royale.core.IChild} c
 * @param {boolean=} dispatchEvent
 */
org.apache.royale.jewel.FormItem.prototype.$removeElement = function(c, dispatchEvent) {
  dispatchEvent = typeof dispatchEvent !== 'undefined' ? dispatchEvent : true;
  org.apache.royale.jewel.FormItem.superClass_.removeElement.apply(this, [ c, dispatchEvent] );
};


/**
 * @asprivate
 * @suppress {undefinedNames}
 * Support strandChildren.
 * @export
 * @param {org.apache.royale.core.IChild} c
 * @return {number}
 */
org.apache.royale.jewel.FormItem.prototype.$getElementIndex = function(c) {
  return org.apache.royale.jewel.FormItem.superClass_.getElementIndex.apply(this, [ c] );
};


/**
 * @asprivate
 * @royaleignorecoercion org.apache.royale.html.beads.FormItemView
 * @export
 * @override
 */
org.apache.royale.jewel.FormItem.prototype.addElement = function(c, dispatchEvent) {
  dispatchEvent = typeof dispatchEvent !== 'undefined' ? dispatchEvent : true;
  var /** @type {org.apache.royale.jewel.beads.views.FormItemView} */ formItemView = org.apache.royale.utils.Language.as(this.view, org.apache.royale.jewel.beads.views.FormItemView);
  formItemView.contentArea.addElement(c, dispatchEvent);
  formItemView.contentArea.dispatchEvent(new org.apache.royale.events.Event("layoutNeeded"));
};


/**
 * @asprivate
 * @royaleignorecoercion org.apache.royale.html.beads.FormItemView
 * @export
 * @override
 */
org.apache.royale.jewel.FormItem.prototype.addElementAt = function(c, index, dispatchEvent) {
  dispatchEvent = typeof dispatchEvent !== 'undefined' ? dispatchEvent : true;
  var /** @type {org.apache.royale.jewel.beads.views.FormItemView} */ formItemView = org.apache.royale.utils.Language.as(this.view, org.apache.royale.jewel.beads.views.FormItemView);
  formItemView.contentArea.addElementAt(c, index, dispatchEvent);
  formItemView.contentArea.dispatchEvent(new org.apache.royale.events.Event("layoutNeeded"));
};


/**
 * @asprivate
 * @royaleignorecoercion org.apache.royale.html.beads.FormItemView
 * @export
 * @override
 */
org.apache.royale.jewel.FormItem.prototype.getElementIndex = function(c) {
  var /** @type {org.apache.royale.jewel.beads.views.FormItemView} */ formItemView = org.apache.royale.utils.Language.as(this.view, org.apache.royale.jewel.beads.views.FormItemView);
  return formItemView.contentArea.getElementIndex(c);
};


/**
 * @asprivate
 * @royaleignorecoercion org.apache.royale.html.beads.FormItemView
 * @export
 * @override
 */
org.apache.royale.jewel.FormItem.prototype.removeElement = function(c, dispatchEvent) {
  dispatchEvent = typeof dispatchEvent !== 'undefined' ? dispatchEvent : true;
  var /** @type {org.apache.royale.jewel.beads.views.FormItemView} */ formItemView = org.apache.royale.utils.Language.as(this.view, org.apache.royale.jewel.beads.views.FormItemView);
  formItemView.contentArea.removeElement(c, dispatchEvent);
};


/**
 * @asprivate
 * @royaleignorecoercion org.apache.royale.html.beads.FormItemView
 * @export
 * @override
 */
org.apache.royale.jewel.FormItem.prototype.getElementAt = function(index) {
  var /** @type {org.apache.royale.jewel.beads.views.FormItemView} */ formItemView = org.apache.royale.utils.Language.as(this.view, org.apache.royale.jewel.beads.views.FormItemView);
  return formItemView.contentArea.getElementAt(index);
};


org.apache.royale.jewel.FormItem.prototype.get__label = function() {
  return org.apache.royale.utils.Language.as(this.model, org.apache.royale.core.ITextModel, true).text;
};


org.apache.royale.jewel.FormItem.prototype.set__label = function(value) {
  org.apache.royale.utils.Language.as(this.model, org.apache.royale.core.ITextModel, true).text = value;
};


org.apache.royale.jewel.FormItem.prototype.get__html = function() {
  return org.apache.royale.utils.Language.as(this.model, org.apache.royale.core.ITextModel, true).html;
};


org.apache.royale.jewel.FormItem.prototype.set__html = function(value) {
  org.apache.royale.utils.Language.as(this.model, org.apache.royale.core.ITextModel, true).html = value;
};


org.apache.royale.jewel.FormItem.prototype.get__required = function() {
  return org.apache.royale.utils.Language.as(this.model, org.apache.royale.jewel.beads.models.FormItemModel, true).required;
};


org.apache.royale.jewel.FormItem.prototype.set__required = function(value) {
  org.apache.royale.utils.Language.as(this.model, org.apache.royale.jewel.beads.models.FormItemModel, true).required = value;
};


org.apache.royale.jewel.FormItem.prototype.get__labelAlign = function() {
  return org.apache.royale.utils.Language.as(this.model, org.apache.royale.jewel.beads.models.FormItemModel, true).labelAlign;
};


org.apache.royale.jewel.FormItem.prototype.set__labelAlign = function(value) {
  org.apache.royale.utils.Language.as(this.model, org.apache.royale.jewel.beads.models.FormItemModel, true).labelAlign = value;
};


org.apache.royale.jewel.FormItem.prototype.get__$numElements = function() {
  return org.apache.royale.jewel.FormItem.superClass_.get__numElements.apply(this);
};


org.apache.royale.jewel.FormItem.prototype.get__numElements = function() {
  var /** @type {org.apache.royale.jewel.beads.views.FormItemView} */ formItemView = org.apache.royale.utils.Language.as(this.view, org.apache.royale.jewel.beads.views.FormItemView);
  return formItemView.contentArea.numElements;
};


Object.defineProperties(org.apache.royale.jewel.FormItem.prototype, /** @lends {org.apache.royale.jewel.FormItem.prototype} */ {
/**
  * @export
  * @type {string} */
label: {
get: org.apache.royale.jewel.FormItem.prototype.get__label,
set: org.apache.royale.jewel.FormItem.prototype.set__label},
/**
  * @export
  * @type {string} */
html: {
get: org.apache.royale.jewel.FormItem.prototype.get__html,
set: org.apache.royale.jewel.FormItem.prototype.set__html},
/**
  * @export
  * @type {boolean} */
required: {
get: org.apache.royale.jewel.FormItem.prototype.get__required,
set: org.apache.royale.jewel.FormItem.prototype.set__required},
/**
  * @export
  * @type {string} */
labelAlign: {
get: org.apache.royale.jewel.FormItem.prototype.get__labelAlign,
set: org.apache.royale.jewel.FormItem.prototype.set__labelAlign},
/**
  * @export
  * @type {number} */
$numElements: {
get: org.apache.royale.jewel.FormItem.prototype.get__$numElements},
/**
  * @export
  * @type {number} */
numElements: {
get: org.apache.royale.jewel.FormItem.prototype.get__numElements}}
);


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



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.jewel.FormItem.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {return {};},
    accessors: function () {
      return {
        'label': { type: 'String', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.FormItem'},
        'html': { type: 'String', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.FormItem'},
        'required': { type: 'Boolean', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.FormItem'},
        'labelAlign': { type: 'String', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.FormItem'},
        '$numElements': { type: 'int', access: 'readonly', declaredBy: 'org.apache.royale.jewel.FormItem'},
        'numElements': { type: 'int', access: 'readonly', declaredBy: 'org.apache.royale.jewel.FormItem'}
      };
    },
    methods: function () {
      return {
        'FormItem': { type: '', declaredBy: 'org.apache.royale.jewel.FormItem'},
        '$addElement': { type: 'void', declaredBy: 'org.apache.royale.jewel.FormItem', parameters: function () { return [  { index: 1, type: 'org.apache.royale.core.IChild', optional: false },{ index: 2, type: 'Boolean', optional: true } ]; }},
        '$addElementAt': { type: 'void', declaredBy: 'org.apache.royale.jewel.FormItem', parameters: function () { return [  { index: 1, type: 'org.apache.royale.core.IChild', optional: false },{ index: 2, type: 'int', optional: false },{ index: 3, type: 'Boolean', optional: true } ]; }},
        '$getElementAt': { type: 'org.apache.royale.core.IChild', declaredBy: 'org.apache.royale.jewel.FormItem', parameters: function () { return [  { index: 1, type: 'int', optional: false } ]; }},
        '$removeElement': { type: 'void', declaredBy: 'org.apache.royale.jewel.FormItem', parameters: function () { return [  { index: 1, type: 'org.apache.royale.core.IChild', optional: false },{ index: 2, type: 'Boolean', optional: true } ]; }},
        '$getElementIndex': { type: 'int', declaredBy: 'org.apache.royale.jewel.FormItem', parameters: function () { return [  { index: 1, type: 'org.apache.royale.core.IChild', optional: false } ]; }},
        'addElement': { type: 'void', declaredBy: 'org.apache.royale.jewel.FormItem', parameters: function () { return [  { index: 1, type: 'org.apache.royale.core.IChild', optional: false },{ index: 2, type: 'Boolean', optional: true } ]; }},
        'addElementAt': { type: 'void', declaredBy: 'org.apache.royale.jewel.FormItem', parameters: function () { return [  { index: 1, type: 'org.apache.royale.core.IChild', optional: false },{ index: 2, type: 'int', optional: false },{ index: 3, type: 'Boolean', optional: true } ]; }},
        'getElementIndex': { type: 'int', declaredBy: 'org.apache.royale.jewel.FormItem', parameters: function () { return [  { index: 1, type: 'org.apache.royale.core.IChild', optional: false } ]; }},
        'removeElement': { type: 'void', declaredBy: 'org.apache.royale.jewel.FormItem', parameters: function () { return [  { index: 1, type: 'org.apache.royale.core.IChild', optional: false },{ index: 2, type: 'Boolean', optional: true } ]; }},
        'getElementAt': { type: 'org.apache.royale.core.IChild', declaredBy: 'org.apache.royale.jewel.FormItem', parameters: function () { return [  { index: 1, type: 'int', optional: false } ]; }}
      };
    }
  };
};