Squeak Class Documentation category index | class index  
 
FileList
  category: Tools-FileList
  superclass: StringHolder
  subclasses: PluggableFileList FileList2

I am model that can be used to navigate the host file system. By omitting the volume list, file list, and template panes from the view, I can also be used as the model for an editor on an individual file.

FileLists can now see FTP servers anywhere on the net. In the volume list menu:
fill in server info... Gives you a form to register a new ftp server you want to use.
open server... Choose a server to connect to.
local disk Go back to looking at your local volume.

Still undone (you can contribute code):
[ ] Using a Proxy server to get out through a firewall. What is the convention for proxy servers with FTP?
[ ] Fill in the date and size info in the list of remote files. Allow sorting by it. New smarts needed in (ServerDirectory fileNameFormattedFrom:sizePad:sortMode:).
[ ] Currently the FileList has no way to delete a directory. Since you can't select a directory without going into it, it would have to be deleting the current directory. Which would usually be empty.

instance methods
  file list
  fileList
fileListIndex
fileListIndex:

  file list menu
  addFileToZip
addNew:byEvaluating:
addNewDirectory
addNewFile
browseChanges
compressFile
copyName
deleteFile
editFile
fileAllIn
fileContentsMenu:shifted:
fileInSelection
fileIntoNewChangeSet
fileListMenu:
fileNameSuffix
fileSelectedMenu:
fullFileListMenu:shifted:
get
getHex
importImage
itemsForAnyFile
itemsForFileEnding:
itemsForNoFile
loadCRDictionary
loadCRDisplayProperties
noFileSelectedMenu:
offerAllFileOptions
open3DSFile
openArchiveViewer
openAsBackground
openAsFlash
openAsMovie
openAsTTF
openBookFromFile
openImageInWindow
openInBrowser
openModelintoAlice
openMorphFromFile
openProjectFromFile
openTapeFromFile
openVRMLFile
perform:orSendTo:
playMidiFile
putUpdate
removeLinefeeds
renameFile
renderFile
saveGZipContents
sortByDate
sortByName
sortBySize
spawn:
templateFile
viewGZipContents

  initialization
  directory:
labelString
modelSleep
modelWakeUp
optionalButtonHeight
optionalButtonRow
optionalButtonSpecs
optionalButtonView
release
setFileStream:

  menu messages
  browseFile
browseFiles

  private
  addPath:
contents
defaultContents
entriesMatching:
errorMustBeMorph
fileNameFromFormattedItem:
folderString
fullName
getSuffix:
put:
readContentsBrief:
readContentsHex:
readServerBrief
recentDirs
resort:
sortBlock
sortingByDate
sortingByName
sortingBySize
uncompressedFileName
updateFileList

  volume list and pattern
  askServerInfo
deleteDirectory
fileNameFormattedFrom:sizePad:
listForPattern:
pattern
pattern:
removeServer
veryDeepFixupWith:
volumeList
volumeListIndex
volumeListIndex:
volumeMenu:

class methods
  class initialization
  initialize

  instance creation
  addButtonsAndFileListPanesTo:at:plus:forFileList:
addVolumesAndPatternPanesTo:at:plus:forFileList:
defaultButtonPaneHeight
open
openAsMorph
openEditorOn:editString:
openFileDirectly
openMorphOn:editString:
prototypicalToolWindow

instance methods
  file list top  
 

fileList

Answer the list of files in the current volume.


 

fileListIndex

Answer the index of the currently selected file.


 

fileListIndex:

Select the file name having the given index, and display its contents.


  file list menu top  
 

addFileToZip

Add the currently selected file to a new zip


 

addNew:byEvaluating:

A parameterization of earlier versions of #addNewDirectory and
#addNewFile. Fixes the bug in each that pushing the cancel button
in the FillInTheBlank dialog gave a walkback.


 

addNewDirectory


 

addNewFile


 

browseChanges

Browse the selected file in fileIn format.


 

compressFile

Compress the currently selected file


 

copyName

Copy the current selector to the clipboard


 

deleteFile

Delete the currently selected file


 

editFile

Open a simple Edit window


 

fileAllIn

File in all of the currently selected file, if any.


 

fileContentsMenu:shifted:


 

fileInSelection

FileIn all of the selected file.


 

fileIntoNewChangeSet

File in all of the contents of the currently selected file,
if any, into a new change set.


 

fileListMenu:


 

fileNameSuffix


 

fileSelectedMenu:

Fill the menu with items appropriate for the selected file type, or for all file types if the shift key is down


 

fullFileListMenu:shifted:

Fill the menu with all possible items for the file list pane, regardless of selection.


 

get

Get contents of file again, it may have changed. Do this by making the cancel string be the contents, and doing a cancel.


 

getHex

Get contents of file again, and display in Hex. Do this by making the cancel string be the contents, and doing a cancel.


 

importImage

Import the given image file and store the resulting Form in the global dictionary
ImageImports, at a key consisting of the short filename up to the first period.


 

itemsForAnyFile


 

itemsForFileEnding:


 

itemsForNoFile


 

loadCRDictionary


 

loadCRDisplayProperties


 

noFileSelectedMenu:


 

offerAllFileOptions

Put up a menu offering all possible file options, whatever the suffix of the current selection may be. Specially useful if you're wanting to keep the menu up


 

open3DSFile

Open a MoviePlayerMorph on the given file (must be in .3ds format).


 

