--- a/FileBrowser.st Wed Jul 31 17:38:35 2002 +0200
+++ b/FileBrowser.st Wed Jul 31 21:46:10 2002 +0200
@@ -2188,6 +2188,89 @@
self fileFileInLazy:false
!
+fileFileIn:fileName lazy:lazy
+ "fileIn fileName"
+
+ |aStream path wasLazy prevCurrentFileName|
+
+ path := currentDirectory filenameFor:fileName.
+ path type == #regular ifTrue:[
+ prevCurrentFileName := currentFileInFileName.
+ currentFileInFileName := fileName.
+
+ (ObjectFileLoader notNil
+ and:[ObjectFileLoader hasValidBinaryExtension:fileName]) ifTrue:[
+ AbortOperationRequest catch:[
+ |p|
+
+ "/
+ "/ look if already loaded ... then unload first
+ "/
+ p := path pathName.
+ (ObjectFileLoader loadedObjectFiles includes:p) ifTrue:[
+ (Dialog confirm:(resources
+ string:'%1 is already loaded; load anyway ?'
+ with:p)) ifFalse:[
+ ^ self
+ ].
+ Transcript showCR:'unloading old ' , p , ' ...'.
+ ObjectFileLoader unloadObjectFile:p.
+ ].
+
+ Transcript showCR:'loading ' , p , ' ...'.
+ ObjectFileLoader loadObjectFile:p.
+ Class addInfoRecord:('fileIn ' , fileName)
+ ]
+ ] ifFalse:[ ((path hasSuffix:'cls')
+ and:[((path mimeTypeOfContents ? '') startsWith:'application/x-smalltalk-source') not ]) ifTrue:[
+ "/ loading a binary class file
+ aStream := path readStream.
+ aStream notNil ifTrue:[
+ aStream fileInBinary.
+ ]
+ ] ifFalse:[
+ ((path hasSuffix:'class')
+ or:[(path hasSuffix:'cla')]) ifTrue:[
+ "/ loading a java class file
+ JavaClassReader notNil ifTrue:[
+ JavaClassReader loadFile:(path pathName)
+ ]
+ ] ifFalse:[ (path hasSuffix:'sif') ifTrue:[
+ "/ loading a sif (smalltalk interchange format) file
+ SmalltalkInterchangeSTXFileInManager autoload.
+ SmalltalkInterchangeFileManager newForFileIn
+ fileName: path pathName;
+ fileIn.
+ ] ifFalse:[ (path hasSuffix:'pcl') ifTrue:[
+ Parcel isNil ifTrue:[
+ self warn:'Parcel support not loaded.'
+ ] ifFalse:[
+ Parcel loadParcelFrom: path pathName
+ ]
+ ] ifFalse:[
+ "/ loading a regular (chunk) or xml source file
+ aStream := path readStream.
+ aStream notNil ifTrue:[
+ [
+ Class withoutUpdatingChangesDo:[
+ wasLazy := Compiler compileLazy:lazy.
+ aStream fileIn.
+ ].
+ Class addInfoRecord:('fileIn ' , fileName)
+ ] ensure:[
+ Compiler compileLazy:wasLazy.
+ aStream close
+ ]
+ ]
+ ]]]
+ ]]
+ ].
+ currentFileInFileName := prevCurrentFileName
+
+ "Modified: / 19.9.1997 / 23:42:22 / stefan"
+ "Modified: / 16.11.2001 / 17:38:34 / cg"
+!
+
fileFileInLazy
"fileIn the selected file(s). Do a quick load (no compilation)"
@@ -2197,82 +2280,20 @@
fileFileInLazy:lazy
"fileIn the selected file(s)"
- |aStream path wasLazy prevCurrentFileName|
+
+ fileListView selection size > 1 ifTrue:[
+ AbortAllSignal catch:[
+ self selectedFilesDo:[:fileName |
+ AbortSignal catch:[
+ self fileFileIn:fileName lazy:lazy.
+ ]
+ ]
+ ].
+ ^ self.
+ ].
self selectedFilesDo:[:fileName |
- path := currentDirectory filenameFor:fileName.
- path type == #regular ifTrue:[
- prevCurrentFileName := currentFileInFileName.
- currentFileInFileName := fileName.
-
- (ObjectFileLoader notNil
- and:[ObjectFileLoader hasValidBinaryExtension:fileName]) ifTrue:[
- AbortOperationRequest catch:[
- |p|
-
- "/
- "/ look if already loaded ... then unload first
- "/
- p := path pathName.
- (ObjectFileLoader loadedObjectFiles includes:p) ifTrue:[
- (Dialog confirm:(resources
- string:'%1 is already loaded; load anyway ?'
- with:p)) ifFalse:[
- ^ self
- ].
- Transcript showCR:'unloading old ' , p , ' ...'.
- ObjectFileLoader unloadObjectFile:p.
- ].
-
- Transcript showCR:'loading ' , p , ' ...'.
- ObjectFileLoader loadObjectFile:p.
- Class addInfoRecord:('fileIn ' , fileName)
- ]
- ] ifFalse:[ ((path hasSuffix:'cls')
- and:[((path mimeTypeOfContents ? '') startsWith:'application/x-smalltalk-source') not ]) ifTrue:[
- "/ loading a binary class file
- aStream := path readStream.
- aStream notNil ifTrue:[
- aStream fileInBinary.
- ]
- ] ifFalse:[
- ((path hasSuffix:'class')
- or:[(path hasSuffix:'cla')]) ifTrue:[
- "/ loading a java class file
- JavaClassReader notNil ifTrue:[
- JavaClassReader loadFile:(path pathName)
- ]
- ] ifFalse:[ (path hasSuffix:'sif') ifTrue:[
- "/ loading a sif (smalltalk interchange format) file
- SmalltalkInterchangeSTXFileInManager autoload.
- SmalltalkInterchangeFileManager newForFileIn
- fileName: path pathName;
- fileIn.
- ] ifFalse:[ (path hasSuffix:'pcl') ifTrue:[
- Parcel isNil ifTrue:[
- self warn:'Parcel support not loaded.'
- ] ifFalse:[
- Parcel loadParcelFrom: path pathName
- ]
- ] ifFalse:[
- "/ loading a regular (chunk) or xml source file
- aStream := path readStream.
- aStream notNil ifTrue:[
- [
- Class withoutUpdatingChangesDo:[
- wasLazy := Compiler compileLazy:lazy.
- aStream fileIn.
- ].
- Class addInfoRecord:('fileIn ' , fileName)
- ] ensure:[
- Compiler compileLazy:wasLazy.
- aStream close
- ]
- ]
- ]]]
- ]]
- ].
- currentFileInFileName := prevCurrentFileName
+ self fileFileIn:fileName lazy:lazy.
]
"Modified: / 19.9.1997 / 23:42:22 / stefan"
@@ -7889,5 +7910,5 @@
!FileBrowser class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libtool/FileBrowser.st,v 1.481 2002-07-31 15:38:35 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/FileBrowser.st,v 1.482 2002-07-31 19:46:10 cg Exp $'
! !