cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
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 
efficient)
- 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 
documents.

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

Enjoy,
Sylvain

[1] http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=111554581220004&w=2
[2] 
http://svn.apache.org/repos/asf/cocoon/blocks/forms/trunk/samples/forms/file_explorer_template.xml
[3] 
http://svn.apache.org/repos/asf/cocoon/blocks/forms/trunk/samples/forms/file_explorer_model.xml

-- 
Sylvain Wallez                        Anyware Technologies
http://apache.org/~sylvain            http://anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


Mime
View raw message