eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'DirectoryContentsBrowser':

Home

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

Class: DirectoryContentsBrowser


Inheritance:

   Object
   |
   +--Model
      |
      +--ApplicationModel
         |
         +--ApplicationWithFileHistory
            |
            +--AbstractFileBrowser
               |
               +--AbstractDirectoryBrowser
                  |
                  +--DirectoryContentsBrowser

Package:
stx:libtool
Category:
Interface-Tools-File
Version:
rev: 1.336 date: 2023/07/05 22:21:01
user: cg
file: DirectoryContentsBrowser.st directory: libtool
module: stx stc-classLibrary: libtool

Description:


An application for displaying a directories' contents flat (or as a tree, alternatively).
To be used as a building block in file browsers and fileSelection dialogs.
This is used as the top-right component in the new fileBrowser.

copyright

COPYRIGHT (c) 2002 by eXept Software AG All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

Class protocol:

classAccess
o  itemClass
self itemClass

constants
o  updateTaskCyleTime
time to check for changed directories or changed columns
(unless triggered by an action)

o  updateTaskPriority
priority of the update task

image specs
o  detailsMenuIconDown

o  detailsMenuIconR
This resource specification was automatically generated
by the ImageEditor of ST/X.

Usage example(s):

     self detailsMenuIconR inspect
     ImageEditor openOnClass:self andSelector:#detailsMenuIconR
     Icon flushCachedIcons

o  detailsMenuIconUp

instance creation
o  openIn: aDirectory
open a standalone broser for a directory

Usage example(s):

      self openIn:'.cvsignore' asFilename

o  openIn: aDirectory withDirectories: withDirectoriesBoolean
open a broswer (standalone) for a directory

Usage example(s):

      self openIn:Filename currentDirectory withDirectories:true

interface specs
o  tableColumns
This resource specification was automatically generated
by the DataSetBuilder of ST/X.

Usage example(s):

     DataSetBuilder new openOnClass:DirectoryContentsBrowser andSelector:#tableColumns

o  windowSpec
This resource specification was automatically generated
by the UIPainter of ST/X.

Usage example(s):

     UIPainter new openOnClass:DirectoryContentsBrowser andSelector:#windowSpec
     DirectoryContentsBrowser new openInterface:#windowSpec
     DirectoryContentsBrowser open

menu specs
o  directoryContentsBrowserMenu
This resource specification was automatically generated
by the MenuEditor of ST/X.

Usage example(s):

     MenuEditor new openOnClass:DirectoryContentsBrowser andSelector:#directoryContentsBrowserMenu
     (Menu new fromLiteralArrayEncoding:(DirectoryContentsBrowser directoryContentsBrowserMenu)) startUp

o  viewBrowserMenu
This resource specification was automatically generated
by the MenuEditor of ST/X.

Usage example(s):

     MenuEditor new openOnClass:DirectoryContentsBrowser andSelector:#viewBrowserMenu
     (Menu new fromLiteralArrayEncoding:(DirectoryContentsBrowser viewBrowserMenu)) startUp

o  viewBrowserMenuSpec
This resource specification was automatically generated
by the MenuEditor of ST/X.

Usage example(s):

     MenuEditor new openOnClass:DirectoryContentsBrowser andSelector:#viewBrowserMenuSpec
     (Menu new fromLiteralArrayEncoding:(DirectoryContentsBrowser viewBrowserMenuSpec)) startUp


Instance protocol:

accessing
o  allItems

o  allItems: something

o  browserFileList

o  columnDescriptors
get the column description

o  columnDescriptors: aListOfColumns
set the column description

o  directory
returns the current directory or nil

o  directory: aDirectory
change the current directory and read the items

o  directoryChangeFlag

o  directoryChangeFlag: aBoolean

o  directoryContentsChangeFlag
return the value of the instance variable 'directoryContentsChangeFlag' (automatically generated)

o  directoryContentsChangeFlag: aBoolean
set the value of the instance variable 'directoryContentsChangeFlag' (automatically generated)

