Return-Path: Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: (qmail 8403 invoked from network); 27 Apr 2005 18:24:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 27 Apr 2005 18:24:41 -0000 Received: (qmail 15382 invoked by uid 500); 27 Apr 2005 18:25:34 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 15338 invoked by uid 500); 27 Apr 2005 18:25:34 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 15325 invoked by uid 99); 27 Apr 2005 18:25:34 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from anchor-post-33.mail.demon.net (HELO anchor-post-33.mail.demon.net) (194.217.242.91) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 27 Apr 2005 11:25:34 -0700 Received: from bladesys.demon.co.uk ([80.177.16.106] helo=[192.168.0.8]) by anchor-post-33.mail.demon.net with esmtp (Exim 4.42) id 1DQrD6-000OcM-Bk for users@myfaces.apache.org; Wed, 27 Apr 2005 18:24:32 +0000 Message-ID: <426FDA68.8080900@bladesystems.co.uk> Date: Wed, 27 Apr 2005 19:31:04 +0100 From: Sean Radford User-Agent: Mozilla Thunderbird 0.9 (X11/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: MyFaces Discussion Subject: Re: [tree2] Who is using the isLeaf method? Should we deprecate this method? References: <2387fbc50504270904505af493@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Jon Travis wrote: > Seems like in the very dynamic case, where you are only > generating part of the tree at a time, that isLeaf might > be useful. You might not know how many children you > have without doing an expensive operation, but you might > know that you are not a leaf. > And I will be doing it as such in a new app in a few weeks time... > isLeaf() isn't even used. Making it the exclusive way > to determine if there is an expansion button beside it > seems like a better API. > > -- Jon > > > On Apr 27, 2005, at 9:04 AM, Sean Schofield wrote: > >> Sureshbabu pointed out something interesting in an earlier post. The >> TreeBacker class has the boolean values for leaf reversed. So all of >> the branch nodes have setLeaf(true) and visa versa. >> >> I will fix this in CVS now, but there is another interesting point >> here. It doesn't matter to any of the simple examples! This is >> because the getType method is used to determine the facet (and hence >> what type of icon to use). The navigation icons (the plus/minus >> icons) are determined by the child count. >> >> IMO the getChildCount method and the getType methods could cover >> pretty much every scenario that you would need isLeaf for. I have >> opened a JIRA issue (MYFACES-215) to suggest we deprecate the is Leaf >> method (and eventually eliminate it.) Please add comments there if >> you have feelings on this one way or another. >> >> sean >> >> > > > -- Dr. Sean Radford, MBBS, MSc sradford@bladesystems.co.uk http://bladesys.demon.co.uk/