// Path: src/main/java/org/primefaces/material/MaterialColors.java
// public enum MaterialColors {
// 	RED("red"),
// 	PINK("pink"),
// 	PURPLE("purple"),
// 	DEEP_PURPLE("deep-purple"),
// 	INDIGO("indigo"),
// 	BLUE("blue"),
// 	LIGHT_BLUE("light-blue"),
// 	CYAN("cyan"),
// 	TEAL("teal"),
// 	GREEN("green"),
// 	LIGHT_GREEN("light-green"),
// 	LIME("lime"),
// 	YELLOW("yellow"),
// 	AMBER("amber"),
// 	ORANGE("orange"),
// 	DEEP_ORANGE("deep-orange"),
// 	BROWN("brown"),
// 	GREY("grey"),
// 	BLUE_GREY("blue-grey");
// 	
// 	
// 	private String colorName;
// 	private static Random random = new Random();
// 	
// 	private MaterialColors(String name){
// 		this.colorName = name;
// 	}
// 	
// 	public String getColorName(){
// 		return this.colorName;
// 	}
// 	
// 	public static MaterialColors random(){
// 		return MaterialColors.values()[random.nextInt(MaterialColors.values().length)];
// 	}
// 	
// }
// 
// Path: src/main/java/org/primefaces/material/MaterialWidgetBuilder.java
// public class MaterialWidgetBuilder extends WidgetBuilder {
// 
// 	private static final String KEY = MaterialWidgetBuilder.class.getName();
// 
// 	public static MaterialWidgetBuilder getInstance(final FacesContext context) {
// 
// 		MaterialWidgetBuilder wb = (MaterialWidgetBuilder) context.getExternalContext().getRequestMap().get(KEY);
// 
// 		if (wb == null) {
// 			wb = new MaterialWidgetBuilder(context);
// 
// 			context.getExternalContext().getRequestMap().put(KEY, wb);
// 		}
// 
// 		return wb;
// 	}
//     
//     public MaterialWidgetBuilder(FacesContext context) {
//         super(context);
//     }
// 
//     protected WidgetBuilder init(String widgetClass, String widgetVar, String id, boolean endFunction) throws IOException {
//     	this.endFunction = endFunction;
// 
//         context.getResponseWriter().write("MaterialPrime.cw(\"");
//         context.getResponseWriter().write(widgetClass);
//         context.getResponseWriter().write("\",\"");
//         context.getResponseWriter().write(widgetVar);
//         context.getResponseWriter().write("\",{");
//         context.getResponseWriter().write("id:\"");
//         context.getResponseWriter().write(id);
//         if (widgetVar == null) {
//         	context.getResponseWriter().write("\"");
//         } else {
// 	        context.getResponseWriter().write("\",widgetVar:\"");
// 	        context.getResponseWriter().write(widgetVar);
// 	        context.getResponseWriter().write("\"");
//         }
// 
//         return this;
//     }
// }


import java.io.IOException;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.event.ActionEvent;
import org.primefaces.material.MaterialColors;
import org.primefaces.material.MaterialWidgetBuilder;
import org.primefaces.material.util.Strings;
import org.primefaces.renderkit.CoreRenderer;
import org.primefaces.util.WidgetBuilder;
package org.primefaces.material.component.fixedactionbutton;




public class FixedActionButtonRenderer extends CoreRenderer{
	
	private static final String DEFAULT_FIXED_ACTION_COLOR = "red";
	private static final String FIXED_ACTION_BTN_CLASS = "fixed-action-btn";
	public static final String RENDERER_TYPE = "org.primefaces.material.component.FixedActionButtonRenderer";
	
	@Override
	public void decode(FacesContext context, UIComponent fab) {
		
		for (UIComponent component : fab.getChildren()) {
			String param = component.getClientId(context);
			if(context.getExternalContext().getRequestParameterMap().containsKey(param)) {
				component.queueEvent(new ActionEvent(component));
			}
		}
		
        decodeBehaviors(context, fab);
	}
	
	@Override
	public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
		FixedActionButton button = (FixedActionButton) component;
		