o  doubleClickAction

o  doubleClickAction: aBlock
aBlock is a one arg block with selected index as argument

o  enterActionBlock

o  enterActionBlock: aBlock

o  filterChangeFlag
return the value of the instance variable 'filterChangeFlag' (automatically generated)

o  filterChangeFlag: aBoolean
set the value of the instance variable 'filterChangeFlag' (automatically generated)

o  isBusy
return the value of the instance variable 'isBusy' (automatically generated)

o  isBusy: something
set the value of the instance variable 'isBusy' (automatically generated)

o  matchBlock
return the value of the instance variable 'matchBlock' (automatically generated)

o  matchBlock: filterBlock

o  multipleSelect

o  multipleSelect: aBoolean

o  sortBlockChangeFlag
return the value of the instance variable 'sortBlockChangeFlag' (automatically generated)

o  sortBlockChangeFlag: aBoolean
set the value of the instance variable 'sortBlockChangeFlag' (automatically generated)

o  updateContentsSelection
return the value of the instance variable 'updateToExternFileHolder' (automatically generated)

o  updateCurrentFileNameHolderWhenSelectionChanges

o  updateCurrentFileNameHolderWhenSelectionChanges: aBoolean

actions
o  browserItemListAdd: addItemCol remove: remItemCol

o  currentSortOrderChanged
self wakeUpForSortBlockChanged.

o  doResizeImage
Processor activeProcess ~~ self windowGroup process ifTrue:[self halt].

o  doUpdate
DirectoryContents flushCache.

o  doUpdateDirectoryContents
DirectoryContents flushCache.

