javaScriptWriter.writeCall(null, "_setImages").write(varId);
javaScriptWriter.writeMethodCall("_setImages").write(varId);
    public int encodeNodeBegin(UIComponent component, SelectItem selectItem,            boolean hasChild, boolean isVisible) throws WriterException {        TreeRenderContext treeRenderContext = (TreeRenderContext) getContext();        String parentVarId = null;        if (treeRenderContext.countVarId() > 0) {            parentVarId = treeRenderContext.peekVarId();        }        /*         * System.out.println("isv=" + isVisible + "/" + selectItem.getLabel() +         * "/" + selectItem.getValue());         */        if (isVisible == false) {            int preloadLevelDepth = treeRenderContext.getPreloadedLevelDepth();            if (preloadLevelDepth > 0                    && preloadLevelDepth < treeRenderContext.getDepth()) {                if (treeRenderContext.isFirstInteractiveChild(parentVarId)) {                    javaScriptWriter.writeCall(null, "_setInteractiveParent")                            .write(parentVarId).writeln(");");                }                return SKIP_NODE;            }        }        String varId = javaScriptWriter.getJavaScriptRenderContext()                .allocateVarName();        treeRenderContext.pushVarId(varId);        javaScriptWriter.write("var ").write(varId);        if (parentVarId == null) {            parentVarId = javaScriptWriter.getComponentVarName();        }        javaScriptWriter.write('=').writeCall(null, "_appendNode").write(                parentVarId).write(',');        int pred = 0;        String text = selectItem.getLabel();        if (text != null) {            javaScriptWriter.writeString(text);        } else {            javaScriptWriter.writeNull();        }        Object selectItemValue = selectItem.getValue();        String value = convertItemValue(javaScriptWriter                .getComponentRenderContext(), selectItemValue);        if (value != null) {            for (; pred > 0; pred--) {                javaScriptWriter.write(',').writeBoolean(false);            }            javaScriptWriter.write(',').writeString(value);        } else {            pred++;        }        String toolTip = selectItem.getDescription();        if (toolTip != null) {            for (; pred > 0; pred--) {                javaScriptWriter.write(',').writeBoolean(false);            }            javaScriptWriter.write(',').writeString(toolTip);        } else {            pred++;        }        if (selectItem.isDisabled()) { // DISABLED            for (; pred > 0; pred--) {                javaScriptWriter.write(',').writeBoolean(false);            }            javaScriptWriter.write(',').writeBoolean(true);        } else {            pred++;        }        if (treeRenderContext.isUserExpandable()) {            if (treeRenderContext.isValueExpanded(selectItem, selectItemValue)) { // Expand                for (; pred > 0; pred--) {                    javaScriptWriter.write(',').writeBoolean(false);                }                javaScriptWriter.write(',').writeBoolean(true);            } else {                pred++;            }        }        if (treeRenderContext.writeSelectionFullState() == false) {            if (treeRenderContext.isValueSelected(selectItem, selectItemValue)) { // SELECTION                for (; pred > 0; pred--) {                    javaScriptWriter.write(',').writeBoolean(false);                }                javaScriptWriter.write(',').writeBoolean(true);            } else {                pred++;            }        }        if (treeRenderContext.writeCheckFullState() == false) {            if (treeRenderContext.isValueChecked(selectItem, selectItemValue)) { // CHECK                for (; pred > 0; pred--) {                    javaScriptWriter.write(',').writeBoolean(false);                }                javaScriptWriter.write(',').writeBoolean(true);            } else {                pred++;            }        }        javaScriptWriter.writeln(");");        if (selectItem instanceof IImagesSelectItem) {            IImagesSelectItem imagesSelectItem = (IImagesSelectItem) selectItem;            String varImageURL = null;            String varExpandedImageURL = null;            String varSelectedImageURL = null;            String varDisabledImageURL = null;            String varHoverImageURL = null;            String imageURL = imagesSelectItem.getImageURL();            String expandedImageURL = imagesSelectItem.getExpandedImageURL();            String selectedImageURL = imagesSelectItem.getSelectedImageURL();            String disabledImageURL = imagesSelectItem.getDisabledImageURL();            String hoverImageURL = null;            IComponentRenderContext componentContext = javaScriptWriter                    .getComponentRenderContext();            String originalImageURL = imageURL;            if (imageURL != null) {                imageURL = AbstractCameliaRenderer.rewriteURL(componentContext,                        IURLRewritingProvider.IMAGE_URL_TYPE, "imageURL",                        imageURL, null);            }            if (disabledImageURL != null) {                disabledImageURL = AbstractCameliaRenderer.rewriteURL(                        componentContext, IURLRewritingProvider.IMAGE_URL_TYPE,                        "disabledImageURL", disabledImageURL, originalImageURL);            }            if (expandedImageURL != null) {                expandedImageURL = AbstractCameliaRenderer.rewriteURL(                        componentContext, IURLRewritingProvider.IMAGE_URL_TYPE,                        "expandedImageURL", expandedImageURL, originalImageURL);            }            if (selectedImageURL != null) {                selectedImageURL = AbstractCameliaRenderer.rewriteURL(                        componentContext, IURLRewritingProvider.IMAGE_URL_TYPE,                        "selectedImageURL", selectedImageURL, selectedImageURL);            }            if (hoverImageURL != null) {                hoverImageURL = AbstractCameliaRenderer.rewriteURL(                        componentContext, IURLRewritingProvider.IMAGE_URL_TYPE,                        "hoverImageURL", hoverImageURL, originalImageURL);            }            if (imageURL != null) {                varImageURL = javaScriptWriter.allocateString(imageURL);            }            if (expandedImageURL != null) {                varExpandedImageURL = javaScriptWriter                        .allocateString(expandedImageURL);            }            if (selectedImageURL != null) {                varSelectedImageURL = javaScriptWriter                        .allocateString(selectedImageURL);            }            if (disabledImageURL != null) {                varDisabledImageURL = javaScriptWriter                        .allocateString(disabledImageURL);            }            if (hoverImageURL != null) {                varHoverImageURL = javaScriptWriter                        .allocateString(hoverImageURL);            }            if (varImageURL != null || varExpandedImageURL != null                    || varSelectedImageURL != null                    || varDisabledImageURL != null || varHoverImageURL != null) {                javaScriptWriter.writeCall(null, "_setImages").write(varId);                pred = 0;                if (varImageURL != null) {                    for (; pred > 0; pred--) {                        javaScriptWriter.write(',').writeBoolean(false);                    }                    javaScriptWriter.write(',').write(varImageURL);                } else {                    pred++;                }                if (varExpandedImageURL != null) {                    for (; pred > 0; pred--) {                        javaScriptWriter.write(',').writeBoolean(false);                    }                    javaScriptWriter.write(',').write(varExpandedImageURL);                } else {                    pred++;                }                if (varSelectedImageURL != null) {                    for (; pred > 0; pred--) {                        javaScriptWriter.write(',').writeBoolean(false);                    }                    javaScriptWriter.write(',').write(varSelectedImageURL);                } else {                    pred++;                }                if (varDisabledImageURL != null) {                    for (; pred > 0; pred--) {                        javaScriptWriter.write(',').writeBoolean(false);                    }                    javaScriptWriter.write(',').write(varDisabledImageURL);                } else {                    pred++;                }                if (varHoverImageURL != null) {                    for (; pred > 0; pred--) {                        javaScriptWriter.write(',').writeBoolean(false);                    }                    javaScriptWriter.write(',').write(varHoverImageURL);                } else {                    pred++;                }                javaScriptWriter.writeln(");");            }        }        return EVAL_NODE;    }