//out.writeURIAttribute("background", getImageSrc(context, tree, "line-trunk.gif", true), null);
out.writeURIAttribute(HTML.STYLE_ATTR, "background-image:" + getImageSrc(context, tree, "line-trunk.gif", true) + ";", null);
}
// add the appropriate image for the nav control
UIGraphic image = new UIGraphic();
String imageId = IMAGE_PREFIX+(counter++);
image.setId(imageId);
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");
imageAttrs.put(HTML.ALT_ATTR, "Nav control image"); // placing a suitable description for the alt.
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(imageId + 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(imageId + NODE_STATE_CLOSED);
collapseImg.setParent(tree);
nodeImageId = collapseImg.getClientId(context);
nodeImgFacet = collapseFacet;
}
}
image.setParent(tree);