[Seaside] Generalizing WATree.
Tim Murray
tmurray at ecsorl.com
Wed Aug 18 13:03:12 UTC 2010
Hi all.
I am trying to generalize WATree so that is can tree out a typical file
system.
I copied WATreeFunctionalTest and modified it to display the existing
Collection tree
On top of my file tree.
Here is the modified initialize method:
initialize
super initialize.
tree := WATree new
root: Collection;
labelBlock: [ :class | class name ];
childrenBlock: [ :class | class subclasses ];
selectBlock: [ :class | selected := class name ];
canSelectBlock: [ :class | class subclasses notEmpty ];
yourself.
filetree:=WATree new
root: (CFileDirectoryTreeItem on: FileDirectory default);
labelBlock:[:cfdti | cfdti getLabel];
childrenBlock:[:cfdti | cfdti getChildren ];
yourself.
Here is the modified renderTreeOn:html
renderTreeOn: html
html strong: 'Selected:'.
html render: selected.
" self break."
html render: tree.
html render:filetree.
I can't copy and paste the output directly into this, but it looks like
this with the filetree expanded one level:
* +Collection
* -CroquetSDK-1.0.18-Squeak4.1
* +bin
* cache
* cache-global
* +Content
* +MyLibrary
* +files
* icons
* package-cache
* prefs
* router-logs
* sm
* +Squeak 4.1.1beta2U.app
* ....
However, when I go to expand +MyLibrary it does not expand.
Looking at +Collection , which does work, the principle seems to be that
every "thing" in the blocks are "the same thing"
For the +Collection, that "same thing" is a Class. So the operations all
recurse down.
After a lot of trying , "The Same Thing" I am using is a
CFileDirectoryTreeItem. (I have tried a lot of different things).
What is troubling, is that the childrenBlock:[:cfdti | cfdti
getChildren] does in fact, return CFIleDirectoryTreeItems.
Any ideas?
thx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20100818/6a435460/attachment.htm
More information about the seaside
mailing list