|
Class: HierarchicalFileList
Object
|
+--Collection
|
+--SequenceableCollection
|
+--OrderedCollection
|
+--List
|
+--HierarchicalList
|
+--HierarchicalFileList
|
+--DirectoryTreeBrowser::DirTreeBrowserHFL
- Package:
- stx:libwidg2
- Category:
- Views-Support
- Version:
- rev:
1.91
date: 2019/03/05 22:21:10
- user: cg
- file: HierarchicalFileList.st directory: libwidg2
- module: stx stc-classLibrary: libwidg2
helpers
-
forInfoItem: aItem
-
instance creation helper
-
itemFor: aFileOrDirectoryName fileType: fileType
-
instance creation helper
accessing
-
directory
-
returns the root directory or nil
-
directory: aDirectory
-
set the root directory or nil
-
directory: aDirectory expand: doExpand
-
set the root directory or nil;
reuse old items if existent
-
root: aRoot
-
(comment from inherited method)
set the root item
actions
-
matchBlock
-
set the matchBlock - if non-nil, it controls which files are visible.
-
matchBlock: aBlock
-
set the matchBlock - if non-nil, it controls which files are visible.
-
sortBlock
-
-
sortBlock: aBlock
-
private-monitoring task
-
monitoringCycle
-
-
monitoringCycle: update
-
the action performed by the monitoring task;
tests whether directory is expanded;
otherwise we do not have to evaluate the directory contents.
TODO: Think about remote file-systems
protocol
-
childrenFor: anItem
-
returns all visible children derived from the physical
directory contents.
-
hasChildrenFor: anItem
-
returns true if the physical directory contains at least
one visible item; otherwise false.
-
matchBlockFor: anItem
-
get the matchBlock - if non-nil, it controls which files are
visible within the physical directory
-
updateList
-
searching
-
findLastForFile: aPathOrFile
-
find last item which matches the path or file
returns the item or nil if not contained in self
-
findLastForFile: aPathOrFile inRoot: root directory: rootDir
-
find last item which matches the path or file
returns the item or nil if not contained in self
update
-
startIndicatorValidationFor: anItem
-
an item will be registered for an indication update
-
stopIndicatorValidationFor: anItem
-
stop the indicator validation for an item
-
updateIndicatorCycle
-
run fetching indicator (hasChildren info) task cycle.
This is done in the background to avoid long startup
delays, in case the indicator information takes long to
gather (i.e. when reading remote directories)
Directory
File
HierarchicalFileItem
RemoteDirectory
open filebrowser without monitoring cycle
|top sel list directory|
list := HierarchicalFileList new.
list showRoot:false.
list matchBlock:[:fn :isDir| true ].
directory := Filename currentDirectory.
directory := Filename homeDirectory.
list directory:(directory asAbsoluteFilename).
top := StandardSystemView new; extent:300@300.
sel := ScrollableView for:HierarchicalListView miniScroller:true
origin:0.0@0.0 corner:1.0@1.0 in:top.
sel doubleClickAction:[:i| (list at:i) toggleExpand ].
sel indicatorAction:[:i| (list at:i) toggleExpand ].
sel hasConstantHeight:true.
sel list:list.
top open.
|
open filebrowser and monitore contents
|top sel list directory|
list := HierarchicalFileList new.
list showRoot:false.
list matchBlock:[:fn :isDir| true ].
directory := Filename currentDirectory.
directory := Filename homeDirectory.
list directory:(directory asAbsoluteFilename).
top := StandardSystemView new; extent:300@300.
sel := ScrollableView for:HierarchicalListView miniScroller:true
origin:0.0@0.0 corner:1.0@1.0 in:top.
sel doubleClickAction:[:i| (list at:i) toggleExpand ].
sel indicatorAction:[:i| (list at:i) toggleExpand ].
sel hasConstantHeight:true.
sel list:list.
list monitoringTaskDelay:0.5.
top open.
|
|