velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uday Kumar" <>
Subject my tree
Date Tue, 17 Jul 2001 14:43:40 GMT
hi Tim

i did write a code to print out a tree, but i am sure no one wud want to see
that, as it is such a lousy code. wrote it just to serve the purpose,
debugging it wud be a pain for new-comers. my problem is... i have a
vectorof objects and they are arranged in order. i have to print them out
one by one, but with the only condition that some of them might have
subcategories, i can call some methods on it(ex. hasSubCategories( ) ) and
then according to the result, i print out with indentations. as i cud not do
the indentations, i made tables and each time i changed the width and
printed it out...

lemme give an example. actually, the categories would be like---


if this was my tree, the vector i have to recurse thru would be
[main1,test1,test2,test22,test23,test3,main2]. all the things are in order,
ready to be printed straightaway, but i have to identify whether each of
them has subcategories and then print it as above.

now, i made u my problem more clear, tell me if this works in the SAME WAY u
did? if that is the case, i wud replace my code with yours. please let me

thanks in advance


----- Original Message -----
From: "Tim Joyce" <>
To: <>
Sent: Monday, July 16, 2001 11:47 PM
Subject: Re: tree structure

> Uday,
> > i wanna know if any one of u has already implemented a tree structure
> > (similar to windows explorer, atleast indentation, if not collapsing and
> > expanding)
> if you are after collapsing and expanding, one of the melati developers
> (mylesc) has written some funky javascript dhtml dynamic tree thiggy
> maps to
> on the back end.  I have never seen it in action, so would be prepared to
> try and get a demo working if you are interested.  you may also want to
> at the following resources:
> ets/html/org.melati.util.JSDynamicTree.wm
> (i know the last resource is webmacro, but that is trivial to change).
> let me know if you want to see this.
> cheers
> timj

View raw message