AdfRichUIPeer.createPeerClass(AdfDhtmlValuePeer, "AdfDhtmlEditableValuePeer");
AdfDhtmlEditableValuePeer.InitSubclass = function() {
  this._CONTENT_ID = "content";
  this._CONTENT_ID_ATTR_NAME = "__afrEditableValueContentId";
  this._NOTE_WINDOW_POPUP_ID = "_afNoteWindowPopup";
  this._INSTRUCTIONS_TEXT = "_afrInstructionsText";
  this._HELPICON_ID = "_afrHelpIcon";
  this._INITIALIZED = "_adfInitialized";
  this._NOTE_WINDOW_SEPARATOR_STYLE_CLASS = "AFNoteWindowSeparator";
  this._NOTE_WINDOW_HINT_TEXT_STYLE_CLASS = "AFNoteWindowHintText";
  this._NOTE_WINDOW_INSTRUCTIONS_STYLE_CLASS = "AFNoteWindowInstructions";
  this._NOTE_WINDOW_SHORT_DESC_STYLE_CLASS = "AFNoteWindowShortDesc";
  this._NOTE_WINDOW_FOOTER_STYLE_CLASS = "AFNoteWindowFooter";
  this._NOTE_WINDOW_MAX_WIDTH = 340;
  this._OLD_VALUE_EXPANDO = "_afOV";
  this._INIT_VALUE_EXPANDO = "data-afr-init-value";
  this._LAST_SUBMITTED_VALUE_EXPANDO = "data-afr-last-submitted-value";
  this._MARK_DIRTY = "data-afr-mark-dirty";
  AdfDhtmlEditableValuePeer._HIDE_NOTE_SCHEDULED = "hideNoteScheduled";
  AdfDhtmlEditableValuePeer._LAST_VALIDATE_TIME = "lastValidateTime";
  AdfRichUIPeer.addSuppressedPPRAttributes(this, AdfDhtmlEditableValuePeer._LAST_VALIDATE_TIME);
  AdfRichUIPeer.addSuppressedPPRAttributes(this, AdfDhtmlEditableValuePeer._HIDE_NOTE_SCHEDULED);
  AdfRichUIPeer.addComponentPropertyChanges(this, "showRequired");
  AdfRichUIPeer.addComponentPropertyGetters(this, AdfUIValue.VALUE);
  AdfRichUIPeer.addComponentEventHandlers(this, AdfUIInputEvent.FOCUS_EVENT_TYPE, AdfUIInputEvent.CLICK_EVENT_TYPE, AdfUIInputEvent.KEY_UP_EVENT_TYPE);
};
AdfDhtmlEditableValuePeer.prototype.InitDomElement = function(component, domElement) {
  AdfDhtmlEditableValuePeer.superclass.InitDomElement.call(this, component, domElement);
  var page = AdfPage.PAGE;
  if (this._needsSpuriousDirtyValueTracking(page)) {
    this._stashInitValue(component, domElement);
  }
  if (AdfDhtmlEditableValuePeer._noteWindowDismissTimout == undefined) {
    var timeout = lookAndFeel.getSkinProperty("af|document-tr-hint-display-timeout");
    AdfDhtmlEditableValuePeer._noteWindowDismissTimout = parseInt(timeout);
    if (isNaN(AdfDhtmlEditableValuePeer._noteWindowDismissTimout)) {
      AdfDhtmlEditableValuePeer._noteWindowDismissTimout = 0;
    }
  }
};
AdfDhtmlEditableValuePeer.prototype.autoSubmit = function(component) {
  AdfAutoSubmitEvent.queue(component);
};
AdfDhtmlEditableValuePeer.prototype.disableBrowserAutoComplete = function(component) {
  var contentNode = AdfDhtmlEditableValuePeer.getContentNode(component);
  if (contentNode && contentNode.tagName == "INPUT" && contentNode.getAttribute("type") == "text") {
    contentNode.setAttribute("AUTOCOMPLETE", "off");
  }
};
AdfDhtmlEditableValuePeer.prototype.BindToComponent = function(component, domElement) {
  AdfDhtmlEditableValuePeer.superclass.BindToComponent.call(this, component, domElement);
  var isInitialized = this.IsInitialized(component, domElement);
  if (!isInitialized) {
    this.LazyInitialize(component, domElement);
    var agent = AdfAgent.AGENT;
    agent.setExpandoProperty(domElement, AdfDhtmlEditableValuePeer._INITIALIZED, "init");
  }
};
AdfDhtmlEditableValuePeer.prototype.IsInitialized = function(component, domElement) {
  var agent = AdfAgent.AGENT;
  var isInitialized = agent.getExpandoProperty(domElement, AdfDhtmlEditableValuePeer._INITIALIZED);
  if (!isInitialized) {
    return false;
  }
  return true;
};
AdfDhtmlEditableValuePeer.prototype.Validate = function(component, submittedValue) {
  AdfSubmittedValueChangedEvent.queue(component, submittedValue);
  AdfPage.PAGE.clearMessages(component.getClientId());
  component.validate(submittedValue);
  component.setProperty(AdfDhtmlEditableValuePeer._LAST_VALIDATE_TIME, (new Date).getTime());
};
AdfDhtmlEditableValuePeer.prototype.setLastSubmittedValue = function(component, submittedValue) {
  var rootNode = AdfRichUIPeer.getDomElementForComponent(component);
  AdfAgent.AGENT.setExpandoProperty(rootNode, AdfDhtmlEditableValuePeer._LAST_SUBMITTED_VALUE_EXPANDO, submittedValue);
};
AdfDhtmlEditableValuePeer.prototype.getLastSubmittedValue = function(component) {
  var rootNode = AdfRichUIPeer.getDomElementForComponent(component);
  return AdfAgent.AGENT.getExpandoProperty(rootNode, AdfDhtmlEditableValuePeer._LAST_SUBMITTED_VALUE_EXPANDO);
};
AdfDhtmlEditableValuePeer.prototype.setMarkDirtyFlag = function(flag) {
  var rootNode = this.getDomElement();
  AdfAgent.AGENT.setExpandoProperty(rootNode, AdfDhtmlEditableValuePeer._MARK_DIRTY, flag);
};
AdfDhtmlEditableValuePeer.prototype.getMarkDirtyFlag = function() {
  var rootNode = this.getDomElement();
  return AdfAgent.AGENT.getExpandoProperty(rootNode, AdfDhtmlEditableValuePeer._MARK_DIRTY);
};
AdfDhtmlEditableValuePeer.prototype.GetValidatorHints = function(component) {
  if (component.getValidators) {
    var validators = component.getValidators();
    if (validators != null) {
      var allHints = new Array;
      var converter = component.getConverter();
      for (var i = 0;i < validators.length;i++) {
        var validator = validators[i];
        if (validator.getHints) {
          var hints = validator.getHints(converter);
          if (hints) {
            for (var j = 0;j < hints.length;j++) {
              allHints.push(hints[j]);
            }
          }
        }
      }
      if (allHints.length == 0) {
        allHints = null;
      }
      return allHints;
    }
  }
  return null;
};
AdfDhtmlEditableValuePeer.GetContentNodeId = function(component, rootNode) {
  AdfAssert.assert(component != null);
  if (!rootNode) {
    rootNode = AdfRichUIPeer.getDomElementForComponent(component);
  }
  AdfAssert.assert(rootNode != null);
  var id = AdfAgent.AGENT.getExpandoProperty(rootNode, AdfDhtmlEditableValuePeer._CONTENT_ID_ATTR_NAME);
  if (id == null) {
    var subid = AdfRichUIPeer.CreateSubId(component.getClientId(), AdfDhtmlEditableValuePeer._CONTENT_ID);
    var contentNode = AdfAgent.AGENT.getElementById(subid);
    if (!contentNode || contentNode.id == null) {
      contentNode = rootNode;
    }
    var contentNodeId = contentNode.id;
    AdfAssert.assert(contentNodeId != null);
    AdfAgent.AGENT.setExpandoProperty(rootNode, AdfDhtmlEditableValuePeer._CONTENT_ID_ATTR_NAME, contentNodeId);
    return contentNodeId;
  }
  return id;
};
AdfDhtmlEditableValuePeer.GetContentNode = function(component, rootNode) {
  AdfLogger.LOGGER.warning("Deprecated usage of AdfDhtmlEditableValuePeer.GetContentNode");
  return AdfDhtmlEditableValuePeer.getContentNode(component, rootNode);
};
AdfDhtmlEditableValuePeer.getContentNode = function(component, rootNode) {
  AdfAssert.assert(component != null);
  var id = AdfDhtmlEditableValuePeer.GetContentNodeId(component, rootNode);
  if (id) {
    var content = AdfAgent.AGENT.getElementById(id);
    if (content) {
      return content;
    }
  }
  return rootNode;
};
AdfDhtmlEditableValuePeer.getContentNodeText = function(component, domElement) {
  var contentNode = AdfDhtmlEditableValuePeer.getContentNode(component, domElement);
  return component.getReadOnly() ? contentNode.textContent : contentNode.value;
};
AdfDhtmlEditableValuePeer.__restoreDisplayValue = function(component, peer, restoredValue) {
  var validateFunc = peer.Validate;
  if (validateFunc) {
    var domElement = AdfDhtmlEditableValuePeer.getContentNode(component, null);
    peer.bind(component);
    peer.SetDisplayValue(component, domElement, restoredValue);
    validateFunc.call(peer, component);
  } else {
    component.SetDisplayValue(restoredValue);
    component.validate();
  }
};
AdfDhtmlEditableValuePeer.GetLabelElement = function(contentNode) {
  var labelElem;
  if (contentNode.labels) {
    labelElem = contentNode.labels[0];
  } else {
    labelElem = document.querySelector("label[for\x3d'" + contentNode.id + "']");
  }
  if (!labelElem && contentNode.parentElement.tagName == "LABEL") {
    labelElem = contentNode.parentElement;
  }
  return labelElem;
};
AdfDhtmlEditableValuePeer.GetLabelText = function(component) {
  var label = component.getLabel();
  if (label) {
    return label;
  }
  var contentNode = AdfDhtmlEditableValuePeer.getContentNode(component);
  var labelElem = AdfDhtmlEditableValuePeer.GetLabelElement(contentNode);
  if (labelElem) {
    return labelElem.textContent;
  }
};
AdfDhtmlEditableValuePeer.prototype.ShowNoteWindowMouseOver = function(componentEvent) {
  var page = AdfPage.PAGE;
  if (this.IsNoteWindowVisible()) {
    return;
  }
  var component = this.getComponent();
  var clientId = component.getClientId();
  if (this._noteCompMouseId && this._noteCompMouseId != clientId) {
    this._killNoteWindowMouseTimeout();
  }
  var isInsideContentDom = AdfDomUtils.isAncestorOrSelf(AdfDhtmlEditableValuePeer.getContentNode(component), componentEvent.getNativeEventTarget());
  if (this._noteWindowFocusTimeout == null && this._noteWindowMouseTimeout == null && isInsideContentDom) {
    this._noteCompMouseId = clientId;
    this._noteWindowMouseTimeout = page.scheduleTimer(this, this._onMouseOverTimeout, component.getClientId(), 500);
  } else {
    if (this._noteWindowMouseTimeout != null && this._noteWindowFocusTimeout == null && !isInsideContentDom) {
      this._killNoteWindowMouseTimeout();
    }
  }
};
AdfDhtmlEditableValuePeer.prototype.HandleComponentClick = function(componentEvent) {
};
AdfDhtmlEditableValuePeer.prototype.HandleComponentFocus = function(componentEvent) {
  var eventPhase = componentEvent.getEventPhase();
  var component = this.getComponent();
  if (eventPhase == AdfBaseEvent.AT_TARGET_PHASE || eventPhase == AdfBaseEvent.BUBBLING_PHASE && component == this._getPublicComponentOrAncestor(componentEvent.getSource())) {
    var page = AdfPage.PAGE;
    if (this._noteCompFocusId && this._noteCompFocusId != component.getClientId()) {
      this._killNoteWindowTimeout();
    }
    if (this.IsNoteWindowVisible()) {
      this.ShowNoteWindow();
    } else {
      if (this._noteWindowFocusTimeout == null) {
        this._killNoteWindowMouseTimeout();
        this._noteCompFocusId = component.getClientId();
        this._noteWindowFocusTimeout = page.scheduleTimer(this, this._onFocusTimeout, component.getClientId(), 400);
      }
    }
  }
};
AdfDhtmlEditableValuePeer.prototype.ComponentChanged = function(componentEvent) {
  if (!componentEvent.getPreviousComponent) {
    return;
  }
  var prevComponent = componentEvent.getPreviousComponent();
  var component = componentEvent.getNextComponent();
  if (!prevComponent) {
    return component != null;
  }
  if (!component) {
    return true;
  }
  return prevComponent.getClientId() != component.getClientId();
};
AdfDhtmlEditableValuePeer.prototype.VetoShowNoteWindow = function(component) {
  var domElement = this.getDomElement();
  return !AdfPage.PAGE.getModalityManager().isAboveTopGlassPane(domElement);
};
AdfDhtmlEditableValuePeer.prototype.HandleComponentKeyUp = function(componentEvent) {
  if (this._shouldScheduleNoteWindowAutoDismissal()) {
    this.getComponent().setProperty(AdfDhtmlEditableValuePeer._HIDE_NOTE_SCHEDULED, true);
    var params = {"comp":this.getComponent(), "time":(new Date).getTime()};
    page.scheduleTimer(this, this._hideNoteTimeoutCallback, params, AdfDhtmlEditableValuePeer._noteWindowDismissTimout);
  }
};
AdfDhtmlEditableValuePeer.prototype.ShowNoteWindow = function(component, isMouseOver) {
  this._killNoteWindowTimeout();
  if (!component) {
    component = this.getComponent();
  }
  if (!this.IsNoteWindowVisible(component)) {
    if (!component.getDisabled() && !component.getReadOnly() && !this.VetoShowNoteWindow(component)) {
      var domElement = AdfRichUIPeer.getDomElementForComponent(component);
      if (domElement) {
        var agent = AdfAgent.AGENT;
        var id = component.getClientId();
        var page = AdfPage.PAGE;
        var doc = page.getDomDocument();
        var popupContent = [];
        var converterHint = null;
        var validatorHints = null;
        if (this.ShouldShowHint(component, domElement) == true) {
          if (page.shouldShowHintInNoteTip()) {
            converterHint = this.getFormatHint(component);
          }
          validatorHints = this.GetValidatorHints(component);
        }
        var hasMessagePopupContent = AdfMessageUtils.hasMessagePopupContent(id);
        if (hasMessagePopupContent) {
          var inlineMessageDom = AdfMessageUtils.getComponentMessagePopupDom(id);
          popupContent.push(inlineMessageDom);
        }
        if (converterHint != null || validatorHints != null) {
          var hDom = doc.createElement("div");
          AdfDomUtils.addCSSClassName(hDom, AdfDhtmlEditableValuePeer._NOTE_WINDOW_HINT_TEXT_STYLE_CLASS);
          if (converterHint != null) {
            hDom.appendChild(AdfDhtmlNoteWindowPopupSelector.createTextDom(converterHint));
          }
          if (validatorHints != null) {
            for (var i = 0;i < validatorHints.length;i++) {
              hDom.appendChild(AdfDhtmlNoteWindowPopupSelector.createTextDom(validatorHints[i]));
            }
          }
          popupContent.push(hDom);
        }
        var instructions = domElement.getAttribute(AdfDhtmlEditableValuePeer._INSTRUCTIONS_TEXT);
        if (instructions != null) {
          var instructionsElem = doc.createElement("div");
          AdfDomUtils.addCSSClassName(instructionsElem, AdfDhtmlEditableValuePeer._NOTE_WINDOW_INSTRUCTIONS_STYLE_CLASS);
          instructionsElem.appendChild(AdfDhtmlNoteWindowPopupSelector.createTextDom(instructions));
          popupContent.push(instructionsElem);
        }
        var shortDesc = component.getShortDesc();
        if (shortDesc != null && AdfStrings.trim(shortDesc).length > 0) {
          var divElem = doc.createElement("div");
          AdfDomUtils.addCSSClassName(divElem, AdfDhtmlEditableValuePeer._NOTE_WINDOW_SHORT_DESC_STYLE_CLASS);
          agent.setTextContent(divElem, shortDesc);
          popupContent.push(divElem);
        }
        if (hasMessagePopupContent) {
          var footerMessageDom = AdfMessageUtils.getComponentMessagePopupFooterDom(id);
          if (footerMessageDom) {
            var lastElem = doc.createElement("div");
            AdfDomUtils.addCSSClassName(lastElem, AdfDhtmlEditableValuePeer._NOTE_WINDOW_FOOTER_STYLE_CLASS);
            var lastPushed = popupContent.pop();
            lastElem.appendChild(lastPushed);
            lastElem.appendChild(footerMessageDom);
            popupContent.push(lastElem);
          }
        }
        if (!AdfCollections.isEmpty(popupContent)) {
          var popupHints = {};
          popupHints[AdfDhtmlPopupHints.TYPE] = AdfDhtmlPopupHints.TYPE_NOTEWINDOW;
          popupHints[AdfRichPopup.HINT_ALIGN] = this.GetNoteWindowAlignmentHint();
          var alignElementId;
          var alignElement = this.GetNoteWindowAlignmentNode(component);
          if (alignElement != null) {
            var alignElementStyle = agent.getComputedStyle(alignElement);
            if (alignElementStyle.display != "none" && alignElementStyle.visibility != "hidden") {
              alignElementId = alignElement.id;
              if (alignElementId != null) {
                popupHints[AdfRichPopup.HINT_ALIGN_ID] = alignElementId;
              }
            }
          }
          if (alignElementId == null || alignElementId == "") {
            alignElement = AdfRichUIPeer.getDomElementForComponent(component);
            alignElementId = alignElement.id;
            if (alignElementId == null || alignElementId == "") {
              AdfLogger.LOGGER.warning("No popup alignment node ID could be found for the component with client ID \x3d ", id);
            } else {
              popupHints[AdfRichPopup.HINT_ALIGN_ID] = alignElementId;
            }
          }
          var noteDom;
          if (AdfCollections.isArray(popupContent)) {
            var newDom = doc.createElement("div");
            for (var i = 0;i < popupContent.length;i++) {
              if (i > 0) {
                var separator = doc.createElement("hr");
                AdfDomUtils.addCSSClassName(separator, AdfDhtmlEditableValuePeer._NOTE_WINDOW_SEPARATOR_STYLE_CLASS);
                newDom.appendChild(separator);
              }
              if (typeof popupContent[i] == "string") {
                newDom.appendChild(AdfDhtmlNoteWindowPopupSelector.createTextDom(popupContent[i]));
              } else {
                AdfAssert.assertDomElement(popupContent[i]);
                newDom.appendChild(popupContent[i]);
              }
            }
            noteDom = newDom;
          } else {
            if (typeof popupContent == "string") {
              noteDom = AdfDhtmlNoteWindowPopupSelector.createTextDom(popupContent);
            }
          }
          popupHints[AdfRichPopup.HINT_LAUNCH_ID] = id;
          popupHints[AdfDhtmlPopupHints.FOCUS] = false;
          popupHints[AdfDhtmlPopupHints.AUTODISMISS] = isMouseOver ? AdfDhtmlPopupHints.AUTODISMISS_MOUSEOUT : AdfDhtmlPopupHints.AUTODISMISS_MENU;
          if (isMouseOver) {
            popupHints[AdfDhtmlPopupHints.AUTODISMISS_MOUSEOUT_ID] = alignElement.id;
          }
          popupHints[AdfDhtmlPopupHints.MAX_WIDTH] = AdfDhtmlEditableValuePeer._NOTE_WINDOW_MAX_WIDTH;
          this.showPopup(component, noteDom, popupHints, AdfDhtmlEditableValuePeer._NOTE_WINDOW_POPUP_ID);
        }
      }
    }
  } else {
    if (!isMouseOver) {
      var hints = {};
      hints[AdfDhtmlPopupHints.AUTODISMISS] = AdfDhtmlPopupHints.AUTODISMISS_MENU;
      AdfPage.PAGE.getAutoDismissalManager().changeBehavior(component, hints);
    }
  }
};
AdfDhtmlEditableValuePeer.prototype.HideNoteWindow = function(component, ignoreNoteWindowTimeouts) {
  if (!component) {
    component = this.getComponent();
  }
  if (!ignoreNoteWindowTimeouts) {
    this._killNoteWindowTimeout();
  }
  this.hidePopup(component, AdfDhtmlEditableValuePeer._NOTE_WINDOW_POPUP_ID);
};
AdfDhtmlEditableValuePeer.prototype.IsNoteWindowVisible = function(component) {
  if (!component) {
    component = this.getComponent();
  }
  if (this.isPopupVisible(component, AdfDhtmlEditableValuePeer._NOTE_WINDOW_POPUP_ID)) {
    return true;
  }
  return false;
};
AdfDhtmlEditableValuePeer.prototype.GetNoteWindowAlignmentHint = function() {
  return AdfRichPopup.ALIGN_BEFORE_AFTER;
};
AdfDhtmlEditableValuePeer.prototype.GetNoteWindowAlignmentNode = function(component, rootNode) {
  return AdfDhtmlEditableValuePeer.getContentNode(component, rootNode);
};
AdfDhtmlEditableValuePeer.prototype.GetComponentValue = function(component, domElement) {
  var isValid = component.getValid();
  if (isValid == true) {
    return AdfDhtmlEditableValuePeer.superclass.GetComponentValue.call(this, component, domElement);
  }
  return null;
};
AdfDhtmlEditableValuePeer.prototype.ComponentSubmittedValueChanged = function(component, domElement, newValue, oldValue) {
  if (newValue == null) {
    newValue = this.GetNullDefault();
  }
  this.SetDisplayValue(component, domElement, newValue);
};
AdfDhtmlEditableValuePeer.prototype.GetComponentLabel = function(component, domElement) {
  var labelElement = null;
  var parComp = component.getParent();
  if (parComp && parComp.getComponentType() == "oracle.adf.RichPanelLabelAndMessage") {
    var parentPeer = parComp.getPeer();
    parentPeer.bind(parComp);
    var contentSubId = component.getId() + "::" + AdfDhtmlEditableValuePeer._CONTENT_ID;
    labelElement = AdfDomUtils.getChildElementByAttributeValue(parentPeer.getDomElement(), "for", contentSubId, "LABEL");
  }
  if (labelElement == null) {
    var labelElements = domElement.getElementsByTagName("LABEL");
    labelElement = labelElements.length ? labelElements[0] : null;
  }
  if (labelElement != null) {
    return AdfAgent.AGENT.getTextContent(labelElement);
  } else {
    return null;
  }
};
AdfDhtmlEditableValuePeer.__componentLabelChanged = function(component, domElement, newValue, oldValue) {
  if (oldValue != null) {
    var labelElement = AdfDomUtils.getFirstDescendentElement(domElement, "LABEL");
    if (labelElement) {
      return AdfDomUtils.handleTextChangeWithAccessKey(component, labelElement, newValue);
    }
  }
  return false;
};
AdfDhtmlEditableValuePeer.prototype.ComponentLabelChanged = AdfDhtmlEditableValuePeer.__componentLabelChanged;
AdfDhtmlEditableValuePeer.prototype.GetDisplayValue = function(component, domElement, unconditional) {
  if (unconditional) {
    return this.GetSubmittedValue(component, domElement);
  }
  return this.GetComponentSubmittedValue(component, domElement);
};
AdfDhtmlEditableValuePeer.prototype.GetComponentSubmittedValue = function(component, domElement) {
  if (!this.WasSubmitted(component)) {
    return null;
  } else {
    return this.GetSubmittedValue(component, domElement);
  }
};
AdfDhtmlEditableValuePeer.prototype.WasSubmitted = function(component) {
  return !(component.getDisabled && component.getDisabled() || component.getReadOnly && component.getReadOnly());
};
AdfDhtmlEditableValuePeer.prototype.GetSubmittedValue = function(component, domElement) {
  AdfAssert.failedInAbstractFunction();
};
AdfDhtmlEditableValuePeer.prototype.MessageNotify = function(maxType, messages) {
  AdfDhtmlEditableValuePeer.superclass.MessageNotify.call(this, maxType, messages);
  var page = AdfPage.PAGE;
  var component = this.getComponent();
  if (component) {
    page.scheduleTimer(this, this._addMessageTimeout, component.getClientId(), 300);
  }
};
AdfDhtmlEditableValuePeer.prototype.MessageShow = function(maxType, messages) {
  AdfDhtmlEditableValuePeer.superclass.MessageShow.call(this, maxType, messages);
  this.getComponent().focus();
};
AdfDhtmlEditableValuePeer.prototype.ShouldShowHint = function(component, domElement) {
  return false;
};
AdfDhtmlEditableValuePeer.prototype.Focus = function() {
  var rootDom = this.getDomElement();
  var component = this.getComponent();
  var dom = this.GetNoteWindowAlignmentNode(component, rootDom);
  var componentTypes = ["oracle.adf.RichTable", "oracle.adf.RichTreeTable"];
  var parent = this._getAncestorMatchingType(component, componentTypes);
  var parentPeer = parent != null ? parent.getPeer() : null;
  if (parentPeer != null && !parentPeer._isClickToEdit() && parentPeer._editableTableReadOnlyMode) {
    parentPeer._setReadOnlyMode(false, null, false);
  }
  var focusable = AdfFocusUtils.getFirstTabStop(dom);
  if (focusable != null) {
    AdfFocusUtils.focusElement(focusable);
  }
};
AdfDhtmlEditableValuePeer.prototype._getAncestorMatchingType = function(component, componentTypes) {
  while (component != null) {
    var parent = this.getComponentParent(component);
    if (componentTypes && componentTypes.indexOf(parent.getComponentType()) !== -1) {
      return parent;
    }
    component = component.parent;
  }
  return null;
};
AdfDhtmlEditableValuePeer.prototype.LazyInitialize = function(component, domElement) {
  var value = this.GetComponentValue(component, domElement);
  component.initializeProperty(AdfUIValue.VALUE, value);
};
AdfDhtmlEditableValuePeer.prototype.StashOldValue = function(component, domElement) {
  this._stashValue(component, domElement, AdfDhtmlEditableValuePeer._OLD_VALUE_EXPANDO, true);
};
AdfDhtmlEditableValuePeer.prototype._stashValue = function(component, domElement, expandoKey, onlyIfNull) {
  if (!component.getReadOnly()) {
    var contentNode = AdfDhtmlEditableValuePeer.getContentNode(component, domElement);
    var curValue = this.GetSubmittedValue(component, domElement);
    if (!onlyIfNull || contentNode.getAttribute(expandoKey) == null) {
      contentNode.setAttribute(expandoKey, "" + curValue);
    }
  }
};
AdfDhtmlEditableValuePeer.prototype._getStashedValue = function(component, domElement, expandoKey) {
  var contentNode = AdfDhtmlEditableValuePeer.getContentNode(component, domElement);
  return contentNode.getAttribute(expandoKey);
};
AdfDhtmlEditableValuePeer.prototype.ValidateIfStashedOldValue = function(component, domElement) {
  var contentNode = AdfDhtmlEditableValuePeer.getContentNode(component, domElement);
  var oldValue = contentNode.getAttribute(AdfDhtmlEditableValuePeer._OLD_VALUE_EXPANDO);
  if (oldValue != null) {
    contentNode.removeAttribute(AdfDhtmlEditableValuePeer._OLD_VALUE_EXPANDO);
    var curValue = this.GetSubmittedValue(component, domElement);
    if (curValue != oldValue) {
      this.Validate(component, curValue);
    }
  }
};
AdfDhtmlEditableValuePeer.prototype.ValidateAndStashNewValue = function(component, domElement, curValue) {
  var contentNode = AdfDhtmlEditableValuePeer.getContentNode(component, domElement);
  var oldValue = contentNode.getAttribute(AdfDhtmlEditableValuePeer._OLD_VALUE_EXPANDO);
  if (oldValue != null) {
    if (curValue === undefined) {
      curValue = this.GetSubmittedValue(component, domElement);
    }
    if (curValue != null && curValue != oldValue) {
      contentNode.setAttribute(AdfDhtmlEditableValuePeer._OLD_VALUE_EXPANDO, "" + curValue);
      this.Validate(component, curValue);
    }
  }
};
AdfDhtmlEditableValuePeer.prototype.StopArrowKeyBubbling = function(componentEvent) {
  var evt = componentEvent.getNativeEvent();
  var keyCode = componentEvent.getKeyCode();
  if (evt.ctrlKey || evt.altKey || evt.shiftKey || evt.metaKey) {
    return;
  }
  switch(keyCode) {
    case AdfKeyStroke.ARROWLEFT_KEY:
    ;
    case AdfKeyStroke.ARROWRIGHT_KEY:
    ;
    case AdfKeyStroke.ARROWUP_KEY:
    ;
    case AdfKeyStroke.ARROWDOWN_KEY:
      var nativeEventTarget = componentEvent.getNativeEventTarget();
      var contentNode = AdfDhtmlEditableValuePeer.getContentNode(this.getComponent());
      if (nativeEventTarget == contentNode) {
        componentEvent.stopBubbling();
      }
      break;
  }
};
AdfDhtmlEditableValuePeer.prototype._killNoteWindowTimeout = function() {
  this._killNoteWindowMouseTimeout();
  this._killNoteWindowFocusTimeout();
};
AdfDhtmlEditableValuePeer.prototype._killNoteWindowMouseTimeout = function() {
  if (this._noteWindowMouseTimeout) {
    AdfPage.PAGE.cancelTimer(this._noteWindowMouseTimeout);
    delete this._noteWindowMouseTimeout;
  }
  delete this._noteCompMouseId;
};
AdfDhtmlEditableValuePeer.prototype._killNoteWindowFocusTimeout = function() {
  if (this._noteWindowFocusTimeout) {
    AdfPage.PAGE.cancelTimer(this._noteWindowFocusTimeout);
    delete this._noteWindowFocusTimeout;
  }
  delete this._noteCompFocusId;
};
AdfDhtmlEditableValuePeer.prototype._onMouseOverTimeout = function(componentId) {
  this._killNoteWindowFocusTimeout();
  delete this._noteWindowMouseTimeout;
  delete this._noteCompMouseId;
  var component = AdfPage.PAGE.findComponent(componentId);
  if (component) {
    this.bind(component);
    if (!this.IsNoteWindowVisible(component)) {
      this.ShowNoteWindow(component, true);
    }
  }
};
AdfDhtmlEditableValuePeer.prototype._onFocusTimeout = function(componentId) {
  this._killNoteWindowMouseTimeout();
  delete this._noteWindowFocusTimeout;
  delete this._noteCompFocusId;
  var page = AdfPage.PAGE;
  if (componentId == page.getActiveComponentId()) {
    var component = page.findComponent(componentId);
    if (component) {
      this.bind(component);
      if (this._returnedFromChooseComponent != null) {
        delete this._returnedFromChooseComponent;
      } else {
        if (!this.IsNoteWindowVisible(component)) {
          this.ShowNoteWindow(component, false);
        }
      }
    }
  } else {
    if (this._returnedFromChooseComponent != null) {
      delete this._returnedFromChooseComponent;
    }
  }
};
AdfDhtmlEditableValuePeer.prototype._addMessageTimeout = function(componentId) {
  var page = AdfPage.PAGE;
  var component = AdfPage.PAGE.findComponent(componentId);
  if (component) {
    this.bind(component);
    if (this.IsNoteWindowVisible()) {
      this.HideNoteWindow(component, true);
    }
    var activeComponentId = page.getActiveComponentId() ? page.getActiveComponentId() : page.getPreviouslyActiveComponentId();
    if (componentId == activeComponentId) {
      this.ShowNoteWindow();
    }
  }
};
AdfDhtmlEditableValuePeer.prototype._getPublicComponentOrAncestor = function(component) {
  var publicComponent = component;
  while (publicComponent && publicComponent.satisfiesUsage(AdfUIComponent.USAGE_PRIVATE_CHILD)) {
    publicComponent = publicComponent.getParent();
  }
  return publicComponent;
};
AdfDhtmlEditableValuePeer.prototype._needsSpuriousDirtyValueTracking = function(page) {
  return page.getDirtyStateService().__needsSpuriousDirtyValueTracking() && this.NeedsSpuriousDirtyValueTracking();
};
AdfDhtmlEditableValuePeer.prototype.NeedsSpuriousDirtyValueTracking = function() {
  return false;
};
AdfDhtmlEditableValuePeer.prototype._stashInitValue = function(component, domElement) {
  this._stashValue(component, domElement, AdfDhtmlEditableValuePeer._INIT_VALUE_EXPANDO, false);
};
AdfDhtmlEditableValuePeer.prototype.__isSpuriousDirtyValue = function(page, component) {
  if (this._needsSpuriousDirtyValueTracking(page)) {
    var domElement = AdfRichUIPeer.getDomElementForComponent(component);
    var lastValue = this._getStashedValue(component, domElement, AdfDhtmlEditableValuePeer._INIT_VALUE_EXPANDO);
    var value = "" + this.GetSubmittedValue(component, domElement);
    return lastValue != null && lastValue != value;
  }
  return false;
};
AdfDhtmlEditableValuePeer.prototype.__resetSpuriousDirtyValue = function(page, component) {
  if (this._needsSpuriousDirtyValueTracking(page)) {
    var domElement = AdfRichUIPeer.getDomElementForComponent(component);
    this._stashInitValue(component, domElement);
  }
};
AdfDhtmlEditableValuePeer.prototype.ComponentShowRequiredChanged = AdfDomUtils.componentShowRequiredChanged;
AdfDhtmlEditableValuePeer.prototype._hideNoteTimeoutCallback = function(params) {
  var component = params.comp;
  if (component.isDead()) {
    return;
  }
  if (AdfDhtmlEditableValuePeer._shouldHideNoteWindow(component, params.time)) {
    this.bind(component);
    this.HideNoteWindow(component);
  }
  component.setProperty(AdfDhtmlEditableValuePeer._HIDE_NOTE_SCHEDULED, false);
};
AdfDhtmlEditableValuePeer.prototype._shouldScheduleNoteWindowAutoDismissal = function() {
  return AdfDhtmlEditableValuePeer._noteWindowDismissTimout > 0 && this.IsNoteWindowVisible() && !this.getComponent().getProperty(AdfDhtmlEditableValuePeer._HIDE_NOTE_SCHEDULED);
};
AdfDhtmlEditableValuePeer._shouldHideNoteWindow = function(component, time) {
  var lastValidateTime = component.getProperty(AdfDhtmlEditableValuePeer._LAST_VALIDATE_TIME);
  return component.getClientId() == AdfPage.PAGE.getActiveComponentId() && (!lastValidateTime || lastValidateTime < time);
};
