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

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

goog.require('org.apache.royale.core.DataContainerBase');
goog.require('org.apache.royale.core.ISelectionModel');
goog.require('org.apache.royale.core.WrappedHTMLElement');
goog.require('org.apache.royale.html.util.addElementToWrapper');
goog.require('org.apache.royale.jewel.beads.models.TableModel');
goog.require('org.apache.royale.utils.ClassSelectorList');
goog.require('org.apache.royale.utils.IClassSelectorListSupport');
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.DataContainerBase}
 * @implements {org.apache.royale.utils.IClassSelectorListSupport}
 */
org.apache.royale.jewel.Table = function() {
  org.apache.royale.jewel.Table.base(this, 'constructor');
  this.typeNames = "jewel table";
  this.classSelectorList = new org.apache.royale.utils.ClassSelectorList(this);
};
goog.inherits(org.apache.royale.jewel.Table, org.apache.royale.core.DataContainerBase);


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


/**
 * @protected
 * @type {org.apache.royale.utils.ClassSelectorList}
 */
org.apache.royale.jewel.Table.prototype.classSelectorList;


/**
 * @protected
 * @override
 */
org.apache.royale.jewel.Table.prototype.setClassName = function(value) {
  this.classSelectorList.addNames(value);
};


/**
 * @private
 * @type {boolean}
 */
org.apache.royale.jewel.Table.prototype.org_apache_royale_jewel_Table__fixedHeader;


/**
 * @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement
 * @protected
 * @override
 */
org.apache.royale.jewel.Table.prototype.createElement = function() {
  return org.apache.royale.html.util.addElementToWrapper(this, 'table');
};


/**
 * Add a class selector to the list.
 * 
 * @asparam name Name of selector to add.
 * 
 * @langversion 3.0
 * @playerversion Flash 10.2
 * @playerversion AIR 2.6
 * @productversion Royale 0.9.4
 * @export
 * @param {string} name
 */
org.apache.royale.jewel.Table.prototype.addClass = function(name) {
  this.classSelectorList.add(name);
};


/**
 * Removes a class selector from the list.
 * 
 * @asparam name Name of selector to remove.
 *
 * @royaleignorecoercion HTMLElement
 * @royaleignorecoercion DOMTokenList
 * 
 * @langversion 3.0
 * @playerversion Flash 10.2
 * @playerversion AIR 2.6
 * @productversion Royale 0.9.4
 * @export
 * @param {string} name
 */
org.apache.royale.jewel.Table.prototype.removeClass = function(name) {
  this.classSelectorList.remove(name);
};


/**
 * Add or remove a class selector to/from the list.
 * 
 * @asparam name Name of selector to add or remove.
 * @asparam value True to add, False to remove.
 * 
 * @langversion 3.0
 * @playerversion Flash 10.2
 * @playerversion AIR 2.6
 * @productversion Royale 0.9.4
 * @export
 * @param {string} name
 * @param {boolean} value
 */
org.apache.royale.jewel.Table.prototype.toggleClass = function(name, value) {
  this.classSelectorList.toggle(name, value);
};


/**
 *  Search for the name in the element class list 
 *
 *  @asparam name Name of selector to find.
 *  @asreturn return true if the name is found or false otherwise.
 * 
 *  @langversion 3.0
 *  @playerversion Flash 10.2
 *  @playerversion AIR 2.6
 *  @productversion Royale 0.9.4
 * @export
 * @param {string} name
 * @return {boolean}
 */
org.apache.royale.jewel.Table.prototype.containsClass = function(name) {
  return this.classSelectorList.contains(name);
  
};


org.apache.royale.jewel.Table.prototype.get__columns = function() {
  return org.apache.royale.utils.Language.as(this.model, org.apache.royale.jewel.beads.models.TableModel, true).columns;
};


org.apache.royale.jewel.Table.prototype.set__columns = function(value) {
  org.apache.royale.utils.Language.as(this.model, org.apache.royale.jewel.beads.models.TableModel, true).columns = value;
};


org.apache.royale.jewel.Table.prototype.get__fixedHeader = function() {
  return this.org_apache_royale_jewel_Table__fixedHeader;
};


org.apache.royale.jewel.Table.prototype.set__fixedHeader = function(value) {
  this.org_apache_royale_jewel_Table__fixedHeader = value;
  this.toggleClass("fixedHeader", this.org_apache_royale_jewel_Table__fixedHeader);
};


