FilenameEditField.st
changeset 2717 f5738b80c8ca
parent 2584 5b3da940cb71
child 3195 39debbeac7d5
equal deleted inserted replaced
2716:c446689e8021 2717:f5738b80c8ca
   167                 oldContents := ''
   167                 oldContents := ''
   168             ] ifFalse:[
   168             ] ifFalse:[
   169                 oldContents := oldContents asString
   169                 oldContents := oldContents asString
   170             ].
   170             ].
   171 
   171 
   172             entryCompletionBlock value:oldContents.
   172             self entryCompletionBlock value:oldContents.
   173 
   173 
   174             newContents := self contents.
   174             newContents := self contents.
   175             newContents isNil ifTrue:[
   175             newContents isNil ifTrue:[
   176                 newContents := ''
   176                 newContents := ''
   177             ] ifFalse:[
   177             ] ifFalse:[
   198 
   198 
   199     acceptOnExpand := true.
   199     acceptOnExpand := true.
   200     directoriesOnly := filesOnly := false.
   200     directoriesOnly := filesOnly := false.
   201     directory := Filename currentDirectory.
   201     directory := Filename currentDirectory.
   202 
   202 
   203     entryCompletionBlock := [:contents |
   203     self 
   204         |newString isMultiMatch canonContents|
   204         entryCompletionBlock:[:contents |
   205 
   205             |newString isMultiMatch canonContents|
   206         isMultiMatch := false.
   206 
   207         canonContents := Filename canonicalize:contents.
   207             isMultiMatch := false.
   208         newString := Filename 
   208             canonContents := Filename canonicalize:contents.
   209                         filenameCompletionFor:canonContents 
   209             newString := Filename 
   210                         directory:directory 
   210                             filenameCompletionFor:canonContents 
   211                         directoriesOnly:directoriesOnly 
   211                             directory:directory 
   212                         filesOnly:filesOnly 
   212                             directoriesOnly:directoriesOnly 
   213                         ifMultiple:[:dir |
   213                             filesOnly:filesOnly 
   214 "/                            dir asFilename isDirectory ifTrue:[
   214                             ifMultiple:[:dir |
   215 "/                                self changed:#directory with:dir.
   215 "/                                dir asFilename isDirectory ifTrue:[
   216 "/                            ].
   216 "/                                    self changed:#directory with:dir.
   217                             isMultiMatch := true.
   217 "/                                ].
   218                             self flash.
   218                                 isMultiMatch := true.
   219                         ].
   219                                 self flash.
   220         newString asFilename pathName = canonContents ifTrue:[
   220                             ].
   221             self flash.
   221             newString asFilename pathName = canonContents ifTrue:[
       
   222                 self flash.
       
   223             ].
       
   224 
       
   225             self contents:newString addSeparatorToDirectories:isMultiMatch not.
       
   226             self cursorToEndOfLine.
   222         ].
   227         ].
   223 
       
   224         self contents:newString addSeparatorToDirectories:isMultiMatch not.
       
   225         self cursorToEndOfLine.
       
   226     ].
       
   227 
   228 
   228     "Modified: 7.9.1995 / 10:20:46 / claus"
   229     "Modified: 7.9.1995 / 10:20:46 / claus"
   229     "Modified: 7.9.1997 / 23:51:47 / cg"
   230     "Modified: 7.9.1997 / 23:51:47 / cg"
   230 !
   231 !
   231 
   232 
   239 ! !
   240 ! !
   240 
   241 
   241 !FilenameEditField class methodsFor:'documentation'!
   242 !FilenameEditField class methodsFor:'documentation'!
   242 
   243 
   243 version
   244 version
   244     ^ '$Header: /cvs/stx/stx/libwidg2/FilenameEditField.st,v 1.31 2003-11-19 12:13:56 cg Exp $'
   245     ^ '$Header: /cvs/stx/stx/libwidg2/FilenameEditField.st,v 1.32 2004-06-09 15:19:52 cg Exp $'
   245 ! !
   246 ! !