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 TreeNodeRenderer extends TreeNodeRendererBase {
 	
 private static final Attributes PASS_THROUGH_ATTRIBUTES13 = attributes()
 	     .generic("align","align")
 	     
 
 	     .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 boolean isEmpty(Object object
  {
 		if (object == null) {
 		    return true;
 		} else if (object.getClass().isArray()) {
 		    return ((Object[]) object).length == 0;
 		} else if (object instanceof java.util.Collection) {
 		    return ((java.util.Collection<?>) object).isEmpty();
 		} else if (object instanceof java.util.Map) {
 		    return ((java.util.Map<?, ?>) object).isEmpty();
 		} else {
 			return object.toString().length() == 0;
 		}
 	}
 	
 public void doEncodeBegin(ResponseWriter responseWriter, FacesContext facesContext, UIComponent component
 		throws IOException
 	 {
 		String clientId = component.getClientId(facesContext);
 TreeNodeState nodeState  =  (TreeNodeState)this.getNodeState(facesContext); 
 UIComponent tree  =  (UIComponent)this.getTreeComponent(component); 
 addClientEventHandlers(facesContextcomponent);
 responseWriter.startElement("div"component); 
    {
       Object value = this.concatClasses("rf-trn",component.getAttributes().get("styleClass"),tree.getAttributes().get("nodeClass"));
       if(null != value &&
       shouldRenderAttribute(value)
       ) {
         responseWriter.writeAttribute("class",value,null);
       }
       
   }
renderPassThroughAttributes(facesContextcomponent
UIComponent loadingFacet  =  (UIComponent)this.getHandleLoadingFacetIfApplicable(component); 
	if (((!isEmpty(loadingFacet)) && loadingFacet.isRendered())) {
	responseWriter.startElement("span"component); 
	  responseWriter.writeAttribute("class","rf-trn-hnd-ldn-fct",null);
                        loadingFacet.encodeAll(facesContext);
                    ;
	responseWriter.endElement("span"); 
responseWriter.startElement("span"component); 
   {
      Object value = this.concatClasses(nodeState.getHandleClass(),component.getAttributes().get("handleClass"),tree.getAttributes().get("handleClass"));
      if(null != value &&
      shouldRenderAttribute(value)
      ) {
        responseWriter.writeAttribute("class",value,null);
      }
      
   }
responseWriter.endElement("span"); 
responseWriter.startElement("span"component); 
  responseWriter.writeAttribute("class","rf-trn-cnt",null);
encodeIcon(facesContextcomponent);
responseWriter.startElement("span"component); 
   {
      Object value = this.concatClasses("rf-trn-lbl",component.getAttributes().get("labelClass"),tree.getAttributes().get("labelClass"));
      if(null != value &&
      shouldRenderAttribute(value)
      ) {
        responseWriter.writeAttribute("class",value,null);
      }
      
   }
	}
public void doEncodeEnd(ResponseWriter responseWriter, FacesContext facesContext, UIComponent component
	 {
		String clientId = component.getClientId(facesContext);
responseWriter.endElement("span"); 
responseWriter.endElement("span"); 
responseWriter.endElement("div"); 
	}
New to GrepCode? Check out our FAQ X