org.apache.royale.jewel.Table.prototype.get__dataProvider = function() {
  return org.apache.royale.utils.Language.as(this.model, org.apache.royale.jewel.beads.models.TableModel, true).dataProvider;
};


org.apache.royale.jewel.Table.prototype.set__dataProvider = function(value) {
  org.apache.royale.utils.Language.as(this.model, org.apache.royale.jewel.beads.models.TableModel, true).dataProvider = value;
};


org.apache.royale.jewel.Table.prototype.get__selectedIndex = function() {
  return this.model.selectedIndex;
};


org.apache.royale.jewel.Table.prototype.set__selectedIndex = function(value) {
  this.model.selectedIndex = value;
};


org.apache.royale.jewel.Table.prototype.get__selectedItem = function() {
  return this.model.selectedItem;
};


org.apache.royale.jewel.Table.prototype.set__selectedItem = function(value) {
  this.model.selectedItem = value;
};


org.apache.royale.jewel.Table.prototype.get__selectedItemProperty = function() {
  return org.apache.royale.utils.Language.as(this.model, org.apache.royale.jewel.beads.models.TableModel, true).selectedItemProperty;
};


org.apache.royale.jewel.Table.prototype.set__selectedItemProperty = function(value) {
  org.apache.royale.utils.Language.as(this.model, org.apache.royale.jewel.beads.models.TableModel, true).selectedItemProperty = value;
};


Object.defineProperties(org.apache.royale.jewel.Table.prototype, /** @lends {org.apache.royale.jewel.Table.prototype} */ {
/**
  * @export
  * @type {Array} */
columns: {
get: org.apache.royale.jewel.Table.prototype.get__columns,
set: org.apache.royale.jewel.Table.prototype.set__columns},
/**
  * @export
  * @type {boolean} */
fixedHeader: {
get: org.apache.royale.jewel.Table.prototype.get__fixedHeader,
set: org.apache.royale.jewel.Table.prototype.set__fixedHeader},
/**
  * @export
  * @type {Object} */
dataProvider: {
get: org.apache.royale.jewel.Table.prototype.get__dataProvider,
set: org.apache.royale.jewel.Table.prototype.set__dataProvider},
/**
  * @export
  * @type {number} */
selectedIndex: {
get: org.apache.royale.jewel.Table.prototype.get__selectedIndex,
set: org.apache.royale.jewel.Table.prototype.set__selectedIndex},
/**
  * @export
  * @type {Object} */
selectedItem: {
get: org.apache.royale.jewel.Table.prototype.get__selectedItem,
set: org.apache.royale.jewel.Table.prototype.set__selectedItem},
/**
  * @export
  * @type {Object} */
selectedItemProperty: {
get: org.apache.royale.jewel.Table.prototype.get__selectedItemProperty,
set: org.apache.royale.jewel.Table.prototype.set__selectedItemProperty}}
);


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



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.jewel.Table.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {return {};},
    accessors: function () {
      return {
        'columns': { type: 'Array', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.Table'},
        'fixedHeader': { type: 'Boolean', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.Table'},
        'dataProvider': { type: 'Object', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.Table'},
        'selectedIndex': { type: 'int', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.Table', metadata: function () { return [ { name: 'Bindable', args: [ { key: '', value: 'change' } ] } ]; }},
        'selectedItem': { type: 'Object', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.Table', metadata: function () { return [ { name: 'Bindable', args: [ { key: '', value: 'change' } ] } ]; }},
        'selectedItemProperty': { type: 'Object', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.Table', metadata: function () { return [ { name: 'Bindable', args: [ { key: '', value: 'change' } ] } ]; }}
      };
    },
    methods: function () {
      return {
        'Table': { type: '', declaredBy: 'org.apache.royale.jewel.Table'},
        'addClass': { type: 'void', declaredBy: 'org.apache.royale.jewel.Table', parameters: function () { return [  { index: 1, type: 'String', optional: false } ]; }},
        'removeClass': { type: 'void', declaredBy: 'org.apache.royale.jewel.Table', parameters: function () { return [  { index: 1, type: 'String', optional: false } ]; }},
        'toggleClass': { type: 'void', declaredBy: 'org.apache.royale.jewel.Table', parameters: function () { return [  { index: 1, type: 'String', optional: false },{ index: 2, type: 'Boolean', optional: false } ]; }},
        'containsClass': { type: 'Boolean', declaredBy: 'org.apache.royale.jewel.Table', parameters: function () { return [  { index: 1, type: 'String', optional: false } ]; }}
      };
    },
    metadata: function () { return [  ]; }
  };
};