myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean Radford <sradf...@bladesystems.co.uk>
Subject Re: [tree2] Who is using the isLeaf method? Should we deprecate this method?
Date Wed, 27 Apr 2005 18:31:04 GMT
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/ 


Mime
View raw message