var $AdfDhtmlCommandButtonPeer$$ = $AdfRichUIPeer$$.$createPeerClass$($AdfRichUIPeer$$, "AdfDhtmlCommandButtonPeer", !0);
$goog$exportSymbol$$("AdfDhtmlCommandButtonPeer", $AdfDhtmlCommandButtonPeer$$);
$AdfDhtmlCommandButtonPeer$$.$InitSubclass$ = function $$AdfDhtmlCommandButtonPeer$$$$InitSubclass$$() {
  $AdfRichUIPeer$$.$addComponentEventHandlers$(this, $AdfUIInputEvent$$.$CLICK_EVENT_TYPE$);
  $AdfRichUIPeer$$.$addComponentPropertyGetters$(this, AdfRichCommandButton.TEXT);
  $AdfRichUIPeer$$.$addComponentPropertyChanges$(this, AdfRichCommandButton.TEXT);
  this.$_BUSY$ = "_busy";
};
$goog$exportSymbol$$("AdfDhtmlCommandButtonPeer.InitSubclass", $AdfDhtmlCommandButtonPeer$$.$InitSubclass$);
$AdfDhtmlCommandButtonPeer$$.prototype.$HandleComponentClick$ = function $$AdfDhtmlCommandButtonPeer$$$$$HandleComponentClick$$($componentEvent$$152_nativeEvent$$31$$) {
  var $component$$936$$ = this.$getComponent$(), $isBusy$$7$$ = $component$$936$$.$getProperty$($AdfDhtmlCommandButtonPeer$$.$_BUSY$);
  $component$$936$$.getDisabled() || !$componentEvent$$152_nativeEvent$$31$$.$isLeftButtonPressed$() || $isBusy$$7$$ || $AdfActionEvent$$.$queue$($component$$936$$, $component$$936$$.getPartialSubmit());
  $AdfAgent$$.$AGENT$.$getCapabilities$()[$AdfAgent$$.$CAP_TOUCH_SCREEN$] == $AdfAgent$$.$CAP_TOUCH_SCREEN_NONE$ && ($componentEvent$$152_nativeEvent$$31$$ = $componentEvent$$152_nativeEvent$$31$$.$getNativeEvent$(), $AdfAgent$$.$AGENT$.$eatEvent$($componentEvent$$152_nativeEvent$$31$$));
};
$AdfObject$$.$exportPrototypeSymbol$("AdfDhtmlCommandButtonPeer.prototype.HandleComponentClick", {$HandleComponentClick$:$AdfDhtmlCommandButtonPeer$$.prototype.$HandleComponentClick$});
$AdfDhtmlCommandButtonPeer$$.prototype.$GetAccessibleName$ = function $$AdfDhtmlCommandButtonPeer$$$$$GetAccessibleName$$() {
  return this.$getComponent$().getText();
};
$AdfObject$$.$exportPrototypeSymbol$("AdfDhtmlCommandButtonPeer.prototype.GetAccessibleName", {$GetAccessibleName$:$AdfDhtmlCommandButtonPeer$$.prototype.$GetAccessibleName$});
$AdfDhtmlCommandButtonPeer$$.prototype.$GetComponentText$ = function $$AdfDhtmlCommandButtonPeer$$$$$GetComponentText$$($component$$938$$, $domElement$$126$$) {
  var $text$$23$$ = $AdfAgent$$.$AGENT$.$getTextContent$($domElement$$126$$);
  return "" == $text$$23$$ ? null : $text$$23$$;
};
$AdfObject$$.$exportPrototypeSymbol$("AdfDhtmlCommandButtonPeer.prototype.GetComponentText", {$GetComponentText$:$AdfDhtmlCommandButtonPeer$$.prototype.$GetComponentText$});
$AdfDhtmlCommandButtonPeer$$.prototype.$GetInlineEditor$ = function $$AdfDhtmlCommandButtonPeer$$$$$GetInlineEditor$$() {
  return $AdfDhtmlButtonTextEditor$$.$getInlineEditor$();
};
$AdfObject$$.$exportPrototypeSymbol$("AdfDhtmlCommandButtonPeer.prototype.GetInlineEditor", {$GetInlineEditor$:$AdfDhtmlCommandButtonPeer$$.prototype.$GetInlineEditor$});
$AdfDhtmlCommandButtonPeer$$.$__setDisabled$ = function $$AdfDhtmlCommandButtonPeer$$$$__setDisabled$$($buttonElement$$1$$, $disabled$$11$$) {
  $AdfAssert$$.$assertDomElement$($buttonElement$$1$$, "BUTTON");
  $AdfAssert$$.$assertBoolean$($disabled$$11$$);
  $AdfDomUtils$$.$addOrRemoveCSSClassName$($disabled$$11$$, $buttonElement$$1$$, $AdfRichUIPeer$$.$DISABLED_STYLECLASS$);
};
$AdfDhtmlCommandButtonPeer$$.prototype.$SetBusy$ = function $$AdfDhtmlCommandButtonPeer$$$$$SetBusy$$($isBusy$$8$$) {
  var $component$$939$$ = this.$getComponent$(), $domElement$$127$$ = this.$getDomElement$();
  !$AdfDomUtils$$.$getFormElement$($domElement$$127$$) || $component$$939$$.getDisabled() || $AdfPage$$.$PAGE$.$isAttachmentMode$() || ($AdfDhtmlCommandButtonPeer$$.$__setDisabled$($domElement$$127$$, $isBusy$$8$$), $component$$939$$.setProperty($AdfDhtmlCommandButtonPeer$$.$_BUSY$, $isBusy$$8$$, !1, $AdfUIComponent$$.$PROPAGATE_NEVER$));
};
$AdfObject$$.$exportPrototypeSymbol$("AdfDhtmlCommandButtonPeer.prototype.SetBusy", {$SetBusy$:$AdfDhtmlCommandButtonPeer$$.prototype.$SetBusy$});
$AdfDhtmlCommandButtonPeer$$.prototype.$isBusy$ = function $$AdfDhtmlCommandButtonPeer$$$$$isBusy$$() {
  var $component$$940$$ = this.$getComponent$();
  return $component$$940$$ && $component$$940$$.$getProperty$($AdfDhtmlCommandButtonPeer$$.$_BUSY$);
};
$AdfObject$$.$exportPrototypeSymbol$("AdfDhtmlCommandButtonPeer.prototype.isBusy", {$isBusy$:$AdfDhtmlCommandButtonPeer$$.prototype.$isBusy$});
$AdfDhtmlCommandButtonPeer$$.prototype.$ComponentTextChanged$ = function $$AdfDhtmlCommandButtonPeer$$$$$ComponentTextChanged$$($component$$941$$, $domElement$$128_textWrapperElement$$, $newValue$$53$$) {
  return ($domElement$$128_textWrapperElement$$ = $AdfDhtmlCommandButtonPeer$$.$getInlineEditableTextElement$($component$$941$$, $domElement$$128_textWrapperElement$$)) ? $AdfDomUtils$$.$handleTextChangeWithAccessKey$($component$$941$$, $domElement$$128_textWrapperElement$$, $newValue$$53$$) : !1;
};
$AdfObject$$.$exportPrototypeSymbol$("AdfDhtmlCommandButtonPeer.prototype.ComponentTextChanged", {$ComponentTextChanged$:$AdfDhtmlCommandButtonPeer$$.prototype.$ComponentTextChanged$});
$AdfDhtmlCommandButtonPeer$$.$getInlineEditableTextElement$ = function $$AdfDhtmlCommandButtonPeer$$$$getInlineEditableTextElement$$($component$$942$$, $domElement$$129$$) {
  var $childElements$$3_secondElement_wrapperElement$$1$$ = $AdfDomUtils$$.$getChildElements$($domElement$$129$$), $childCount$$9_firstElement_span$$6$$ = $childElements$$3_secondElement_wrapperElement$$1$$.length;
  if (0 == $childCount$$9_firstElement_span$$6$$) {
    return $domElement$$129$$;
  }
  if (1 == $childCount$$9_firstElement_span$$6$$) {
    $childElements$$3_secondElement_wrapperElement$$1$$ = $childElements$$3_secondElement_wrapperElement$$1$$[0];
    if ("IMG" == $childElements$$3_secondElement_wrapperElement$$1$$.tagName) {
      var $doc$$41_spanStyle$$ = $AdfAgent$$.$AGENT$.$getDomDocument$(), $childCount$$9_firstElement_span$$6$$ = $doc$$41_spanStyle$$.createElement("SPAN");
      $childCount$$9_firstElement_span$$6$$.appendChild($doc$$41_spanStyle$$.createTextNode(""));
      $doc$$41_spanStyle$$ = $childCount$$9_firstElement_span$$6$$.style;
      $doc$$41_spanStyle$$.padding = "3px";
      $doc$$41_spanStyle$$.whiteSpace = "nowrap";
      $component$$942$$.getIconPosition && "leading" != $component$$942$$.getIconPosition() ? $domElement$$129$$.insertBefore($childCount$$9_firstElement_span$$6$$, $childElements$$3_secondElement_wrapperElement$$1$$) : $domElement$$129$$.appendChild($childCount$$9_firstElement_span$$6$$);
      return $childCount$$9_firstElement_span$$6$$;
    }
    return $domElement$$129$$;
  }
  if (2 == $childCount$$9_firstElement_span$$6$$) {
    $childCount$$9_firstElement_span$$6$$ = $childElements$$3_secondElement_wrapperElement$$1$$[0];
    $childElements$$3_secondElement_wrapperElement$$1$$ = $childElements$$3_secondElement_wrapperElement$$1$$[1];
    if ("IMG" == $childCount$$9_firstElement_span$$6$$.tagName) {
      return $childElements$$3_secondElement_wrapperElement$$1$$;
    }
    if ("IMG" == $childElements$$3_secondElement_wrapperElement$$1$$.tagName) {
      return $childCount$$9_firstElement_span$$6$$;
    }
    $AdfLogger$$.$LOGGER$.severe("Unexpected DOM structure 2 elements neither is an IMG in AdfDhtmlCommandButtonPeer.getInlineEditableTextElement (1 \x3d " + $childCount$$9_firstElement_span$$6$$ + ", 2 \x3d " + $childElements$$3_secondElement_wrapperElement$$1$$ + ").");
    return null;
  }
  $AdfLogger$$.$LOGGER$.severe("Unexpected number of child elements in AdfDhtmlCommandButtonPeer.getInlineEditableTextElement (" + $childCount$$9_firstElement_span$$6$$ + "): " + $childElements$$3_secondElement_wrapperElement$$1$$);
  return null;
};
$goog$exportSymbol$$("AdfDhtmlCommandButtonPeer.getInlineEditableTextElement", $AdfDhtmlCommandButtonPeer$$.$getInlineEditableTextElement$);
$AdfDhtmlCommandButtonPeer$$.$stopInlineEditableTextElement$ = function $$AdfDhtmlCommandButtonPeer$$$$stopInlineEditableTextElement$$($component$$943$$, $domElement$$130$$) {
  var $childElements$$4_secondElement$$1$$ = $AdfDomUtils$$.$getChildElements$($domElement$$130$$);
  if (2 == $childElements$$4_secondElement$$1$$.length) {
    var $firstElement$$1$$ = $childElements$$4_secondElement$$1$$[0], $childElements$$4_secondElement$$1$$ = $childElements$$4_secondElement$$1$$[1], $elementToRemoveIfEmpty$$ = null;
    "IMG" == $firstElement$$1$$.tagName ? "SPAN" == $childElements$$4_secondElement$$1$$.tagName && ($elementToRemoveIfEmpty$$ = $childElements$$4_secondElement$$1$$) : "IMG" == $childElements$$4_secondElement$$1$$.tagName && "SPAN" == $firstElement$$1$$.tagName && ($elementToRemoveIfEmpty$$ = $firstElement$$1$$);
    null != $elementToRemoveIfEmpty$$ && "" == $elementToRemoveIfEmpty$$.innerHTML && $elementToRemoveIfEmpty$$.parentNode.removeChild($elementToRemoveIfEmpty$$);
  }
};
$goog$exportSymbol$$("AdfDhtmlCommandButtonPeer.stopInlineEditableTextElement", $AdfDhtmlCommandButtonPeer$$.$stopInlineEditableTextElement$);
