--- a/AbstractFileBrowser.st Fri Nov 08 11:35:52 2002 +0100
+++ b/AbstractFileBrowser.st Fri Nov 08 11:59:51 2002 +0100
@@ -2182,8 +2182,21 @@
if no file but a directory is selected it contains the directories
in contrast to currentDirectories wich have only the directories
"
-
- ^ self aspectFor:#currentFileNameHolder ifAbsent:[(OrderedCollection with:(Filename currentDirectory asAbsoluteFilename)) asValue]
+ ^ self aspectFor:#currentFileNameHolder ifAbsent:[
+ (OrderedCollection with:(Filename currentDirectory asAbsoluteFilename)) asValue
+ ] notPresentDo:[:holder|
+ | filenames newFilenames|
+ filenames := holder value.
+ newFilenames := Set new.
+ filenames do:[ : filename | | fn |
+ fn := filename.
+ [fn exists not] whileTrue:[
+ fn := fn directory.
+ ].
+ newFilenames add:fn.
+ ].
+ newFilenames asOrderedCollection.
+ ]
!
enableDirectoryUp
@@ -2225,7 +2238,7 @@
"
|holder saveAspectItem aspect|
- (holder := aspects at:something ifAbsent:nil) isNil ifTrue:[
+ holder := aspects at:something ifAbsent:[
saveAspectItem := self runtimeAspectValueFor:something.
saveAspectItem notNil ifTrue:[
saveAspectItem isHolder ifTrue:[
@@ -2248,6 +2261,35 @@
^ holder
!
+aspectFor:something ifAbsent:aBlock notPresentDo:notPresentBlock
+ "returns the model for an aspect
+ "
+ |holder saveAspectItem aspect|
+
+ holder := aspects at:something ifAbsent:[
+ saveAspectItem := self runtimeAspectValueFor:something.
+ saveAspectItem notNil ifTrue:[
+ saveAspectItem isHolder ifTrue:[
+ holder := ValueHolder with:saveAspectItem value
+ ] ifFalse:[
+ holder := saveAspectItem value
+ ].
+ ] ifFalse:[
+ aspect := self userPreferencesAspectValueFor:something.
+ aspect notNil ifTrue:[
+ holder := aspect asValue
+ ] ifFalse:[
+ holder := aBlock value.
+ ]
+ ].
+ holder notNil ifTrue:[
+ holder value:(notPresentBlock value:holder).
+ aspects at:something put:holder
+ ]
+ ].
+ ^ holder
+!
+
aspects
^ aspects
!
@@ -5266,5 +5308,5 @@
!AbstractFileBrowser class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.56 2002-11-06 10:41:32 penk Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.57 2002-11-08 10:59:51 penk Exp $'
! !