o  doubleClickedAt: anItemIndex
self withWaitCursorDo:[

o  enterActionFor: anItem
self withWaitCursorDo:[

o  enterActionForCurrentSelectedFile

o  noOfShownFiles: noOfShownFiles noOfFiles: noOfFiles

o  setBrowserItemList: aFilteredItems
directories first

o  updateDiskUsage

aspects
o  browserItemList

o  currentDirectoryDisplayed
Return the directory as Filename that is currently being displayed in the browser

o  hasTwoImageFilesSelected

o  selectionInFileList

o  tableColumns

o  valueHolderForColumn: id
xlate #suffix -> viewType, etc...
i.e. for a columns readSelector, return my valueHolder

o  viewFileInfoString

o  viewSizeInBytesString

o  viewSizeInKiloBytesString

o  viewSizeString

o  viewSuffix

o  viewTimeAndDate

aspects-visibility
o  colVisibilityAspectFor: aKey ifAbsent: absentBlock
aspect for a columns visibility

o  viewDescription
aspect for show file description

o  viewDetails
aspect for show more file properties

o  viewGroup
aspect for show group information

o  viewIcon
aspect for show file-type icon

o  viewInodeNumber
aspect for show inode number

o  viewMimeType
aspect for show mimeType

o  viewOwner
aspect for show owner information

o  viewPermissions
aspect for show permission information

o  viewPreview
aspect for show image previev

o  viewSize
aspect for show-size information

o  viewSizeInBytes
aspect for show size-in-bytes information

o  viewSizeInKiloBytes
aspect for show size-in-kilobytes information

o  viewTime
aspect for show time information

o  viewType
aspect for show suffix (type) information

change & update
o  currentFileNameHolderChanged
filename changed

o  filterBlockHolderChanged

o  selectionChanged

o  update: something with: aParameter from: changedObject
one of my models changed

o  updateListAfterDelete: collectionOfFiles
to force update of the numberOfShown files.

o  viewPreviewChanged

o  viewedColumnsChanged

drag & drop
o  doStartDrag: aDropSource in: aView
set the cursors before starting the drag & drop operation

o  dropDestinationPath

o  dropObjects: aCollectionOfDropObjects
drop manager wants to drop.
This is only sent, if #canDrop: returned true.
Must be redefined in order for drop to work.

o  dropOver: aDropContext
called during drag & drop while moving over the widget.

o  dropTargetItemChangedTo: anItem in: aDropContext
(anItem notNil and:[anItem isDirectory]) ifTrue:[ self halt].

o  getDisplayObjects: anArgument
Modified (format): / 20-06-2017 / 08:17:43 / cg

event handling
o  processEvent: anEvent
filter keyboard events.
Return true, if I have eaten the event

initialization
o  initialize

menu accessing
o  viewBrowserMenu

menu actions
o  doShowFileContents

o  enterAction

queries
o  allItemsOfCurrentDirectory
remove the '..' item

o  fileListIsEmpty

o  getAllFilesAsStrings
(comment from inherited method)
raise an error: must be redefined in concrete subclass(es)

o  hasFilesFiltered

selection
o  selectAll

o  selectCurrentFiles

o  selectFiles: aColOfFilenames
nothing changed

o  selectItems: aColOfItems
| curSel newSel|

o  selectNextFile

o  selectPreviousFile

o  selectedFileItems

o  selectedFileNames

o  selectedFiles

o  selectedItems

o  selectedItemsWithoutDotDotDirectory

startup & release
o  makeDependent

o  postBuildBrowser: aWidget
don't register icons anymore

o  postOpenFromMaster: fromMaster

o  release
release my resources

o  releaseAsSubCanvas
(comment from inherited method)
a subcanvas is closed or switching to a new application.
Can be redefined to perform a self release in this case.

update columns cycle
o  findNextItemFor: aConditionBlock
^ self allItems detect:aBlock ifNone:[nil].

o  findNextVisibleItemFor: aConditionBlock
possible race condition - item removed from browserItemList

o  getFileInfoFor: anItem

o  getIconFor: anItem
do not query attributes

o  getIconForMimeType: mime for: anItem

o  getIconForMimeTypeByContents: anItem

o  getPreviewFor: anItem
there is no preview column

o  updateColumnsCycle
update items in the following order
- update item if item properties are changed
- update icon for visible items by suffix
- update icon for visible items by contents
- update file info for visible items if file info column is shown
- update preview for visible items if preview column is shown

- update icon for invisible items by suffix
- update icon for invisible items by contents
- update file info for invisible items if file info column is shown
- update preview for invisible items if preview column is shown
- update file info for invisible items if file info column is not shown
Return true, if more is to be done.

update task
o  createItemList
reread the whole list of items

o  debugMessage: aString
Debug := true
Debug := false

o  directoryChanged
reread the whole list of items

o  directoryContentsChanged
updatingColumns := true.

o  evaluateFilter: anItemsList
return filtered items from anItemsList

o  filterChanged

o  modificationCycle
directory vanished

o  readDirectoryItems

o  sortBlockChanged
Modified (format): / 09-04-2017 / 22:18:33 / cg

o  startUpdateTask

o  stopUpdateTask

o  updateAfterTimeout: hereDueToTimeOut
Transcript showCR:'START'.

o  updateStep
no update while scrolling

update task trigger
o  wakeUp
the updateTask might be nil or dead....

o  wakeUpForDirectoryChanged

o  wakeUpForDirectoryContentsChanged

o  wakeUpForFilterChanged

o  wakeUpForSortBlockChanged

update task-disk usage
o  diskUsageInKiloBytesFor: aDirectory

o  flushRememberedDiskUsageInfo

o  flushRememberedDiskUsageInfoFor: aDirectory

o  isDiskUsageInfoStillValid: infoForDirectory for: aDirectoryPath
only update info every 30 seconds

o  showDiskUsageInfoFor: aDirectory as: kiloBytes
pathName

o  startDiskUsageInfoProcess
self notify:'Symbolic link to: ' , (info path ? '') allBold

o  startDiskUsageInfoProcessFor: selectedFile


Private classes:

    DirectoryContentsItem

Examples:


    DirectoryContentsBrowser openIn:Filename currentDirectory


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 21 Dec 2024 13:09:36 GMT