function AdfUIComponent(componentType) {
  this.Init(componentType);
}
AdfObject.createSubclass(AdfUIComponent);
AdfUIComponent._COMPONENT_FACTORY = new Object;
AdfUIComponent.USAGE_PRIVATE_CHILD = 1;
AdfUIComponent.STATE_LOADING = 1;
AdfUIComponent.STATE_COMPLETE = 4;
AdfUIComponent.createComponent = function(componentType) {
  AdfAssert.assert(componentType, "component type  required when creating components");
  var componentConstructor = AdfUIComponent._COMPONENT_FACTORY[componentType];
  if (!componentConstructor) {
    AdfLogger.LOGGER.warning("No component for:", componentType);
    return null;
  } else {
    return new componentConstructor;
  }
};
AdfUIComponent.registerComponent = function(componentType, componentClass) {
  AdfAssert.assert(componentClass, "constructor required when registering components for " + componentType);
  AdfAssert.assert(componentType, "componentType required when registering " + componentClass);
  AdfUIComponent._COMPONENT_FACTORY[componentType] = componentClass;
};
AdfUIComponent.prototype.addEventListener = function(eventType, listener, instance) {
  var listeners = AdfEventUtils.addEventListener(this._getClientListeners(), eventType, listener, instance);
  this.setProperty("clientListeners", listeners);
};
AdfUIComponent.prototype.removeEventListener = function(eventType, listener, instance) {
  var listeners = AdfEventUtils.removeEventListener(this._getClientListeners(), eventType, listener, instance);
  this.setProperty("clientListeners", listeners);
};
AdfUIComponent.prototype.getProperty = function(propName) {
  var value = this._props[propName];
  if (value === undefined) {
    var peer = this._peer;
    if (peer != null) {
      value = peer.getComponentProperty(this, propName);
    }
    if (value === undefined) {
      var key = this.getPropertyKeys()[propName];
      if (key != null) {
        var defaultValue = key[AdfUIComponent.PROPERTY_KEY_DEFAULT];
        value = defaultValue;
        if (defaultValue === undefined) {
          defaultValue = AdfUIComponent._DEFAULT_VALUE_UNDEFINED;
        }
        this._props[propName] = defaultValue;
      }
    }
  } else {
    if (value === AdfUIComponent._DEFAULT_VALUE_UNDEFINED) {
      value = undefined;
    }
  }
  return value;
};
AdfUIComponent.prototype.getPropertyValue = function(propName) {
  return this.getProperty(propName);
};
AdfUIComponent.prototype.getPropertyKeys = function() {
  return this.constructor[AdfUIComponent._CLASS_PROPERTY_KEYS];
};
AdfUIComponent.prototype.getComponentType = function() {
  return this._componentType;
};
AdfUIComponent.prototype.satisfiesUsage = function(usage) {
  AdfAssert.assertNumber(usage);
  var usageFlags = this._componentUsageFlags;
  return (usage & usageFlags) != 0;
};
AdfUIComponent.prototype.dontPropagateDescendantMessageChanges = function() {
  return false;
};
AdfUIComponent.prototype.initializeProperty = function(propName, newValue) {
  if (AdfAssert.DEBUG) {
    AdfAssert.assert(this._props[propName] === undefined, "Property '" + propName + "' is already defined as " + this._props[propName]);
  }
  this._props[propName] = newValue;
};
AdfUIComponent.prototype.setProperty = function(propName, newValue, persist, propagate) {
  AdfAssert.assertString(propName);
  var oldValue = this.getProperty(propName);
  if (AdfUIComponent.isSecureProperty(this, propName)) {
    AdfLogger.LOGGER.severe("Ignoring attempt to set secured property[" + propName + "] to:" + newValue);
    return oldValue;
  }
  if (oldValue === newValue) {
    return oldValue;
  }
  var valueChanged = oldValue == null || !this.ComparePropertyValues(propName, oldValue, newValue);
  if (!valueChanged) {
    return oldValue;
  }
  this._props[propName] = newValue;
  var propertyKey = this.getPropertyKeys()[propName];
  if (propagate != AdfUIComponent.PROPAGATE_NEVER && propagate != AdfUIComponent.PROPAGATE_LOCALLY && (propertyKey ? !propertyKey[AdfUIComponent.PROPERTY_DISCONNECTED] : propagate == AdfUIComponent.PROPAGATE_ALWAYS)) {
    AdfPage.PAGE.addChangedComponent(this);
    var propertyChanges = this._propChanges;
    if (propertyChanges == undefined) {
      propertyChanges = new Object;
      this._propChanges = propertyChanges;
    }
    var flaggedPropertyKey = propName + AdfUIComponent._FLAG_PERSISTENCE;
    if (persist) {
      propertyChanges[flaggedPropertyKey] = true;
      if (propertyChanges[propName]) {
        propertyChanges[propName] = false;
      }
    } else {
      propertyChanges[propName] = true;
      if (propertyChanges[flaggedPropertyKey]) {
        propertyChanges[flaggedPropertyKey] = false;
      }
    }
  }
  this.SetPropertyImpl(propName, oldValue, newValue);
  if (propagate != AdfUIComponent.PROPAGATE_NEVER) {
    var hasPeer = this._peer != null;
    var clientListeners = this._getClientListeners();
    var propListeners = clientListeners ? clientListeners["propertyChange"] : null;
    if (hasPeer || propListeners) {
      var changeEvent = new AdfPropertyChangeEvent(this, propName, oldValue, newValue);
      if (hasPeer) {
        try {
          this._peer.ComponentPropertyChanged(changeEvent);
        } catch (e) {
          AdfLogger.LOGGER.logError(e, AdfLogger.WARNING, "Error delivering property changed event:" + changeEvent);
          throw e;
        }
      }
      if (propListeners) {
        this._deliverEventToListeners(changeEvent, propListeners);
      }
    }
    this.DeliverDerivedPropertyEvents(propName, oldValue, newValue);
  }
  return oldValue;
};
AdfUIComponent.isSecureProperty = function(component, propName) {
  var propertyKey = component.getPropertyKeys()[propName];
  var isSecureProperty = false;
  if (propertyKey) {
    isSecureProperty = !propertyKey[AdfUIComponent.PROPERTY_DISCONNECTED];
    if (isSecureProperty) {
      isSecureProperty = propertyKey[AdfUIComponent.PROPERTY_KEY_SECURED];
    }
    if (isSecureProperty) {
      var unsecurePropNames = component.getProperty("unsecure");
      isSecureProperty = unsecurePropNames == null || !(propName in unsecurePropNames);
    }
  }
  return isSecureProperty;
};
AdfUIComponent.prototype.setInlineStyleProperty = function(propName, propValue) {
  this.getPeer().setInlineStyleProperty(this, propName, propValue);
};
AdfUIComponent.prototype.getInlineStyleProperty = function(propName) {
  return this.getPeer().getInlineStyleProperty(this, propName);
};
AdfUIComponent.prototype.getReadyState = function() {
  return this.getPeer().getReadyState(this);
};
AdfUIComponent.prototype.getClientId = function() {
  return this._clientId;
};
AdfUIComponent.prototype.getAbsoluteId = function() {
  var absoluteId = this._absoluteId;
  if (absoluteId == null) {
    absoluteId = this._peer.getAbsoluteId(this, this._clientId);
    this._absoluteId = absoluteId;
  }
  return absoluteId;
};
AdfUIComponent.prototype.getAbsoluteLocator = function() {
  return AdfPage.PAGE.getAbsoluteLocator(this);
};
AdfUIComponent.prototype.getAccessibleName = function() {
  var peer = this.getPeer();
  var accessibleName = null;
  if (peer) {
    accessibleName = peer.getAccessibleName(this);
  }
  return accessibleName;
};
AdfUIComponent.prototype.findComponent = function(expr, skipDeprecation) {
  return AdfUIComponent.__findComponent(expr, this, skipDeprecation);
};
AdfUIComponent.__findComponent = function(expr, component, skipDeprecation) {
  AdfAssert.assertNonEmptyString(expr);
  var leadingQualifiers = expr.match(/^:+/);
  if (leadingQualifiers != null) {
    leadingQualifiers = leadingQualifiers[0];
  }
  var upCount = 0;
  var relative = false;
  var searchScopedId = expr;
  if (leadingQualifiers != null) {
    var qualifierLength = leadingQualifiers.length;
    if (expr.length <= qualifierLength) {
      AdfLogger.LOGGER.severe('Error - Illegal argument - invalid expression \x3d "', expr, '"; the expression must be more than just leading qualifiers.');
      return undefined;
    }
    if (qualifierLength == 1) {
      searchScopedId = expr.substring(1);
    } else {
      upCount = qualifierLength;
      relative = true;
      searchScopedId = expr.substring(qualifierLength);
    }
  } else {
    relative = true;
    upCount = 1;
  }
  var relativeSeatchString;
  var componentAbsoluteId;
  var prefixId;
  var isNamingContainer;
  if (relative) {
    isNamingContainer = AdfUIComponent.__isNamingContainer(component.constructor);
    var foundComponent = AdfUIComponent._findRelativeComponent(component.getClientId(), isNamingContainer, upCount > 0 ? upCount - 1 : 0, searchScopedId, ":", expr, skipDeprecation);
    if (foundComponent) {
      return foundComponent;
    }
    if (isNamingContainer) {
      upCount--;
    }
    componentAbsoluteId = component.getAbsoluteId();
    relativeSeatchString = searchScopedId;
    prefixId = AdfUIComponent._trimAbsoluteScopedId(componentAbsoluteId, upCount);
    searchScopedId = prefixId + relativeSeatchString;
  }
  foundComponent = AdfUIComponent._findAbsoluteComponent(searchScopedId);
  if (!foundComponent && relative) {
    if (!skipDeprecation) {
      var deprecationUpCount = upCount;
      if (isNamingContainer) {
        deprecationUpCount++;
      } else {
        deprecationUpCount--;
      }
      prefixId = AdfUIComponent._trimAbsoluteScopedId(componentAbsoluteId, deprecationUpCount);
      searchScopedId = prefixId + relativeSeatchString;
      foundComponent = AdfUIComponent._findAbsoluteComponent(searchScopedId);
      if (foundComponent) {
        AdfLogger.LOGGER.warning("Use of deprecated findComponent search string:", expr, " on ", component);
      }
    }
    if (!foundComponent) {
      var prefixIds = componentAbsoluteId.split(":");
      var remainingUpCount = upCount;
      var idIndex = prefixIds.length - 1;
      while (!foundComponent && idIndex && remainingUpCount) {
        var currId = prefixIds[idIndex];
        if (!isNaN(currId)) {
          prefixIds.splice(idIndex, 1);
          remainingUpCount--;
          prefixId = AdfUIComponent._trimAbsoluteScopedId(prefixIds.join(":"), upCount);
          searchScopedId = prefixId + relativeSeatchString;
          foundComponent = AdfUIComponent._findAbsoluteComponent(searchScopedId);
        }
        idIndex--;
      }
    }
  }
  return foundComponent;
};
AdfUIComponent._findRelativeComponent = function(clientId, isNamingContainer, ncCount, searchClientId, separator, expr, skipDeprecation) {
  var poppedNcCount = 0;
  var component, index;
  var baseId = clientId;
  var numberPopped = 0;
  var lastBaseId = null;
  var lastSearched = false;
  if (!isNamingContainer) {
    index = baseId.lastIndexOf(separator);
    if (index == -1) {
      return AdfPage.PAGE.findComponent(searchClientId);
    }
    baseId = baseId.substring(0, index);
  }
  while (poppedNcCount <= ncCount) {
    if (numberPopped >= ncCount) {
      component = AdfPage.PAGE.findComponent(baseId + separator + searchClientId);
      if (component != null) {
        return component;
      }
      lastSearched = true;
    }
    index = baseId.lastIndexOf(separator);
    if (index == -1) {
      component = AdfPage.PAGE.findComponent(searchClientId);
      if (component == null) {
        lastBaseId = baseId;
        baseId = null;
        break;
      }
      return component;
    }
    component = AdfPage.PAGE.findComponent(baseId);
    if (component != null && AdfUIComponent.__isNamingContainer(component.constructor)) {
      ++poppedNcCount;
    }
    lastBaseId = baseId;
    baseId = baseId.substring(0, index);
    ++numberPopped;
  }
  if (!skipDeprecation) {
    if (!isNamingContainer && ncCount > 0 && lastBaseId != null && !lastSearched) {
      component = AdfPage.PAGE.findComponent(lastBaseId + separator + searchClientId);
      if (component != null) {
        AdfLogger.LOGGER.warning("Component found using deprecated relative find of excessive number colons. " + "Search string: " + expr);
        return component;
      }
    }
    if (ncCount == 0 && isNamingContainer) {
      index = clientId.lastIndexOf(separator);
      component = index == -1 ? AdfPage.PAGE.findComponent(searchClientId) : AdfPage.PAGE.findComponent(clientId.substring(0, index) + separator + searchClientId);
      if (component != null) {
        AdfLogger.LOGGER.warning("Component found using deprecated relative find using the parent component. " + "Search string: " + expr);
        return component;
      }
    }
  }
  return null;
};
AdfUIComponent._trimAbsoluteScopedId = function(absoluteScopedId, trimCount) {
  if (absoluteScopedId && !trimCount) {
    return absoluteScopedId + ":";
  }
  var currStartIndex = absoluteScopedId.length;
  while (trimCount--) {
    currStartIndex = absoluteScopedId.lastIndexOf(":", currStartIndex - 1);
    if (currStartIndex == -1) {
      if (trimCount) {
        AdfLogger.LOGGER.warning("Insufficient naming containers for expression:", absoluteScopedId);
      }
      return "";
    }
  }
  return absoluteScopedId.substring(0, currStartIndex + 1);
};
AdfUIComponent._findAbsoluteComponent = function(searchScopedId) {
  var thePage = AdfPage.PAGE;
  var matchComponent = thePage.findComponent(searchScopedId);
  if (matchComponent) {
    return matchComponent;
  }
  var callbackState = {matchScopedId:searchScopedId, matchComponent:null};
  var ancestorScopedId = searchScopedId;
  var fragmentStart = ancestorScopedId.lastIndexOf(":");
  while (fragmentStart != -1) {
    ancestorScopedId = ancestorScopedId.substring(0, fragmentStart);
    matchComponent = thePage.findComponent(ancestorScopedId);
    if (matchComponent) {
      matchComponent.visitChildren(AdfUIComponent._matchAbsoluteIdCallback, callbackState, false);
      return callbackState.matchComponent;
    }
    fragmentStart = ancestorScopedId.lastIndexOf(":");
  }
  return null;
};
AdfUIComponent.prototype.findComponentByLocator = function(locator) {
  return AdfUIComponent.__findComponentByLocator(locator, this);
};
AdfUIComponent.__findComponentByLocator = function(locator, component) {
  AdfAssert.assertNonEmptyString(locator);
  var thePage = AdfPage.PAGE;
  return thePage.findComponentByAbsoluteLocator(locator);
};
AdfUIComponent._matchAbsoluteIdCallback = function(component) {
  if (this.matchScopedId == component.getAbsoluteId()) {
    this.matchComponent = component;
    return 2;
  } else {
    return 0;
  }
};
AdfUIComponent.prototype.isShowing = function() {
  var parent = this.getParent();
  var parentShowing = parent ? parent.isShowing() : true;
  return parentShowing && this.getVisible();
};
AdfUIComponent.prototype.isEventRoot = function() {
  return false;
};
AdfUIComponent.prototype.queueEvent = function(event) {
  AdfAssert.assertPrototype(event, AdfBaseEvent);
  AdfPage.PAGE.queueEvent(event);
};
AdfUIComponent.prototype.broadcast = function(event) {
  AdfAssert.assertPrototype(event, AdfBaseEvent);
  var source = event.getSource();
  if (source == this) {
    if (event.getDoesBubbles()) {
      if (event.getEventPhase() == AdfBaseEvent.CAPTURING_PHASE) {
        event.nextEventPhase();
      }
      if (event.getEventPhase() == AdfBaseEvent.AT_TARGET_PHASE) {
        event.setCurrentTarget(source);
        this._deliverEvent(event);
        event.nextEventPhase();
      }
      if (event.getEventPhase() == AdfBaseEvent.BUBBLING_PHASE) {
        this._bubbleEvent(event);
      }
    } else {
      this._deliverEvent(event);
    }
    if (!event.isCanceled()) {
      var peer = this.getPeer();
      var postponed = false;
      if (peer) {
        postponed = peer.DispatchUncanceledComponentEvent(event);
      }
      if (!postponed && !event.isCanceled()) {
        this.HandleEvent(event);
      }
    }
  } else {
    var phase = event.getEventPhase();
    AdfAssert.assert(phase == AdfBaseEvent.BUBBLING_PHASE, "invalid event phase");
    if (phase == AdfBaseEvent.BUBBLING_PHASE) {
      this.HandleBubbledEvent(event);
      this._bubbleEvent(event);
    }
  }
};
AdfUIComponent.prototype.processPushData = function(payload, changeCount) {
  AdfAssert.assert(payload !== undefined);
  AdfAssert.assertNumber(changeCount);
  return this.getPeer().processPushData(this, payload, changeCount);
};
AdfUIComponent.prototype.registerADSAccessibility = function() {
  this.getPeer().registerADSAccessibility(this);
};
AdfUIComponent.prototype.clone = function(clientId) {
  AdfAssert.assert(clientId && clientId !== this._clientId);
  var props = new Object;
  AdfCollections.copyInto(props, this._props);
  var constructorName = this.getTypeName();
  var constructor = window[constructorName];
  var clone = new constructor(clientId, props, this._componentUsageFlags);
  return clone;
};
AdfUIComponent.prototype.resizeNotify = function(oldWidth, oldHeight, newWidth, newHeight) {
  var peer = this.getPeer();
  if (peer) {
    peer.resizeNotify(this, oldWidth, oldHeight, newWidth, newHeight);
  }
};
AdfUIComponent.prototype.scrollIntoView = function(focus, subTargetId) {
  var peer = this.getPeer();
  if (peer) {
    peer.scrollIntoView(this, focus, subTargetId);
  }
};
AdfUIComponent.prototype._deliverEvent = function(event) {
  AdfAssert.assertPrototype(event, AdfBaseEvent);
  var peer = this.getPeer();
  if (peer) {
    peer.DispatchComponentEvent(event);
  }
  var props = this._getClientListeners();
  if (props) {
    var listeners = props[event.getType()];
    if (listeners) {
      this._deliverEventToListeners(event, listeners);
    }
  }
};
AdfUIComponent.prototype._deliverEventToListeners = function(event, listeners) {
  AdfAssert.assertPrototype(event, AdfBaseEvent);
  if (listeners) {
    if (AdfCollections.isArray(listeners)) {
      var listenerCount = listeners.length;
      for (var i = 0;i < listenerCount;i++) {
        var value = listeners[i];
        var instance;
        var listener;
        if (typeof value == "function") {
          listener = value;
        } else {
          instance = value;
          i++;
          listener = listeners[i];
        }
        this._deliverEventToListener(event, instance, listener);
      }
    } else {
      this._deliverEventToListener(event, null, listeners);
    }
  }
};
AdfUIComponent.prototype._deliverEventToListener = function(event, instance, listener) {
  AdfAssert.assertPrototype(event, AdfBaseEvent);
  AdfAssert.assertObjectOrNull(instance);
  AdfAssert.assertFunction(listener);
  try {
    var result;
    if (instance == null) {
      result = listener(event);
    } else {
      result = listener.call(instance, event);
    }
    if (event instanceof AdfBeforeUnloadEvent) {
      if (event.getWarningMessage() === undefined) {
        if (result !== undefined) {
          event.setWarningMessage(result);
        } else {
          if (event.isCanceled()) {
            event.setWarningMessage("");
          }
        }
      }
    }
  } catch (e) {
    AdfLogger.LOGGER.logError(e, AdfLogger.WARNING, "Error delivering event:" + event + " to " + listener + " on instance " + instance);
  }
};
AdfUIComponent.prototype._getClientListeners = function() {
  return this._props["clientListeners"];
};
AdfUIComponent.prototype.HandleEvent = function(event) {
  AdfAssert.assert(!event.isCanceled());
  if (event.propagatesToServer()) {
    AdfPage.PAGE.queueEventToServer(event);
  }
};
AdfUIComponent.prototype.HandleBubbledEvent = function(event) {
  if (event.getRoot() === undefined && this.isEventRoot()) {
    event.setRoot(this);
  }
  var peer = this.getPeer();
  if (peer) {
    peer.DispatchComponentEvent(event);
  }
};
AdfUIComponent._initAccessors = function(ourClass, propertyNames, constantSuffix, accessorPrefix, mutatorPrefix) {
  if (!propertyNames) {
    return;
  }
  var constantCache = AdfUIComponent._CONSTANT_CACHE;
  var accessorNameCache = AdfUIComponent._ACCESSOR_NAME_CACHE;
  var accessorCache = AdfUIComponent._ACCESSOR_CACHE;
  var mutatorNameCache = AdfUIComponent._MUTATOR_NAME_CACHE;
  var mutatorCache = AdfUIComponent._MUTATOR_CACHE;
  var ourPrototype = ourClass.prototype;
  for (var currProperty in propertyNames) {
    var propertyConstant = constantSuffix ? currProperty + constantSuffix : currProperty;
    var constantName = constantCache[propertyConstant];
    if (!constantName) {
      constantName = AdfStrings.createConstantName(propertyConstant);
      constantCache[propertyConstant] = constantName;
    }
    ourPrototype[constantName] = currProperty;
    ourClass[constantName] = currProperty;
    var accessorName = accessorNameCache[propertyConstant];
    var accessorFunction = function anonymous() {
    };
    if (!accessorName) {
      accessorName = AdfUIComponent._createAccessorName(currProperty);
      accessorNameCache[propertyConstant] = accessorName;
      var accessorBody = accessorPrefix + "(this." + constantName + ");";
      accessorFunction = function anonymous(funcaccessorBody) {
        return function anonymous() {
          return this.getPropertyValue(this[funcaccessorBody.substring(funcaccessorBody.lastIndexOf(".") + 1, funcaccessorBody.indexOf(")"))]);
        };
      }(accessorBody);
      accessorCache[propertyConstant] = AdfUIComponent.prototype.cloneFunction(accessorFunction);
    } else {
      accessorFunction = accessorCache[propertyConstant];
      AdfAssert.assertFunction(accessorFunction);
    }
    ourPrototype[accessorName] = AdfUIComponent.prototype.cloneFunction(accessorFunction);
    var propertyKey = propertyNames[currProperty];
    if (!propertyKey[AdfUIComponent.PROPERTY_KEY_SECURED]) {
      var mutatorName = mutatorNameCache[propertyConstant];
      var mutatorFunction;
      if (!mutatorName) {
        mutatorName = AdfUIComponent._createMutatorName(currProperty);
        mutatorNameCache[propertyConstant] = mutatorName;
        var mutatorBody = mutatorPrefix + "(this." + constantName + ",v);";
        mutatorFunction = function anonymous(funcmutatorBody) {
          return function anonymous(v) {
            return this.setProperty(this[funcmutatorBody.substring(funcmutatorBody.lastIndexOf(".") + 1, funcmutatorBody.indexOf(","))], v);
          };
        }(mutatorBody);
        mutatorCache[propertyConstant] = AdfUIComponent.prototype.cloneFunction(mutatorFunction);
      } else {
        mutatorFunction = mutatorCache[propertyConstant];
        AdfAssert.assertFunction(mutatorFunction);
      }
      ourPrototype[mutatorName] = AdfUIComponent.prototype.cloneFunction(mutatorFunction);
    }
  }
};
AdfUIComponent.prototype.cloneFunction = function(func) {
  var that = func;
  var temp = function temporary() {
    return that.apply(this, arguments);
  };
  for (var key in func) {
    if (func.hasOwnProperty(key)) {
      temp[key] = func[key];
    }
  }
  return temp;
};
AdfUIComponent.InitClass = function() {
  AdfUIComponent.PROPERTY_KEY_DEFAULT = "default";
  AdfUIComponent.PROPERTY_KEY_SECURED = "secured";
  AdfUIComponent.PROPERTY_DISCONNECTED = "disconnected";
  AdfUIComponent.PROPAGATE_IF_KNOWN_PROPERTY = 0;
  AdfUIComponent.PROPAGATE_ALWAYS = 1;
  AdfUIComponent.PROPAGATE_NEVER = 2;
  AdfUIComponent.PROPAGATE_LOCALLY = 3;
  var subclassPropertyKeys = this.GetSubclassPropertyKeys();
  var superclass = this.superclass.constructor;
  var propertyKeys = superclass[AdfUIComponent._CLASS_PROPERTY_KEYS];
  if (subclassPropertyKeys) {
    AdfUIComponent._initAccessors(this, subclassPropertyKeys, null, "return this.getPropertyValue", "return this.setProperty");
    propertyKeys = propertyKeys ? AdfCollections.union(propertyKeys, subclassPropertyKeys) : subclassPropertyKeys;
  }
  this[AdfUIComponent._CLASS_PROPERTY_KEYS] = propertyKeys;
  var subclassInitializer = this["InitSubclass"];
  if (subclassInitializer != null) {
    subclassInitializer.call(this);
  }
};
AdfUIComponent.SetDisconnectedProperty = function(componentClass, propName) {
  AdfUIComponent._setPropertyInfo(componentClass, propName, AdfUIComponent.PROPERTY_DISCONNECTED, true);
};
AdfUIComponent.SetPropertyType = function(componentClass, propName, typeName) {
  AdfUIComponent._setPropertyInfo(componentClass, propName, "type", typeName);
};
AdfUIComponent._setPropertyInfo = function(componentClass, propName, metadataProp, metadataValue) {
  if (propName) {
    var propertyKeys = componentClass[AdfUIComponent._CLASS_PROPERTY_KEYS];
    var propertyMetadaData = propertyKeys[propName];
    if (propertyMetadaData) {
      var superclass = componentClass.superclass;
      if (superclass && propertyKeys === superclass[AdfUIComponent._CLASS_PROPERTY_KEYS]) {
        var newPropertyKeys = {};
        for (var oldMetadata in propertyKeys) {
          newPropertyKeys[oldMetadata] = propertyKeys[oldMetadata];
        }
        componentClass[AdfUIComponent._CLASS_PROPERTY_KEYS] = newPropertyKeys;
        propertyKeys = newPropertyKeys;
      }
      if (metadataValue != propertyMetadaData[metadataProp]) {
        var newPropertyMetaData = AdfCollections.copyInto({}, propertyMetadaData);
        newPropertyMetaData[metadataProp] = metadataValue;
        propertyKeys[propName] = newPropertyMetaData;
      }
    }
  }
};
AdfUIComponent.prototype.Init = function(componentType, clientId, properties, usageFlags) {
  AdfAssert.assertStringOrNull(componentType);
  AdfAssert.assertStringOrNull(clientId);
  AdfAssert.assertObjectOrNull(properties);
  AdfAssert.assertNumberOrNull(usageFlags);
  AdfUIComponent.superclass.Init.call(this);
  if (componentType != undefined) {
    this._componentType = componentType;
  }
  this._clientId = clientId;
  var behaviors;
  if (properties) {
    behaviors = properties[AdfUIComponent._BEHAVIORS_KEY];
  } else {
    properties = {};
  }
  this._props = properties;
  if (behaviors) {
    this._initBehaviors(behaviors);
  }
  if (usageFlags) {
    this._componentUsageFlags = usageFlags;
  }
};
AdfUIComponent.prototype.SetPropertyImpl = function(propName, oldValue, newValue) {
};
AdfUIComponent.prototype.DeliverDerivedPropertyEvents = function(propName, oldValue, newValue) {
};
AdfUIComponent.GetSubclassPropertyKeys = function() {
  return {"id":{"name":"id", "type":"String", "default":null, "secured":true, "disconnected":true}, "visible":{"name":"visible", "type":"Boolean", "default":true}, "styleClass":{"name":"styleClass", "type":"String", "default":null}, "inlineStyle":{"name":"inlineStyle", "type":"String", "default":null}};
};
AdfUIComponent.prototype.GetChanges = function() {
  var propChanges = this._propChanges;
  var props = this._props;
  var changes = new Object;
  var undefinedValue = AdfUIComponent._DEFAULT_VALUE_UNDEFINED;
  for (var propName in propChanges) {
    if (propChanges[propName]) {
      var propName1 = AdfUIComponent._removePersistedFlag(propName);
      var currValue = props[propName1];
      if (currValue === undefinedValue) {
        currValue = undefined;
      }
      changes[propName] = currValue;
    }
  }
  return changes;
};
AdfUIComponent.prototype.clearChanges = function() {
  this._propChanges = undefined;
};
AdfUIComponent.prototype.AddNotify = function() {
  if (!this._peer) {
    var thePage = AdfPage.PAGE;
    var peer = thePage.getLookAndFeel().getPeer(this);
    this._peer = peer;
    peer.initialize(this);
    if (this._dropTarget) {
      thePage.getDnDContext().__addComponentTarget(this);
    }
    if (peer.needsResizeNotify(this)) {
      thePage.registerResizeNotifyComponent(this);
    }
  }
};
AdfUIComponent.prototype.RemoveNotify = function() {
  var thePage = AdfPage.PAGE;
  thePage.removeChangedComponent(this);
  var clientId = this.getClientId();
  thePage.clearMessages(clientId);
  var activeComponentId = thePage.getActiveComponentId();
  if (clientId == activeComponentId) {
    thePage._setActiveComponentId(null);
  }
  var peer = this._peer;
  if (peer) {
    if (this._dropTarget) {
      thePage.getDnDContext().__removeComponentTarget(this);
    }
    if (this._dragSource) {
      thePage.getDnDContext().__removeDragSource(this);
      this._dragSource.__setComponent(null);
    }
    if (peer.needsResizeNotify(this)) {
      thePage.unregisterResizeNotifyComponent(this);
    }
    peer.componentRemoved(this);
    this._peer = null;
  }
  var behaviors = this.getBehaviors();
  if (behaviors) {
    this._destroyBehaviors(behaviors);
  }
  this._dead = true;
};
AdfUIComponent.prototype._bubbleEvent = function(event) {
  if (event.isBubblingStopped()) {
    return;
  }
  var currentTarget = event.getCurrentTarget();
  var parent = currentTarget.getParent();
  if (parent) {
    event.setCurrentTarget(parent);
    parent.broadcast(event);
  } else {
    AdfAgent.AGENT.showTooltip(event);
  }
};
AdfUIComponent.prototype._setSource = function(source) {
  this._source = source;
};
AdfUIComponent.prototype.getParent = function() {
  var parent = this._parent;
  if (parent === undefined) {
    var peer = this._peer;
    if (peer != null) {
      parent = peer.getComponentParent(this);
      this._parent = parent;
    }
  }
  return parent;
};
AdfUIComponent.prototype.getDescendantComponents = function(children) {
  return this.getPeer().getDescendantComponents(this, children);
};
AdfUIComponent.prototype.visitChildren = function(callback, context, ignoreHidden) {
  var peer = this._peer;
  if (peer != null) {
    peer.visitChildren(this, callback, context, ignoreHidden);
  }
  return 0;
};
AdfUIComponent.prototype.__setParent = function(newParent) {
  this._parent = newParent;
};
AdfUIComponent.prototype.isDescendant = function(possibleAncestor) {
  if (possibleAncestor) {
    var currParent = this.getParent();
    while (currParent) {
      if (currParent == possibleAncestor) {
        return true;
      }
      currParent = currParent.getParent();
    }
  }
  return false;
};
AdfUIComponent.prototype.focus = function() {
  var peer = this._peer;
  if (peer != null) {
    peer.focus(this);
  }
};
AdfUIComponent.prototype.getDragSource = function() {
  return this._dragSource;
};
AdfUIComponent.prototype.setDragSource = function(dragSource) {
  AdfAssert.assertPrototypeOrNull(dragSource, AdfDragSource);
  var oldDragSource = this._dragSource;
  if (oldDragSource) {
    oldDragSource.__setComponent(null);
  }
  this._dragSource = dragSource;
  if (dragSource) {
    dragSource.__setComponent(this);
  }
};
AdfUIComponent.prototype.getDropTarget = function() {
  return this._dropTarget;
};
AdfUIComponent.prototype.setDropTarget = function(dropTarget) {
  AdfAssert.assertPrototypeOrNull(dropTarget, AdfDropTarget);
  var oldDropTarget = this._dropTarget;
  if (dropTarget != oldDropTarget) {
    var dndContext = AdfPage.PAGE.getDnDContext();
    if (oldDropTarget) {
      oldDropTarget.__setComponent(null);
      if (this._peer) {
        dndContext.__removeComponentTarget(this);
      }
    }
    this._dropTarget = dropTarget;
    if (dropTarget) {
      dropTarget.__setComponent(this);
      if (this._peer) {
        dndContext.__addComponentTarget(this);
      }
    }
  }
};
AdfUIComponent.prototype.getBehaviors = function(filterCriteria) {
  var behaviors = this._props ? this._props[AdfUIComponent._BEHAVIORS_KEY] : null;
  if (behaviors && filterCriteria) {
    if (behaviors instanceof filterCriteria) {
      return behaviors;
    } else {
      if (behaviors instanceof Array) {
        var filteredBehaviors = [];
        for (var i = 0, length = behaviors.length;i < length;i++) {
          if (behaviors[i] instanceof filterCriteria) {
            filteredBehaviors.push(behaviors[i]);
          }
        }
        if (filteredBehaviors.length == 0) {
          return null;
        } else {
          if (filteredBehaviors.length == 1) {
            return filteredBehaviors[0];
          } else {
            return filteredBehaviors;
          }
        }
      }
    }
    return null;
  }
  return behaviors;
};
AdfUIComponent.prototype.toDebugString = function() {
  var baseString = this.getTypeName() + " [" + this.getComponentType() + "]";
  var id = this.getClientId();
  if (id) {
    baseString += " id\x3d" + id;
  }
  if (this._dead) {
    baseString += " , DEAD!";
  }
  return baseString;
};
AdfUIComponent.prototype.isDead = function() {
  return this._dead;
};
AdfUIComponent.prototype.getPeer = function() {
  return this._peer;
};
AdfUIComponent.prototype.getEventRoots = function(event) {
  return this._getEventRoots(event);
};
AdfUIComponent.prototype._getEventRoots = function(event) {
  AdfAssert.assertPrototype(event, AdfBaseEvent);
  var eventType = event.getType();
  var eventSource = event.getSource();
  var eventRoots = new Array;
  var targetList = this.getProperty(AdfUIComponent._TARGETS_KEY);
  var defaultEventRoot = this.getDefaultEventRoot(event);
  if (targetList && targetList.length > 0) {
    var executeScopedIdSet = new Object;
    for (var index = 0;index < targetList.length;index++) {
      var target = targetList[index];
      if (target) {
        if (target.events) {
          for (var i = 0;i < target.events.length;i++) {
            var currEvent = target.events[i];
            if (currEvent != null && currEvent == eventType || currEvent == AdfUIComponent._TARGET_KEYWORD_ALL) {
              for (var j = 0;j < target.execute.length;j++) {
                var scopedId = target.execute[j];
                executeScopedIdSet[scopedId] = scopedId;
              }
              break;
            }
          }
        }
      }
    }
    if (executeScopedIdSet[AdfUIComponent._TARGET_KEYWORD_ALL]) {
      var documentClientId = AdfPage.PAGE.getDocumentClientId();
      if (documentClientId) {
        rootComponent = this.findComponent(documentClientId);
        eventRoots.push(rootComponent);
        return eventRoots;
      } else {
        var rootComponent = eventSource;
        while (rootComponent) {
          if (rootComponent instanceof AdfRichForm) {
            eventRoots.push(rootComponent);
            return eventRoots;
          }
          rootComponent = rootComponent.getParent();
        }
        AdfLogger.LOGGER.warning("AdfUIComponent.getEventRoots: No form found when processing @all");
      }
    }
    var component = null;
    for (var scopedId in executeScopedIdSet) {
      if (scopedId == AdfUIComponent._TARGET_KEYWORD_THIS) {
        component = this;
      } else {
        if (scopedId == AdfUIComponent._TARGET_KEYWORD_DEFAULT) {
          component = defaultEventRoot;
        } else {
          if (scopedId == AdfUIComponent._TARGET_KEYWORD_NONE) {
            var eventCompClientId = eventSource ? eventSource.getClientId() : "null";
            AdfLogger.LOGGER.warning("AdfUIComponent.getEventRoots: An unsupported keyword @none was specified in the execute " + "attribute of the target tag for the component ", eventCompClientId, ". Please use one of the supported keywords " + "or refer to the documentation for details.");
          } else {
            component = eventSource.findComponent(scopedId, true);
            if (!component) {
              AdfLogger.LOGGER.warning("AdfUIComponent.getEventRoots: Unable to retrieve component with scoped Id ", scopedId, " relative to this component" + this.getClientId());
            }
          }
        }
      }
      if (component) {
        eventRoots.push(component);
      }
    }
  } else {
    eventRoots.push(defaultEventRoot);
  }
  return eventRoots;
};
AdfUIComponent.prototype.getDefaultEventRoot = function(event) {
  AdfAssert.assertPrototype(event, AdfBaseEvent);
  var eventRoot = null;
  var rootSetByEvent = event.getRoot();
  if (rootSetByEvent) {
    eventRoot = rootSetByEvent;
  } else {
    var possibleEventRoot = event.getSource();
    while (!(possibleEventRoot instanceof AdfRichForm || possibleEventRoot.isEventRoot())) {
      possibleEventRoot = possibleEventRoot.getParent();
      if (!possibleEventRoot) {
        AdfLogger.LOGGER.severe("AdfUIComponent.getDefaultEventRoot: No form found");
        return null;
      }
    }
    eventRoot = possibleEventRoot;
  }
  return eventRoot;
};
AdfUIComponent.prototype.ComparePropertyValues = function(propName, oldValue, newValue) {
  var equal = newValue === oldValue;
  if (!equal && newValue != null && oldValue != null) {
    var keys = this.getPropertyKeys();
    var propKey = keys[propName];
    if (propKey != null) {
      var propType = propKey.type;
      if (propType == "Array") {
        equal = AdfUIUtils.compareArrays(oldValue, newValue);
      } else {
        if (AdfObject.prototype.isPrototypeOf(oldValue) && AdfObject.prototype.isPrototypeOf(newValue)) {
          equal = newValue.equals(oldValue);
        } else {
          if (propType == "Object") {
            if (Object.prototype.isPrototypeOf(oldValue) && Object.prototype.isPrototypeOf(newValue)) {
              equal = AdfUIUtils.compareObjects(oldValue, newValue);
            }
          } else {
            if (propType == "Date") {
              equal = oldValue.getTime() == newValue.getTime();
            }
          }
        }
      }
    }
  }
  return equal;
};
AdfUIComponent.prototype._initBehaviors = function(behaviors) {
  AdfAssert.assert(behaviors != null);
  if (AdfCollections.isArray(behaviors)) {
    var length = behaviors.length;
    for (var i = 0;i < length;i++) {
      var behavior = behaviors[i];
      AdfAssert.assertFunction(behavior.initialize, "Missing client behvavior initialize()");
      behavior.initialize(this);
    }
  } else {
    AdfAssert.assertFunction(behaviors.initialize, "Missing client behvavior initialize()");
    behaviors.initialize(this);
  }
};
AdfUIComponent.prototype._destroyBehaviors = function(behaviors) {
  if (behaviors instanceof AdfClientBehavior) {
    behaviors.destroy();
  } else {
    for (var i = 0, len = behaviors.length;i < len;i++) {
      behaviors[i].destroy();
    }
  }
};
AdfUIComponent._createAccessorName = function(propertyName) {
  return "get" + AdfStrings.initUpperCase(propertyName);
};
AdfUIComponent._createMutatorName = function(propertyName, constantName) {
  return "set" + AdfStrings.initUpperCase(propertyName);
};
AdfUIComponent._removePersistedFlag = function(propertyName) {
  var suffixPosition = propertyName.length - 2;
  if (propertyName.lastIndexOf(AdfUIComponent._FLAG_PERSISTENCE) == suffixPosition) {
    return propertyName.substr(0, suffixPosition);
  }
  return propertyName;
};
AdfUIComponent.__isNamingContainer = function(constructorFunction) {
  return true === constructorFunction._namingContainer;
};
AdfUIComponent.__setNamingContainer = function(constructorFunction, isNC) {
  constructorFunction._namingContainer = isNC;
};
AdfUIComponent.prototype.simulateMouse = function(subId, mouseEvent) {
  this.getPeer().simulateMouse(this, subId, mouseEvent);
};
AdfUIComponent._DEFAULT_VALUE_UNDEFINED = new Object;
AdfUIComponent._CLASS_PROPERTY_KEYS = "_propertyKeys";
AdfUIComponent._FLAG_PERSISTENCE = "|p";
AdfUIComponent._CONSTANT_CACHE = new Object;
AdfUIComponent._ACCESSOR_CACHE = new Object;
AdfUIComponent._MUTATOR_CACHE = new Object;
AdfUIComponent._ADD_LISTENER_CACHE = new Object;
AdfUIComponent._REMOVE_LISTENER_CACHE = new Object;
AdfUIComponent._ACCESSOR_NAME_CACHE = new Object;
AdfUIComponent._MUTATOR_NAME_CACHE = new Object;
AdfUIComponent._ADD_LISTENER_NAME_CACHE = new Object;
AdfUIComponent._REMOVE_LISTENER_NAME_CACHE = new Object;
AdfUIComponent._BEHAVIORS_KEY = "behaviors";
AdfUIComponent._TARGETS_KEY = "targets";
AdfUIComponent._TARGET_KEYWORD_ALL = "@all";
AdfUIComponent._TARGET_KEYWORD_THIS = "@this";
AdfUIComponent._TARGET_KEYWORD_DEFAULT = "@default";
AdfUIComponent._TARGET_KEYWORD_NONE = "@none";
