Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.richfaces.renderkit.html;
  
  import  javax.faces.component.UIComponent;
  import  javax.faces.context.FacesContext;
  import  javax.faces.context.ResponseWriter;
  import static org.richfaces.renderkit.RenderKitUtils.*;
 
 
 public class CommandLinkRenderer extends AjaxCommandRendererBase {
 	
 private static final Attributes PASS_THROUGH_ATTRIBUTES2 = attributes()
 	     .generic("accesskey","accesskey")
 	     
 
 	     .generic("charset","charset")
 	     
 
 	     .generic("class","styleClass")
 	     
 
 	     .generic("coords","coords")
 	     
 
 	     .generic("dir","dir")
 	     
 
 	     .generic("hreflang","hreflang")
 	     
 
 	     .generic("lang","lang")
 	     
 
 	     .generic("onblur","onblur")
 	     
 
 	     .generic("ondblclick","ondblclick","dblclick")
 	     
 
 	     .generic("onfocus","onfocus")
 	     
 
 	     .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("rel","rel")
 	     
 
 	     .generic("rev","rev")
 	     
 
 	     .generic("role","role")
 	     
 
 	     .generic("shape","shape")
 	     
 
 	     .generic("style","style")
 	     
 
 	     .generic("tabindex","tabindex")
 	     
 
 	     .generic("title","title")
 	     
 
 	     .generic("type","type")
 	     
 ;
 	
 private static final Attributes PASS_THROUGH_ATTRIBUTES3 = attributes()
 	     .generic("class","styleClass")
 	     
 
	     .generic("dir","dir")
	     
	     .generic("lang","lang")
	     
	     .generic("onclick","onclick","action","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 boolean convertToBoolean(Object object
 {
		if (object == null) {
	return false;
if (object instanceof Boolean) {
    return (Booleanobject;
return Boolean.valueOf(object.toString());
	}
public void doEncodeEnd(ResponseWriter responseWriter, FacesContext facesContext, UIComponent component
	 {
		String clientId = component.getClientId(facesContext);
	if ((!convertToBoolean(component.getAttributes().get("disabled")))) {
	responseWriter.startElement("a"component); 
	  responseWriter.writeURIAttribute("href","#",null);
   {
      String value = clientId;
      if(null != value &&
         value.length()>0
      ) {
        responseWriter.writeAttribute("id",value,null);
      }
      
   }
   {
      String value = clientId;
      if(null != value &&
         value.length()>0
      ) {
        responseWriter.writeAttribute("name",value,null);
      }
      
   }
   {
      String value = this.getOnClick(facesContext,component);
      if(null != value &&
         value.length()>0
      ) {
        responseWriter.writeAttribute("onclick",value,null);
      }
      
   }
renderPassThroughAttributes(facesContextcomponent
	{
	Object text = component.getAttributes().get("value");
	if (text != null) {
		responseWriter.writeText(textnull); 
	}
	renderChildren(facesContextcomponent);
	responseWriter.endElement("a"); 
else  { 
	responseWriter.startElement("span"component); 
	   {
      String value = clientId;
      if(null != value &&
         value.length()>0
      ) {
        responseWriter.writeAttribute("id",value,null);
      }
      
   }
renderPassThroughAttributes(facesContextcomponent
	{
	Object text = component.getAttributes().get("value");
	if (text != null) {
		responseWriter.writeText(textnull); 
	}
	renderChildren(facesContextcomponent);
	responseWriter.endElement("span"); 
	}
public boolean getRendersChildren() 
 {
		return true;
	}
New to GrepCode? Check out our FAQ X