public void encodeBegin(FacesContext context, UIComponent component)
throws IOException {
if(UIFacebookClient.isClientEnabled((UIViewRootEx)context.getViewRoot())) {
ResponseWriter writer = context.getResponseWriter();
UILike dialog = (UILike)component;
writer.startElement("fb:like", component);
writer.writeAttribute("id", component.getClientId(context), null);
if (dialog.getShowFaces() == null) {
writer.writeAttribute("show_faces", "false", null);
}
else {
writer.writeAttribute("show_faces", dialog.getShowFaces(), null);
}
if (dialog.getWidth() == null) {
writer.writeAttribute("width", "450", null);
}
else {
writer.writeAttribute("width", dialog.getWidth(), null);
}
if (dialog.getSend() == null) {
writer.writeAttribute("send", "false", null);
}
else {
writer.writeAttribute("send", dialog.getSend(), null);
}
if (dialog.getHref() == null) {
writer.writeAttribute("href", "", null);
}
else {
writer.writeAttribute("href", dialog.getHref(), null);
}
}
}