Code example for Formatter

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

0
    public void remove(UITreeNode node){
        UITree tree = TreeRenderHelper.getTree(node);
        if(tree != null){
            FacesContext context = FacesContext.getCurrentInstance();
            String treeJsvar = FacesUtils.getJsvar(context, tree);
            Formatter fmt = new Formatter(new StringBuffer());
            fmt.format("var treeNode_toRemove=findNodeById(%s.getRootNode(),'%s');\n", treeJsvar, node.getId());
            fmt.format("treeNode_toRemove.remove();\n");
            fmt.format("var treeNode_toExpand=findNodeById(%s.getRootNode(),'%s');\n", treeJsvar, node.getParent().getId());
            fmt.format("treeNode_toExpand.expand();\n");
            addOperationScript(fmt.toString());
        } 
        node.getParent().getChildren().remove(node);
    } 
     
    @OperationListener("setChecked") 
    public void setChecked(UITreeNode node, Boolean checked){
        UITree tree = TreeRenderHelper.getTree(node);
        if(tree != null && node.getChecked() != null){
            FacesContext context = FacesContext.getCurrentInstance();
            String treeJsvar = FacesUtils.getJsvar(context, tree);