velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uday Kumar" <u...@eself.com>
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---

main1
   test1
   test2
      test22
      test23
  test3
main2

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
know

thanks in advance

-Uday



----- Original Message -----
From: "Tim Joyce" <tim@hoop.co.uk>
To: <velocity-user@jakarta.apache.org>
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
widget.
> maps to
>
>
http://www.paneris.org/cgi-bin/cvsweb.cgi/org/melati/util/JSDynamicTree.java
>
> 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
look
> at the following resources:
>
> http://www.paneris.org/cgi-bin/cvsweb.cgi/org/melati/admin/trees.js
>
http://www.paneris.org/cgi-bin/cvsweb.cgi/org/melati/template/webmacro/templ
> ets/html/org.melati.util.JSDynamicTree.wm
> http://www.paneris.org/cgi-bin/cvsweb.cgi/org/melati/util/Tree.java
> http://www.paneris.org/cgi-bin/cvsweb.cgi/org/melati/util/Treeable.java
>
> (i know the last resource is webmacro, but that is trivial to change).
>
> let me know if you want to see this.
>
> cheers
>
> timj
>
>
>


Mime
View raw message