cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject CForms: a Tree widget
Date Thu, 16 Jun 2005 17:31:34 GMT
Hi all,

I finally finished a first version of the Tree widget for Cocoon Forms 
talked about a month ago [1]. It's currently only in trunk (will merge 
to 2.1 soon).

Update your svn, and then point your browser to:
- http://localhost:8888/forms-samples/do-fileExplorer.flow (a two-pane 
file explorer)
- http://localhost:8888/forms-samples/do-sampleTree.flow (some radom 
test samples that will be polished).

This Tree widget is heavily inspired by Swing's JTree.

It's based on a lightweight TreeModel interface, of which 2 
implementations are provided:
- DefaultTreeModel to build an in-memory tree (simple, but not the most 
- SourceTreeModel that allows to build file explorers! Define the root 
URL, some directory and file inclusion/exclusion patterns and you're 
done :-)

On the template side, some new <ft:tree>, <ft:tree-nodes> and 
<ft:tree-children> have been added, which are currently only implemented 
with JXTG macros (see [2] for an example, and the corresponding form 
definition [3]).

These macros also have been heavily refactored to be more efficient, and 
produce less data when answering Ajax requests.

There's still some work to do on the Tree widget:
- add support for child widgets attached to tree nodes
- optimize the Ajax refresh to refresh only subtrees (currently the tree 
is refreshed as a whole).
- the tree currently supports single and multiple selection model, and 
I'd like to add a "sibling" model, where only siblings can be selected.
- more TreeModel implementations, notably based on pipelines and XML 

Now onwards to writing the docs for this new widget :-)



Sylvain Wallez                        Anyware Technologies  
Apache Software Foundation Member     Research & Technology Director

View raw message