var AdfUIComponents = new Object;
AdfUIComponents.CreateArrayToObjectFunction = function(propertyNames) {
  var funcBody = "return {'";
  var propNames = propertyNames.join("':1,'");
  funcBody += propNames + "':1};";
  return new Function(funcBody);
};
AdfUIComponents.CreatePropertiesFunction = function(propertyKeys) {
  var properties = {};
  for (var i = 0;i < propertyKeys.length;i++) {
    var key = propertyKeys[i];
    if (typeof key == "string") {
      key = {"name":key};
    } else {
      AdfAssert.assertObject(key);
    }
    if (!key["type"]) {
      key.type = "Object";
    }
    if (key["default"] === undefined) {
      key["default"] = null;
    }
    properties[key.name] = key;
  }
  return function() {
    return properties;
  };
};
AdfUIComponents._nullFunction = function() {
  return null;
};
AdfUIComponents.createComponentClass = function(componentName, componentDef) {
  var componentType = componentDef["componentType"];
  var constructorFunction = function anonymous(i, p, u) {
    this.Init(componentType, i, p, u);
  };
  constructorFunction["_COMPONENT_TYPE"] = componentType;
  var theSuperclass = componentDef["superclass"];
  if (!theSuperclass) {
    theSuperclass = AdfUIComponent;
  }
  AdfObject.createSubclass(constructorFunction, theSuperclass, componentName);
  if (componentName) {
    window[componentName] = constructorFunction;
  }
  var subclassPropertyFunc = AdfUIComponents._nullFunction;
  var propertyKeys = componentDef["propertyKeys"];
  if (propertyKeys && propertyKeys.length) {
    subclassPropertyFunc = AdfUIComponents.CreatePropertiesFunction(propertyKeys);
  }
  var namingContainer = componentDef["namingContainer"];
  if (namingContainer || AdfUIComponent.__isNamingContainer(theSuperclass)) {
    AdfUIComponent.__setNamingContainer(constructorFunction, true);
  }
  constructorFunction.GetSubclassPropertyKeys = subclassPropertyFunc;
  constructorFunction.InitClass = AdfUIComponent.InitClass;
  AdfUIComponent.registerComponent(componentType, constructorFunction);
  return constructorFunction;
};
AdfUIComponents.constructorFunction = function(i, p, u) {
  this.Init(AdfUIPopup._COMPONENT_TYPE, i, p, u);
};
AdfUIComponents._PROPERTIES_PARAM_NAME = "p";
AdfUIComponents._ID_PARAM_NAME = "i";
AdfUIComponents._USAGE_PARAM_NAME = "u";
