Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.richfaces.renderkit.html;
  
  import  javax.faces.application.ResourceDependencies;
  import  javax.faces.application.ResourceDependency;
  import  javax.faces.component.UIComponent;
  import  javax.faces.context.FacesContext;
  import  javax.faces.context.ResponseWriter;
 import static org.richfaces.renderkit.RenderKitUtils.*;
 
 
 @ResourceDependencies({@ResourceDependency(name="message.reslib",library="org.richfaces",target=""),@ResourceDependency(name="msg.ecss",library="org.richfaces",target="")})
 public class HtmlMessageRenderer extends MessageRendererBase {
 	
 private static final Attributes PASS_THROUGH_ATTRIBUTES4 = attributes()
 	     .generic("dir","dir")
 	     
 
 	     .generic("lang","lang")
 	     
 
 	     .generic("onclick","onclick","click")
 	     
 
 	     .generic("ondblclick","ondblclick","dblclick")
 	     
 
 	     .generic("onkeydown","onkeydown","keydown")
 	     
 
 	     .generic("onkeypress","onkeypress","keypress")
 	     
 
 	     .generic("onkeyup","onkeyup","keyup")
 	     
 
 	     .generic("onmousedown","onmousedown","mousedown")
 	     
 
 	     .generic("onmousemove","onmousemove","mousemove")
 	     
 
 	     .generic("onmouseout","onmouseout","mouseout")
 	     
 
 	     .generic("onmouseover","onmouseover","mouseover")
 	     
 
 	     .generic("onmouseup","onmouseup","mouseup")
 	     
 
 	     .generic("role","role")
 	     
 
 	     .generic("style","style")
 	     
 
 	     .generic("title","title")
 	     
 ;
 	
 	
 private static String convertToString(Object object
  {
 		return object != null ? object.toString() : "";
 	}
 	
 public void doEncodeEnd(ResponseWriter responseWriter, FacesContext facesContext, UIComponent component
 		throws IOException
 	 {
 		String clientId = component.getClientId(facesContext);
 responseWriter.startElement("span"component); 
    {
       String value = "rf-msg " + convertToString(component.getAttributes().get("styleClass"));
       if(null != value &&
          value.length()>0
       ) {
         responseWriter.writeAttribute("class",value,null);
       }
       
    }
 
    {
       String value = clientId;
       if(null != value &&
          value.length()>0
       ) {
         responseWriter.writeAttribute("id",value,null);
       }
       
    }
 
 
renderPassThroughAttributes(facesContextcomponent
		for (MessageForRender msg : this.getVisibleMessages(facesContext,component)) {
			responseWriter.startElement("span"component); 
			   {
      String value = this.getMsgClass(facesContext,component,msg);
      if(null != value &&
         value.length()>0
      ) {
        responseWriter.writeAttribute("class",value,null);
      }
      
   }
   {
      String value = this.getMsgStyle(facesContext,component,msg);
      if(null != value &&
         value.length()>0
      ) {
        responseWriter.writeAttribute("style",value,null);
      }
      
   }
			encodeMessage(facesContext,component,msg);
			responseWriter.endElement("span"); 
		}
encodeScript(facesContext,component);
responseWriter.endElement("span"); 
	}
New to GrepCode? Check out our FAQ X