ProjectBrowser.st
changeset 1098 5f4b4338a68f
parent 1097 c89241e215a4
child 1099 965cfbbf4bf2
equal deleted inserted replaced
1097:c89241e215a4 1098:5f4b4338a68f
  2302 !
  2302 !
  2303 
  2303 
  2304 loadClassesFromDirectory
  2304 loadClassesFromDirectory
  2305     "load all classes as contained in the project into the system"
  2305     "load all classes as contained in the project into the system"
  2306 
  2306 
  2307     |p ns cls|
       
  2308 
       
  2309     p := self currentProject.
       
  2310     ns := p defaultNameSpace.
       
  2311 
       
  2312     self withReadCursorDo:[
  2307     self withReadCursorDo:[
  2313         "/ read once ...
  2308         self currentProject loadClassesFromProjectDirectory.
  2314         p classInfo do:[:clsInfo |
  2309     ].
  2315             |clsName clsFileName|
       
  2316 
       
  2317             clsName := clsInfo className.
       
  2318             clsFileName := clsInfo classFileName.
       
  2319             clsFileName isNil ifTrue:[clsFileName := clsName , '.st'].
       
  2320 
       
  2321             clsName isSymbol ifTrue:[
       
  2322                 cls := ns at:clsName.
       
  2323                 cls isNil ifTrue:[
       
  2324                     "/ ok - really not yet loaded.
       
  2325                     Transcript showCR:'loading ' , (p directory asFilename construct:clsFileName) pathName , ' ...'.
       
  2326                     Smalltalk fileIn:(p directory asFilename construct:clsFileName)
       
  2327                 ] ifFalse:[
       
  2328                     self halt
       
  2329                 ].
       
  2330             ] ifFalse:[
       
  2331                 self halt
       
  2332             ].
       
  2333         ].
       
  2334 
       
  2335         "/ read again; if the load order was not correct,
       
  2336         "/ this will fix things (i.e. nil superclasses ...)
       
  2337         
       
  2338         p classInfo do:[:clsInfo |
       
  2339             |clsName clsFileName|
       
  2340 
       
  2341             clsName := clsInfo className.
       
  2342             clsFileName := clsInfo classFileName.
       
  2343             clsFileName isNil ifTrue:[clsFileName := clsName , '.st'].
       
  2344 
       
  2345             clsName isSymbol ifTrue:[
       
  2346                 Transcript showCR:'loading ' , (p directory asFilename construct:clsFileName) pathName , ' ...'.
       
  2347                 Smalltalk fileIn:(p directory asFilename construct:clsFileName)
       
  2348             ] ifFalse:[
       
  2349                 self halt
       
  2350             ].
       
  2351         ].
       
  2352     ].
       
  2353 
       
  2354     self halt.
       
  2355 
  2310 
  2356 !
  2311 !
  2357 
  2312 
  2358 loadFromProjectFile:aFilenameString
  2313 loadFromProjectFile:aFilenameString
  2359     |newProject|
  2314     |newProject|
  2450     self hasProjectNodeSelected ifTrue:[
  2405     self hasProjectNodeSelected ifTrue:[
  2451         selectedNode := self selectedTreeNode value.
  2406         selectedNode := self selectedTreeNode value.
  2452         projectToRemove := selectedNode contents.
  2407         projectToRemove := selectedNode contents.
  2453 
  2408 
  2454         (self confirm:'Really remove the project ?') ifTrue:[
  2409         (self confirm:'Really remove the project ?') ifTrue:[
  2455             self projectTreeHolder removeSelection
  2410             self withExecuteCursorDo:[
       
  2411                 self projectTreeHolder removeSelection.
       
  2412                 projectToRemove removeFromSystem.
       
  2413             ]
  2456         ]
  2414         ]
  2457     ]
  2415     ]
  2458 !
  2416 !
  2459 
  2417 
  2460 renameProject
  2418 renameProject