{
out.writeURIAttribute("background", getImageSrc(context, tree, "line-trunk.gif", true), null);
}
// add the appropriate image for the nav control
UIGraphic image = new UIGraphic();
image.setId(IMAGE_PREFIX);
image.setUrl(navSrcUrl);
Map imageAttrs = image.getAttributes();
imageAttrs.put(HTML.WIDTH_ATTR, "19");
imageAttrs.put(HTML.HEIGHT_ATTR, "18");
imageAttrs.put(HTML.BORDER_ATTR, "0");
if (clientSideToggle)
{
/**
* With client side toggle, user has the option to specify open/closed images for the node (in addition to
* the navigtion ones provided by the component.)
*/
String expandImgSrc = "";
String collapseImgSrc = "";
String nodeImageId = "";
UIComponent expandFacet = nodeTypeFacet.getFacet("expand");
if (expandFacet != null)
{
UIGraphic expandImg = (UIGraphic)expandFacet;
expandImgSrc = context.getApplication().getViewHandler().getResourceURL(context, expandImg.getUrl());
if (expandImg.isRendered())
{
expandImg.setId(IMAGE_PREFIX + NODE_STATE_EXPANDED);
expandImg.setParent(tree);
nodeImageId = expandImg.getClientId(context);
nodeImgFacet = expandFacet;
}
}
UIComponent collapseFacet = nodeTypeFacet.getFacet("collapse");
if (collapseFacet != null)
{
UIGraphic collapseImg = (UIGraphic)collapseFacet;
collapseImgSrc = context.getApplication().getViewHandler().getResourceURL(context, collapseImg.getUrl());
if (collapseImg.isRendered())
{
collapseImg.setId(IMAGE_PREFIX + NODE_STATE_CLOSED);
collapseImg.setParent(tree);
nodeImageId = collapseImg.getClientId(context);
nodeImgFacet = collapseFacet;
}
}
image.setParent(tree);