From lehors@us.ibm.com Wed Feb 9 23:46:46 2000
Return-Path:
Mailing-List: contact general-help@xml.apache.org; run by ezmlm
Delivered-To: mailing list general@xml.apache.org
Delivered-To: moderator for general@xml.apache.org
Received: (qmail 44699 invoked from network); 9 Feb 2000 23:46:46 -0000
Received: from e32.co.us.ibm.com (HELO e32.bld.us.ibm.com) (32.97.110.130)
by locus.apache.org with SMTP; 9 Feb 2000 23:46:46 -0000
Received: from westrelay01 (westrelay01.boulder.ibm.com [9.99.132.204])
by e32.bld.us.ibm.com (8.9.3/8.9.3) with ESMTP id SAA89708
for ; Wed, 9 Feb 2000 18:42:40 -0500
Received: from sun1.cupertino.ibm.com (sun1.cupertino.ibm.com [9.6.22.48])
by westrelay01 (8.8.8m2/NCO v2.06) with ESMTP id QAA33306
for ; Wed, 9 Feb 2000 16:46:44 -0700
Received: from us.ibm.com (MAKI.cupertino.ibm.com [9.6.22.89])
by sun1.cupertino.ibm.com (8.9.3/8.9.0) with ESMTP id PAA24735
for ; Wed, 9 Feb 2000 15:46:52 -0800 (PST)
Message-ID: <38A1FC6D.9A1BD596@us.ibm.com>
Date: Wed, 09 Feb 2000 15:46:53 -0800
From: Arnaud Le Hors
Reply-To: lehors@jtcsv.com
Organization: IBM
X-Mailer: Mozilla 4.7 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: general@xml.apache.org
Subject: Re: Deferred nodes and a little bit of swing :)
References: <8725687F.0060334E.00@d53mta04h.boulder.ibm.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
"Max R. Andersen" wrote:
>
> > I wouldn't suggest doing this. In fact, there should be
> > no need for instanceof DeferredNode. Your program should
> > not even care that the construction is being deferred.
>
> I also thought that in the begining but the problem is
> that IF the nodes are deferred then the hasChildNodes() method returns
> false even if it should have children :(
So, it looks like we may have a bug. But Andy is right, the expansion is
meant to occur automatically whenever it is necessary. I just had a look
at the relevant pieces of code and didn't see anything obvious...
> So I make the instanceof test to tell the TreeModel that it is
> *possible*
> that the node has children.
I'm afraid this won't do it. If there is a bug and somehow you end up in
a situation where the implementation thinks a node is expanded, even if
it's not, there is not much you can do. (apart from tracking the bug ;-)
--
Arnaud Le Hors - IBM Cupertino, XML Technology Group