use of javax.faces.context.ResponseWriter in project acs-community-packaging by Alfresco.
the class MultilingualTextRenderer method encodeEnd.
@Override
public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
super.encodeEnd(facesContext, component);
String tooltip = Application.getMessage(facesContext, "marker_tooltip");
ResponseWriter out = facesContext.getResponseWriter();
out.write("<img src='");
out.write(facesContext.getExternalContext().getRequestContextPath());
out.write("/images/icons/multilingual_marker.gif' title='");
out.write(tooltip);
out.write("' style='margin-left:6px; vertical-align:-2px;'>");
}
use of javax.faces.context.ResponseWriter in project acs-community-packaging by Alfresco.
the class PropertySheetItemRenderer method encodeChildren.
/**
* @see javax.faces.render.Renderer#encodeChildren(javax.faces.context.FacesContext, javax.faces.component.UIComponent)
*/
@SuppressWarnings("unchecked")
public void encodeChildren(FacesContext context, UIComponent component) throws IOException {
if (component.isRendered() == false) {
return;
}
ResponseWriter out = context.getResponseWriter();
// make sure there are 2 or 3 child components
int count = component.getChildCount();
if (count == 2 || count == 3) {
// get the label and the control
List<UIComponent> children = component.getChildren();
UIComponent label = children.get(0);
UIComponent control = children.get(1);
// encode the mandatory marker component if present
if (count == 3) {
out.write("<td>");
UIComponent mandatoryMarker = children.get(2);
Utils.encodeRecursive(context, mandatoryMarker);
out.write("</td>");
} else {
// output an empty column
out.write("<td> </td>");
}
// place a style class on the label column if necessary
String labelStylceClass = (String) component.getParent().getAttributes().get("labelStyleClass");
out.write("<td");
if (labelStylceClass != null) {
outputAttribute(out, labelStylceClass, "class");
}
// close the <td>
out.write(">");
// encode the label
Utils.encodeRecursive(context, label);
// encode the control
out.write("</td><td>");
Utils.encodeRecursive(context, control);
// NOTE: we'll allow the property sheet's grid renderer close off the last <td>
}
}
use of javax.faces.context.ResponseWriter in project ART-TIME by Artezio.
the class CustomOutputLabelRenderer method encodeEnd.
@Override
public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
super.encodeEnd(context, component);
if (markAsRequired(component)) {
ResponseWriter writer = context.getResponseWriter();
writer.writeText(" *", "value");
}
}
use of javax.faces.context.ResponseWriter in project skeleton-commons by skeleton-software-community.
the class UITooltip method encodeBegin.
@Override
public void encodeBegin(FacesContext context) throws IOException {
String forValue = (String) getAttributes().get("for");
String script = "$(function(){$('" + forValue + "').tooltip();})";
ResponseWriter writer = context.getResponseWriter();
writer.startElement("script", null);
writer.writeAttribute("type", "text/javascript", null);
writer.write(script);
writer.endElement("script");
}
use of javax.faces.context.ResponseWriter in project muikku by otavanopisto.
the class WidgetSpaceComponent method encodeBegin.
@Override
public void encodeBegin(FacesContext context) throws IOException {
if (getKeepEmpty() || (!isEmpty())) {
ResponseWriter writer = context.getResponseWriter();
writer.write("<div class=");
writer.write('"');
// if (getChildren().size() != 0)
writer.write("widgetSpace grid_");
// else
// writer.write("widgetSpace container_");
writer.write(String.valueOf(getSize()));
if (getStyleClass() != null) {
writer.write(" ");
writer.write(getStyleClass());
}
writer.write('"');
writer.write(" data-name=");
writer.write('"');
writer.write(getName());
writer.write('"');
writer.write(">");
}
}
Aggregations