		encodeMarkup(context, button);
		encodeScript(context, button);
	}
	
	protected void encodeScript(FacesContext context, FixedActionButton button) throws IOException {
		String clientId = button.getClientId();
		String widgetVar = button.resolveWidgetVar();
		 
// Path: src/main/java/org/primefaces/material/MaterialColors.java
// public enum MaterialColors {
// 	RED("red"),
// 	PINK("pink"),
// 	PURPLE("purple"),
// 	DEEP_PURPLE("deep-purple"),
// 	INDIGO("indigo"),
// 	BLUE("blue"),
// 	LIGHT_BLUE("light-blue"),
// 	CYAN("cyan"),
// 	TEAL("teal"),
// 	GREEN("green"),
// 	LIGHT_GREEN("light-green"),
// 	LIME("lime"),
// 	YELLOW("yellow"),
// 	AMBER("amber"),
// 	ORANGE("orange"),
// 	DEEP_ORANGE("deep-orange"),
// 	BROWN("brown"),
// 	GREY("grey"),
// 	BLUE_GREY("blue-grey");
// 	
// 	
// 	private String colorName;
// 	private static Random random = new Random();
// 	
// 	private MaterialColors(String name){
// 		this.colorName = name;
// 	}
// 	
// 	public String getColorName(){
// 		return this.colorName;
// 	}
// 	
// 	public static MaterialColors random(){
// 		return MaterialColors.values()[random.nextInt(MaterialColors.values().length)];
// 	}
// 	
// }
// 
// Path: src/main/java/org/primefaces/material/MaterialWidgetBuilder.java
// public class MaterialWidgetBuilder extends WidgetBuilder {
// 
// 	private static final String KEY = MaterialWidgetBuilder.class.getName();
// 
// 	public static MaterialWidgetBuilder getInstance(final FacesContext context) {
// 
// 		MaterialWidgetBuilder wb = (MaterialWidgetBuilder) context.getExternalContext().getRequestMap().get(KEY);
// 
// 		if (wb == null) {
// 			wb = new MaterialWidgetBuilder(context);
// 
// 			context.getExternalContext().getRequestMap().put(KEY, wb);
// 		}
// 
// 		return wb;
// 	}
//     
//     public MaterialWidgetBuilder(FacesContext context) {
//         super(context);
//     }
// 
//     protected WidgetBuilder init(String widgetClass, String widgetVar, String id, boolean endFunction) throws IOException {
//     	this.endFunction = endFunction;
// 
//         context.getResponseWriter().write("MaterialPrime.cw(\"");
//         context.getResponseWriter().write(widgetClass);
//         context.getResponseWriter().write("\",\"");
//         context.getResponseWriter().write(widgetVar);
//         context.getResponseWriter().write("\",{");
//         context.getResponseWriter().write("id:\"");
//         context.getResponseWriter().write(id);
//         if (widgetVar == null) {
//         	context.getResponseWriter().write("\"");
//         } else {
// 	        context.getResponseWriter().write("\",widgetVar:\"");
// 	        context.getResponseWriter().write(widgetVar);
// 	        context.getResponseWriter().write("\"");
//         }
// 
//         return this;
//     }
// }


// Path: src/main/java/org/primefaces/material/component/fixedactionbutton/FixedActionButtonRenderer.java
import java.io.IOException;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.event.ActionEvent;
import org.primefaces.material.MaterialColors;
import org.primefaces.material.MaterialWidgetBuilder;
import org.primefaces.material.util.Strings;
import org.primefaces.renderkit.CoreRenderer;
import org.primefaces.util.WidgetBuilder;

package org.primefaces.material.component.fixedactionbutton;




public class FixedActionButtonRenderer extends CoreRenderer{
	
	private static final String DEFAULT_FIXED_ACTION_COLOR = "red";
	private static final String FIXED_ACTION_BTN_CLASS = "fixed-action-btn";
	public static final String RENDERER_TYPE = "org.primefaces.material.component.FixedActionButtonRenderer";
	
	@Override
	public void decode(FacesContext context, UIComponent fab) {
		
		for (UIComponent component : fab.getChildren()) {
			String param = component.getClientId(context);
			if(context.getExternalContext().getRequestParameterMap().containsKey(param)) {
				component.queueEvent(new ActionEvent(component));
			}
		}
		
        decodeBehaviors(context, fab);
	}
	
	@Override
	public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
		FixedActionButton button = (FixedActionButton) component;
		
		encodeMarkup(context, button);
		encodeScript(context, button);
	}
	
	protected void encodeScript(FacesContext context, FixedActionButton button) throws IOException {
		String clientId = button.getClientId();
		String widgetVar = button.resolveWidgetVar();
		 
		WidgetBuilder wb = MaterialWidgetBuilder.getInstance(context);