eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'HierarchicalFileList':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: HierarchicalFileList


Inheritance:

   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

Class protocol:

helpers
o  forInfoItem: aItem
instance creation helper

o  itemFor: aFileOrDirectoryName fileType: fileType
instance creation helper


Instance protocol:

accessing
o  directory
returns the root directory or nil

o  directory: aDirectory
set the root directory or nil

o  directory: aDirectory expand: doExpand
set the root directory or nil;
reuse old items if existent

o  root: aRoot
(comment from inherited method)
set the root item

actions
o  matchBlock
set the matchBlock - if non-nil, it controls which files are visible.

o  matchBlock: aBlock
set the matchBlock - if non-nil, it controls which files are visible.

o  sortBlock

o  sortBlock: aBlock

private-monitoring task
o  monitoringCycle

o  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
o  childrenFor: anItem
returns all visible children derived from the physical
directory contents.

o  hasChildrenFor: anItem
returns true if the physical directory contains at least
one visible item; otherwise false.

o  matchBlockFor: anItem
get the matchBlock - if non-nil, it controls which files are
visible within the physical directory

o  updateList

searching
o  findLastForFile: aPathOrFile
find last item which matches the path or file
returns the item or nil if not contained in self

o  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
o  startIndicatorValidationFor: anItem
an item will be registered for an indication update

o  stopIndicatorValidationFor: anItem
stop the indicator validation for an item

o  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)


Private classes:

    Directory
    File
    HierarchicalFileItem
    RemoteDirectory

Examples:


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.


ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Tue, 19 Mar 2024 08:49:32 GMT