Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] Node.getParent() swing.tree.TreeNode.getParent() collision

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Grant Wood <grant AT nanode.org>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: [XOM-interest] Node.getParent() swing.tree.TreeNode.getParent() collision
  • Date: Wed, 30 Apr 2008 18:12:43 -0500

Hello,

I'm trying to use a XOM Document as a TreeModel for a swing application.

To do this, I have extended Element to implement swing's TreeModel, Mutable TreeNode and TreeNode.

problem is, javax.swing.tree.TreeNode requires:

public TreeNode getParent()

Which causes a conflict with nu.xom.Node in which getParent() is final. This makes perfect sense, and i'm just sorry I hadn't realized this conflict sooner.

Previously, this same XML data tree was being rendered using a JList and an Element implementing the ListModel interface, which worked great, but will require an unnecessarily complicated ListCellRenderer to do what I'm am trying to do next. I decided to implement the same interface using a JTree to simplify a few things for myself, but have now run into this conflict.

I've searched through the mail archive looking for anyone who has run into this before but haven't found anything.

What is are suggestions for using XOM with JTree or working around conflicts like this?

Thanks for your suggestions, I apologize if there is a example or thread that I missed which discusses this.


-Grant Wood



  • [XOM-interest] Node.getParent() swing.tree.TreeNode.getParent() collision, Grant Wood, 04/30/2008

Archive powered by MHonArc 2.6.24.

Top of Page