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

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

goog.require('org.apache.royale.core.DataContainerBase');
goog.require('org.apache.royale.core.IDataProviderModel');
goog.require('org.apache.royale.core.IListPresentationModel');
goog.require('org.apache.royale.jewel.beads.models.ListPresentationModel');
goog.require('org.apache.royale.utils.ClassSelectorList');
goog.require('org.apache.royale.core.IListWithPresentationModel');
goog.require('org.apache.royale.utils.IClassSelectorListSupport');



/**
 *  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.core.IListWithPresentationModel}
 * @implements {org.apache.royale.utils.IClassSelectorListSupport}
 */
org.apache.royale.jewel.DataContainer = function() {
  org.apache.royale.jewel.DataContainer.base(this, 'constructor');
  this.typeNames = "jewel datacontainer";
  this.classSelectorList = new org.apache.royale.utils.ClassSelectorList(this);
};
goog.inherits(org.apache.royale.jewel.DataContainer, org.apache.royale.core.DataContainerBase);


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


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


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


/**
 * 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.DataContainer.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.DataContainer.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.DataContainer.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.DataContainer.prototype.containsClass = function(name) {
  return this.classSelectorList.contains(name);
  
};


org.apache.royale.jewel.DataContainer.prototype.get__labelField = function() {
  return this.model.labelField;
};


org.apache.royale.jewel.DataContainer.prototype.set__labelField = function(value) {
  this.model.labelField = value;
};


org.apache.royale.jewel.DataContainer.prototype.get__dataProvider = function() {
  return this.model.dataProvider;
};


org.apache.royale.jewel.DataContainer.prototype.set__dataProvider = function(value) {
  this.model.dataProvider = value;
};


org.apache.royale.jewel.DataContainer.prototype.get__presentationModel = function() {
  var /** @type {org.apache.royale.core.IListPresentationModel} */ presModel = this.getBeadByType(org.apache.royale.core.IListPresentationModel);
  if (presModel == null) {
    presModel = new org.apache.royale.jewel.beads.models.ListPresentationModel();
    this.addBead(presModel);
  }
  return presModel;
};


Object.defineProperties(org.apache.royale.jewel.DataContainer.prototype, /** @lends {org.apache.royale.jewel.DataContainer.prototype} */ {
/**
  * @export
  * @type {string} */
labelField: {
get: org.apache.royale.jewel.DataContainer.prototype.get__labelField,
set: org.apache.royale.jewel.DataContainer.prototype.set__labelField},
/**
  * @export
  * @type {Object} */
dataProvider: {
get: org.apache.royale.jewel.DataContainer.prototype.get__dataProvider,
set: org.apache.royale.jewel.DataContainer.prototype.set__dataProvider},
/**
  * @export
  * @type {org.apache.royale.core.IListPresentationModel} */
presentationModel: {
get: org.apache.royale.jewel.DataContainer.prototype.get__presentationModel}}
);


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



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.jewel.DataContainer.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {return {};},
    accessors: function () {
      return {
        'labelField': { type: 'String', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.DataContainer'},
        'dataProvider': { type: 'Object', access: 'readwrite', declaredBy: 'org.apache.royale.jewel.DataContainer'},
        'presentationModel': { type: 'org.apache.royale.core.IListPresentationModel', access: 'readonly', declaredBy: 'org.apache.royale.jewel.DataContainer'}
      };
    },
    methods: function () {
      return {
        'DataContainer': { type: '', declaredBy: 'org.apache.royale.jewel.DataContainer'},
        'addClass': { type: 'void', declaredBy: 'org.apache.royale.jewel.DataContainer', parameters: function () { return [  { index: 1, type: 'String', optional: false } ]; }},
        'removeClass': { type: 'void', declaredBy: 'org.apache.royale.jewel.DataContainer', parameters: function () { return [  { index: 1, type: 'String', optional: false } ]; }},
        'toggleClass': { type: 'void', declaredBy: 'org.apache.royale.jewel.DataContainer', parameters: function () { return [  { index: 1, type: 'String', optional: false },{ index: 2, type: 'Boolean', optional: false } ]; }},
        'containsClass': { type: 'Boolean', declaredBy: 'org.apache.royale.jewel.DataContainer', parameters: function () { return [  { index: 1, type: 'String', optional: false } ]; }}
      };
    },
    metadata: function () { return [  ]; }
  };
};