*** smalltalk-2.0k.ori/browser/NamespBrow.st Thu Jan 9 14:43:07 2003 --- smalltalk-2.0k/browser/NamespBrow.st Sat Mar 1 11:48:28 2003 *************** blueButtonMenuForNamespaces: theView *** 112,117 **** --- 112,118 ---- ^(PopupMenu new: theView label: 'Namespace') selectors: #(#('File out...' #fileOutNamespace: #theView) #('Update' #updateNamespaceList) + #() #('File into namespace' #fileIntoNamespace: #theView) #() #('Namespaces' #namespaces: #theView) #('Categories' #categories: #theView) #() #('Rename...' #renameNamespace: #theView)) receiver: self *************** categories: namespaceList *** 121,126 **** --- 122,146 ---- namespaceList canChangeState ifFalse: [^self]. self byCategory: true! + fileIntoNamespace: listView + "File in a file to a currently selected namespace" + + | oldCurrent className fileName stream | + curNamespace isNil ifTrue: [^listView beep]. + + fileName := Prompter + openFileName: 'Which file do you want me to read?' + default: '*.st' + in: listView. + fileName isNil + ifFalse: [ FileStream fileIn: fileName ] ifTrue: [ ^listView beep ]. + + oldCurrent := Namespace current. + + Namespace current: curNamespace. + FileStream fileIn: fileName. + Namespace current: oldCurrent. + fileoutName byCategory ifTrue: [^curNamespace]. ^((curNamespace nameIn: Smalltalk) asString)