[Seaside] Generalizing WATree Update--with files selectable.
John Chludzinski
john.chludzinski at gmail.com
Thu Aug 19 15:25:27 UTC 2010
Tim, I believe something as simple as the class below would solve your
problem without modifying the WATree implementation (much simpler than
bending CFIleDirectoryTreeItems to your will):
Object subclass: #DirTreeNode
instanceVariableNames: 'children name entry'
classVariableNames: ''
poolDictionaries: ''
category: 'Misc'!
!DirTreeNode methodsFor: 'accessing' stamp: 'jtc'!
children
self isLeaf ifTrue: [ ^ nil ].
children
ifNil: [
children := OrderedCollection new.
name entries do: [ :entry |
children add: ((self class on: entry fullName) entry: entry) ]
].
^ children! !
!DirTreeNode methodsFor: 'accessing' stamp: 'jtc'!
entry
^ entry! !
!DirTreeNode methodsFor: 'accessing' stamp: 'jtc7'!
entry: e
entry := e! !
!DirTreeNode methodsFor: 'accessing' stamp: 'jtc'!
getLabel
^ (name pathName findTokens: '\') last! !
!DirTreeNode methodsFor: 'accessing' stamp: 'jtc'!
isLeaf
entry ifNil: [ ^ false ].
^ self entry isDirectory not! !
!DirTreeNode methodsFor: 'accessing' stamp: 'jtc'!
name: n
name := n! !
"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
DirTreeNode class
instanceVariableNames: ''!
!DirTreeNode class methodsFor: 'instance creation' stamp: 'jtc'!
on: pathString
^ self new
name: (FileDirectory on: pathString)! !
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20100819/ae224cea/attachment.htm
More information about the seaside
mailing list