On Wed, 10 Jul 2002, Carsten Burghardt wrote:

> Date: Wed, 10 Jul 2002 09:51:48 +0200
> From: Carsten Burghardt <[EMAIL PROTECTED]>
> Reply-To: Tomcat Developers List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Re: Use TreeControl in apps?
>
> > I am no licensing expert, but I believe that the Apache license allows
> > you to use to any of the Tomcat source code (including the TreeControl).
>
> The license is not my problem (as we're using struts which is also a
> Jakarta-projekt ;-) ) but the documentation. I couldn't find any docu about
> this treecontrol so I wonder if anybody could give me an hint or a little
> help what has to be done.
>

There isn't really any docco as such (because it's just used internal to
the application).  The best thing to do would be to take a look at how
it's used in the admin app.  The following starting points might be
useful:

* This implementation is pretty network-heavy, because it does a round
  trip to the server for each click (no JavaScript).

* In the admin app, the tree itself is in a separate frame so that you
  can update just the tree, just the content frame, or both.

* The actual classes that implement the tree control have no dependencies
  on the rest of the admin app itself.

* The tree control is implemented in a single custom tag (TreeControlTag)
  that talks to a data structure consisting of a TreeControl and a bunch
  of TreeControlNode elements for each node of the tree.  The TreeControl
  object itself is stored in a session attribute (so each user can have
  a custom tree if you need it).

* You manage the graph of the tree by how you add child nodes to parents.
  This is typically done at application startup, but you can also do it
  live.  The properties of each node lets you configure the appearance
  and behavior of each node, plus whether it is currently open or closed
  if this is not a leaf node.

I'd start by looking at the TomcatTreeBuilder class for an example of how
the tree can be put together.  When your tree control architecture mirrors
the architecture of your component tree, it's real easy to do this with
recursive calls like this.


> Regards,
>
> Carsten

Craig


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to