It's already possible to use custom icons in ice:tree without having to build from source.
The ice:tree example in the component-showcase application has the following markup.
<ice:tree id="tree"
value="#{treeController.model}"
var="node"
hideRootNode="false"
hideNavigation="false"
imageDir="#{styleBean.imageDirectory}">
<ice:treeNode>
<f:facet name="icon">
<ice:panelGroup
style="display: inline" >
<ice:graphicImage
value="/xmlhttp/css/#{styleBean.currentStyle}/css-images/#{node.userObject.icon}"/>
</ice:panelGroup>
</f:facet>
<f:facet name="content">
<ice:panelGroup
styleClass="selectedNode#{node.userObject eq treeController.selectedUserObject}"
style="display: inline" >
<ice:commandLink
actionListener="#{treeController.employeeNodeSelected}">
<f:param name="employeeId" value="#{node.userObject.employee.id}" />
<ice:outputText id="TreeNode"
value="#{node.userObject.text}"/>
</ice:commandLink>
</ice:panelGroup>
</f:facet>
</ice:treeNode>
</ice:tree>
Notice that there is an 'icon' facet, containing an ice:graphicImage component, which specifies a path, which happens to be the path of the /css-images folder of the theme currently being used. It is enough to modify the path of this ice:graphicImage component to some other path in the application. The following markup is an example of an image located at the root of the application folder.
<f:facet name="icon">
<ice:panelGroup
style="display: inline" >
<ice:graphicImage
value="/#{node.userObject.icon}"/>
</ice:panelGroup>
</f:facet>
The getLeafIcon(), getBranchContractedIcon(), and getBranchExpandedIcon() of the IceUserObject class are simply String value holders for future reference. Modifying them doesn't alter the appearance of tree nodes per se. The appearance of tree nodes is only altered when those values are consumed somewhere in the application code, as in the example above.
r52701, r52702: added support for 'icon' facet to ace:tree (ee 3.3 maintenance branch and 4.3 trunk)