AdfRichUIPeer.createPeerClass(AdfRichUIPeer,"AdfDhtmlMessagesPeer");
AdfDhtmlMessagesPeer.InitSubclass=function(){AdfRichUIPeer.addComponentPropertyGetters(this,AdfRichMessages.SHORT_DESC);AdfRichUIPeer.addComponentPropertyGetters(this,AdfRichMessages.MESSAGE);AdfRichUIPeer.addComponentPropertyGetters(this,AdfRichMessages.TEXT);AdfRichUIPeer.addComponentPropertyGetters(this,AdfRichMessages.GLOBAL_ONLY);AdfDhtmlMessagesPeer._ATTRIBUTE_GLOBAL_ONLY="_afrGlobalOnly";AdfDhtmlMessagesPeer._ATTRIBUTE_MESSAGE="_afrMessage";AdfDhtmlMessagesPeer._ATTRIBUTE_TEXT="_afrText";AdfDhtmlMessagesPeer._HEADER_STYLE_CLASS=
"af|messages::header";AdfDhtmlMessagesPeer._HEADER_ICON_STYLE_CLASS="af|messages::header-icon";AdfDhtmlMessagesPeer._HEADER_TEXT_STYLE_CLASS="af|messages::header-text";AdfDhtmlMessagesPeer._MESSAGES_BODY_CLASS="af|messages::body";AdfDhtmlMessagesPeer._MESSAGES_INTRO_CLASS="af|messages::intro";AdfDhtmlMessagesPeer._MESSAGES_GROUP_TITLE_CLASS="af|messages::message-group-title";AdfDhtmlMessagesPeer._MESSAGES_TYPE_CLASS="af|messages::type";AdfDhtmlMessagesPeer._MESSAGES_DETAIL_CLASS="af|messages::detail"};
AdfDhtmlMessagesPeer.prototype.componentRemoved=function(a){AdfDhtmlMessagesPeer.superclass.componentRemoved.call(this,a);var b=AdfPage.PAGE,d=b.getDefaultMessageHandlerComponentId(),e=b.getMessageHandlerSlaveComponentId(),f=a.getClientId(),g=!1;if(f==d){for(var g=!0,h;a&&!h;)(a=a.getParent())&&a instanceof AdfRichDocument&&(h=a.getClientId());d=h}f==e&&(AdfMessageUtils.HideMessagesDialog(),g=!0,e=null);g&&b.setDefaultMessageHandlerComponentId(d,e)};
AdfDhtmlMessagesPeer.prototype.isMessagesDialogShowable=function(){return!1};AdfDhtmlMessagesPeer.prototype.setMessagesDialogShown=function(a){};AdfDhtmlMessagesPeer.prototype.GetComponentShortDesc=function(a,b){return AdfAgent.AGENT.getAttribute(b,"title")};AdfDhtmlMessagesPeer.prototype.GetComponentMessage=function(a,b){return AdfAgent.AGENT.getAttribute(b,AdfDhtmlMessagesPeer._ATTRIBUTE_MESSAGE)};
AdfDhtmlMessagesPeer.prototype.GetComponentText=function(a,b){return AdfAgent.AGENT.getAttribute(b,AdfDhtmlMessagesPeer._ATTRIBUTE_TEXT)};AdfDhtmlMessagesPeer.prototype.GetComponentGlobalOnly=function(a,b){return AdfAgent.AGENT.getBooleanAttribute(b,AdfDhtmlMessagesPeer._ATTRIBUTE_GLOBAL_ONLY)};AdfDhtmlMessagesPeer.prototype.MessageShow=function(a,b){this._messageUpdate(a,b,!0)};
AdfDhtmlMessagesPeer.prototype.MessageNotify=function(a,b){AdfDhtmlMessagesPeer.superclass.MessageNotify.call(this,a,b);this._messageUpdate(a,b,!1)};
AdfDhtmlMessagesPeer.prototype._messageUpdate=function(a,b,d){b=AdfPage.PAGE;var e=this.getComponent(),f=e.getClientId(),g=b.getAllMessages(),h=this.getDomElement(),k=this.GetComponentGlobalOnly(e,h),l=g[f],m=0;null!=l&&(m=l.length);if(d&&!AdfMessageUtils.isPageLevelBoxNeeded(b,l,k))for(var n in g)d=g[n],null!=d&&null!=d.compId&&AdfMessageUtils.messageGroupFocus(n);if(AdfMessageUtils.hasMessages(b,m,k)){AdfDomUtils.removeAllNodes(h);n=b.getLookAndFeel();d=AdfAgent.AGENT;m=d.getDomDocument().createElement("table");
m.summary="";m.role="presentation";AdfDomUtils.addCSSClassName(m,n.getStyleClass(AdfDhtmlMessagesPeer._HEADER_STYLE_CLASS));var q=m.insertRow(-1),r=q.insertCell(-1);null==a&&(a=0);if(k)a=l.maxType;else for(var t in g)l=g[t].maxType,l>a&&(a=l);AdfDomUtils.addCSSClassName(r,n.getStyleClass(AdfDhtmlMessagesPeer._HEADER_ICON_STYLE_CLASS));var u;t=e.getStyleClass();null!=t&&(u=AdfMessageUtils.getIconWithPrefix(a,"."+t+" ",!0),null==u&&AdfLogger.LOGGER.warning("Icon not found with style class "+t+".  Make sure that skin contains class prefixed the message styleCalss: ."+
t));u||(u=AdfMessageUtils.getIcon(a,!0));r.appendChild(u);r=q.insertCell(-1);AdfDomUtils.addCSSClassName(r,n.getStyleClass(AdfDhtmlMessagesPeer._HEADER_TEXT_STYLE_CLASS));u=e.getText();null==u?d.setTextContent(r,AdfMessageUtils.getString(a,!0)):d.setTextContent(r,u);h.appendChild(m);a=e.getMessage();a=AdfMessageUtils.getCombinedMessagesDom(f,a,k);AdfDomUtils.addCSSClassName(a,n.getStyleClass(AdfDhtmlMessagesPeer._MESSAGES_BODY_CLASS));h.appendChild(a);h.style.display=""}else h.style.display="none",
AdfDomUtils.removeAllNodes(h),AdfMessageUtils.HideMessagesDialog();b.__queueDescendantResizeNotifySource(e);b.__doDescendantResizeNotify()};