Code example for Formatter

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

0
    public void setText(UITreeNode node, String text){
        UITree tree = TreeRenderHelper.getTree(node);
        if(tree != null && node.getText() != null){
            FacesContext context = FacesContext.getCurrentInstance();
            String treeJsvar = FacesUtils.getJsvar(context, tree);
            Formatter fmt = new Formatter(new StringBuffer());
            fmt.format("var treeNode_toUpdate=findNodeById(%s.getRootNode(),'%s');\n", treeJsvar, node.getId());
            fmt.format("treeNode_toUpdate.setText('%s');\n", node.getText());
            addOperationScript(fmt.toString());
        } 
    } 
}