Search in sources :

Example 81 with ResponseWriter

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;'>");
}
Also used : ResponseWriter(javax.faces.context.ResponseWriter)

Example 82 with ResponseWriter

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>&nbsp;</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>
    }
}
Also used : ResponseWriter(javax.faces.context.ResponseWriter) UIComponent(javax.faces.component.UIComponent)

Example 83 with ResponseWriter

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");
    }
}
Also used : ResponseWriter(javax.faces.context.ResponseWriter)

Example 84 with ResponseWriter

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");
}
Also used : ResponseWriter(javax.faces.context.ResponseWriter)

Example 85 with ResponseWriter

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(">");
    }
}
Also used : ResponseWriter(javax.faces.context.ResponseWriter)

Aggregations

ResponseWriter (javax.faces.context.ResponseWriter)88 Map (java.util.Map)16 UIComponent (javax.faces.component.UIComponent)14 FacesContext (javax.faces.context.FacesContext)14 NodeRef (org.alfresco.service.cmr.repository.NodeRef)13 ResourceBundle (java.util.ResourceBundle)10 NodeService (org.alfresco.service.cmr.repository.NodeService)10 Iterator (java.util.Iterator)9 IOException (java.io.IOException)7 HashMap (java.util.HashMap)7 List (java.util.List)7 TreeNode (org.alfresco.web.ui.repo.component.UITree.TreeNode)7 ArrayList (java.util.ArrayList)6 Collection (java.util.Collection)5 UserTransaction (javax.transaction.UserTransaction)5 UIModeList (org.alfresco.web.ui.common.component.UIModeList)5 Serializable (java.io.Serializable)4 Node (org.alfresco.web.bean.repository.Node)4 QuickSort (org.alfresco.web.data.QuickSort)3 UIListItem (org.alfresco.web.ui.common.component.UIListItem)3