Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.richfaces.renderkit.html;
  
  import java.util.Map;
  import  javax.faces.component.UIComponent;
  import  javax.faces.context.FacesContext;
  import  javax.faces.context.ResponseWriter;
 import static org.richfaces.renderkit.RenderKitUtils.*;
 
 
 public class ProgressBarRenderer extends ProgressBarBaseRenderer {
 	
 private static final Attributes PASS_THROUGH_ATTRIBUTES14 = attributes()
 	     .generic("align","align")
 	     
 
 	     .generic("dir","dir")
 	     
 
 	     .generic("lang","lang")
 	     
 
 	     .generic("onclick","onclick","click")
 	     
 
 	     .generic("ondblclick","ondblclick","dblclick")
 	     
 
 	     .generic("onkeydown","onkeydown")
 	     
 
 	     .generic("onkeypress","onkeypress")
 	     
 
 	     .generic("onkeyup","onkeyup")
 	     
 
 	     .generic("onmousedown","onmousedown","mousedown")
 	     
 
 	     .generic("onmousemove","onmousemove","mousemove")
 	     
 
 	     .generic("onmouseout","onmouseout","mouseout")
 	     
 
 	     .generic("onmouseover","onmouseover","mouseover")
 	     
 
 	     .generic("onmouseup","onmouseup","mouseup")
 	     
 
 	     .generic("role","role")
 	     
 
 	     .generic("title","title")
 	     
 ;
 	
 private static final Attributes ATTRIBUTES_FOR_SCRIPT_HASH17 = attributes()
 	     .generic("interval","interval")
 
 	     .generic("enabled","enabled")
 	     .defaultValue(false)
 
 	     .generic("value","value")
 	     
 
 	     .generic("onfinish","onfinish","finish")
 	     
 
 	     .generic("resource","resource")
 	     
 ;
 	
 	
 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("div"component); 
    {
       Object value = this.concatClasses("rf-pb",component.getAttributes().get("styleClass"));
       if(null != value &&
       shouldRenderAttribute(value)
      ) {
        responseWriter.writeAttribute("class",value,null);
      }
      
   }
   {
      String value = clientId;
      if(null != value &&
         value.length()>0
      ) {
        responseWriter.writeAttribute("id",value,null);
      }
      
   }
   {
      Object value = component.getAttributes().get("style");
      if(null != value &&
      shouldRenderAttribute(value)
      ) {
        responseWriter.writeAttribute("style",value,null);
      }
      
   }
renderPassThroughAttributes(facesContextcomponent
ProgressBarStateEncoder encoder  =  (ProgressBarStateEncoder)this.getEncoder(facesContext,component); 
ProgressBarState currentState  =  (ProgressBarState)this.getCurrentState(facesContext,component); 
                encoder.encodeInitialState(facesContextcomponentcurrentState);
            ;
                encoder.encodeCompleteState(facesContextcomponentcurrentState);
            ;
                encoder.encodeProgressState(facesContextcomponentcurrentState);
            ;
responseWriter.startElement("script"component); 
  responseWriter.writeAttribute("type","text/javascript",null);
Map<StringObjectoptions = new LinkedHashMap<StringObject>(); 
addToScriptHash(options"submitFunction"this.getSubmitFunction(facesContext,component), nullnull);
addToScriptHash(options"minValue"this.getMinValueOrDefault(component), 0, null);
addToScriptHash(options"maxValue"this.getMaxValueOrDefault(component), 100, null);
addToScriptHash(optionsfacesContextcomponentnull);
	Object text = "new RichFaces.ui.ProgressBar(" + convertToString(toScriptArgs(clientId,options)) + ");";
	if (text != null) {
		responseWriter.writeText(textnull); 
	}
responseWriter.endElement("script"); 
responseWriter.endElement("div"); 
	}
public boolean getRendersChildren() 
 {
		return true;
	}
New to GrepCode? Check out our FAQ X