Title: Message
Currently the BranchTreeNode returns false for the isLeaf() method.
 
I've patched the code to return true if it the branch has no children. I'll commit this change to CVS when I get back online...

James
----- Original Message -----
Sent: Friday, December 14, 2001 7:28 PM
Subject: [dom4j-user] DocumentTreeModel question

I'm trying to customize a JTree to display a Branch.  I've created a class almost identical to the DocumentTreeModel, but it takes a Branch rather than a Document (see code attached).  It works fine.  Now, I'm trying to create a tree renderer to display leaf nodes with my own icons.  However, it seems that the tree model is being built entirely of BranchTreeNodes, without any LeafTreeNodes at the leaves.  Here's the XML (not xsl) that I'm bullding the tree from:
 
<?xml version="1.0"?>
<code>
<choose>
    <when test="XPath"> <transform/></when>
    <when test="XPath"> <address/></when>
    <when test="XPath"> </when>
    <when test="XPath"> </when>
    <otherwise><transform transformed-doc-name="fool.xml" transformed-doc-type="foo"/> </otherwise>
</choose>
<transform/>
<address/>
<route/>
</code>
Any idea why no LeafTreeNodes are created?
 
Attached is a screenshot of the JTree, and the BranchTreeModel.java file.

Reply via email to