openArchiveViewer


 

openAsBackground

Set an image as a background image. Support Squeak's common file format
(GIF, JPG, PNG, 'Form stoteOn: (run coded)' and BMP)


 

openAsFlash

Open a MoviePlayerMorph on the given file (must be in .movie format).


 

openAsMovie

Open a MoviePlayerMorph on the given file (must be in .movie format).


 

openAsTTF


 

openBookFromFile

Reconstitute a Morph from the selected file, presumed to be represent
a Morph saved via the SmartRefStream mechanism, and open it in an
appropriate Morphic world


 

openImageInWindow

Handle five file formats: GIF, JPG, PNG, Form stoteOn: (run coded), and BMP.
Fail if file format is not recognized.


 

openInBrowser


 

openModelintoAlice

If a Wonderland exists, load this model into it as an actor. If it doesn't, make one first


 

openMorphFromFile

Reconstitute a Morph from the selected file, presumed to be represent a Morph saved
via the SmartRefStream mechanism, and open it in an appropriate Morphic world


 

openProjectFromFile

Reconstitute a Morph from the selected file, presumed to be represent
a Morph saved via the SmartRefStream mechanism, and open it in an
appropriate Morphic world.


 

openTapeFromFile

Open an eventRecorder tape for playback.


 

openVRMLFile


 

perform:orSendTo:

Selector was just chosen from a menu by a user. If can respond, then perform it on myself. If not, send it to otherTarget, presumably the editPane from which the menu was invoked.


 

playMidiFile

Play a MIDI file.


 

putUpdate

Put this file out as an Update on the servers.


 

removeLinefeeds

Remove any line feeds by converting to CRs instead


 

renameFile

Rename the currently selected file


 

renderFile

Render the currently selected file


 

saveGZipContents

Save the contents of a gzipped file


 

sortByDate


 

sortByName


 

sortBySize


 

spawn:

Open a simple Edit window


 

templateFile


 

viewGZipContents

View the contents of a gzipped file


  initialization top  
 

directory:

Set the path of the volume to be displayed.


 

labelString


 

modelSleep

User has exited or collapsed the window -- close any remote connection.


 

modelWakeUp

User has entered or expanded the window -- reopen any remote connection.


 

optionalButtonHeight


 

optionalButtonRow


 

optionalButtonSpecs


 

optionalButtonView


 

release

Remove references to objects that may refer to the receiver. This message
should be overridden by subclasses with any cycles, in which case the
subclass should also include the expression super release.


 

setFileStream:

Used to initialize a spawned file editor. Sets directory too.


  menu messages top  
 

browseFile


 

browseFiles


  private top  
 

addPath:

Add the given string to the list of recently visited directories.


 

contents

Answer the contents of the file, reading it first if needed.


 

defaultContents


 

entriesMatching:

Answer a list of directory entries which match the patternString.
The patternString may consist of multiple patterns separated by ';'.
Each pattern can include a '*' or '#' as wildcards - see String>>match:


 

errorMustBeMorph


 

fileNameFromFormattedItem:

Extract fileName and folderString from a formatted fileList item string


 

folderString


 

fullName

Answer the full name for the currently selected file.


 

getSuffix:


 

put:

Private - put the supplied text onto the file


 

readContentsBrief:

Read the contents of the receiver's selected file, unless it is too long, in which case show just the first 5000 characters. Don't create a file if it doesn't already exist.


 

readContentsHex:

retrieve the contents from the external file unless it is too long.
Don't create a file here. Check if exists.


 

readServerBrief

If file on server is known to be long, just read the beginning. Cheat badly by reading the fileList string.


 

recentDirs

Put up a menu and let the user select from the list of recently visited directories.


 

resort:

Re-sort the list of files.


 

sortBlock

Answer block to decide what order to display the directory entries.


 

sortingByDate


 

sortingByName


 

sortingBySize


 

uncompressedFileName


 

updateFileList

Update my files list with file names in the current directory that match the pattern.


  volume list and pattern top  
 

askServerInfo

Get the user to create a ServerDirectory for a new server. Fill in and say Accept.


 

deleteDirectory

Remove the currently selected directory


 

fileNameFormattedFrom:sizePad:

entry is a 5-element array of the form:
(name creationTime modificationTime dirFlag fileSize)


 

listForPattern:

Make the list be those file names which match the pattern.


 

pattern


 

pattern:


 

removeServer


 

veryDeepFixupWith:

I have no fields and no superclass. Catch the super call.


 

volumeList

Answer the current list of volumes.


 

volumeListIndex

Answer the index of the currently selected volume.


 

volumeListIndex:

Select the volume name having the given index.


 

volumeMenu:


class methods
  class initialization top  
 

initialize

FileList initialize


  instance creation top  
 

addButtonsAndFileListPanesTo:at:plus:forFileList:


 

addVolumesAndPatternPanesTo:at:plus:forFileList:


 

defaultButtonPaneHeight

Answer the user's preferred default height for new button panes.


 

open

Open a view of an instance of me on the default directory.


 

openAsMorph

Open a morphic view of a FileList on the default directory.


 

openEditorOn:editString:

Open an editor on the given FileStream.


 

openFileDirectly


 

openMorphOn:editString:

Open a morphic view of a FileList on the given file.


 

prototypicalToolWindow

Answer an example of myself seen in a tool window, for the benefit of parts-launching tools