Code example for Formatter

Methods: \",Object[]), \",String,UNKNOWN), toString

0
        throws IOException 
    { 
        if (isAjaxResponse(context)) {
            String jsvar = FacesUtils.getJsvar(context, component);
            String value = getCurrentValue(context, component);
            Formatter fmt = new Formatter();
 
            fmt.format("%s.setChecked(%b,true);\n", jsvar, Boolean.valueOf(value));
            if (FacesUtils.isDynamicValue(component, "label")) {
                String text = HtmlEncoder.enquote(getItemText(context, component, false), '\'');
                fmt.format("%s.setText(%s);\n", jsvar, text);
            } 
            if (FacesUtils.isDynamicValue(component, "disabled")) {
                fmt.format("%s.setDisabled(%b);\n", jsvar, isDisabled(component));
            } 
 
            AjaxResponseWriter out = (AjaxResponseWriter)context.getResponseWriter();
            out.writeScript(fmt.toString());
        } 
    } 
 
    public void provideResource(ResourceManager rm, UIComponent component) {
        UIMenu menu = getParentMenu(component);