ProjectView.st
changeset 259 c651fecef457
parent 217 a4b6b0d44c3b
child 265 3b1d5710e4a5
equal deleted inserted replaced
258:666b701b5c7e 259:c651fecef457
   331     box showAtPointer
   331     box showAtPointer
   332 !
   332 !
   333 
   333 
   334 projectPackage
   334 projectPackage
   335     self topView withWaitCursorDo:[
   335     self topView withWaitCursorDo:[
   336 	|box p existingPackages|
   336         |box p existingPackages allClasses|
   337 
   337 
   338 	existingPackages := Set new.
   338         existingPackages := Set new.
   339 	Smalltalk allClassesDo:[:aClass |
   339         (allClasses := Smalltalk allClasses) do:[:aClass |
   340 	    |p|
   340             |p|
   341 
   341 
   342 	    (p := aClass package) notNil ifTrue:[
   342             (p := aClass package) notNil ifTrue:[
   343 		existingPackages add:(p asString)
   343                 existingPackages add:(p asString)
   344 	    ].
   344             ].
   345 	    aClass methodArray do:[:aMethod |
   345             aClass methodArray do:[:aMethod |
   346 		(p := aMethod package) notNil ifTrue:[
   346                 (p := aMethod package) notNil ifTrue:[
   347 		    existingPackages add:(p asString)
   347                     existingPackages add:(p asString)
   348 		]
   348                 ]
   349 	    ].
   349             ].
   350 	    aClass class methodArray do:[:aMethod |
   350             aClass class methodArray do:[:aMethod |
   351 		(p := aMethod package) notNil ifTrue:[
   351                 (p := aMethod package) notNil ifTrue:[
   352 		    existingPackages add:(p asString)
   352                     existingPackages add:(p asString)
   353 		]
   353                 ]
   354 	    ].
   354             ].
   355 	].
   355         ].
   356 
   356 
   357 	box := ListSelectionBox title:'Package (new classes/methods will be put into that):'.
   357         box := ListSelectionBox title:'Package (new classes/methods will be put into that):'.
   358 	box list:(existingPackages asOrderedCollection sort).
   358         box list:(existingPackages asOrderedCollection sort).
   359 	(p := myProject packageName) notNil ifTrue:[
   359         (p := myProject packageName) notNil ifTrue:[
   360 	    box initialText:p
   360             box initialText:p
   361 	].
   361         ].
   362 	box action:[:packageName |
   362         box action:[:packageName |
   363 	    myProject packageName:packageName
   363             |someClass module directory|
   364 	].
   364 
   365 	box showAtPointer
   365             "/ (try) to extract the module & repository directory from someClass which
       
   366             "/ is already contained in that package
       
   367 
       
   368             Smalltalk allClasses 
       
   369                 detect:[:cls | 
       
   370                                 |info|
       
   371 
       
   372                                 (cls package = packageName) ifTrue:[
       
   373                                     (info := cls packageSourceCodeInfo) notNil ifTrue:[
       
   374                                         module := info at:#module ifAbsent:nil.
       
   375                                         directory := info at:#directory ifAbsent:nil.
       
   376                                     ]
       
   377                                 ].
       
   378                                 module notNil and:[directory notNil].
       
   379                           ].
       
   380 
       
   381             module notNil ifTrue:[
       
   382                 myProject repositoryModule:module
       
   383             ].
       
   384             directory notNil ifTrue:[
       
   385                 myProject repositoryDirectory:directory
       
   386             ].
       
   387             myProject packageName:packageName.
       
   388 
       
   389         ].
       
   390         box showAtPointer
   366     ]
   391     ]
       
   392 
       
   393     "Created: 9.12.1995 / 16:50:45 / cg"
       
   394     "Modified: 9.12.1995 / 17:13:22 / cg"
   367 !
   395 !
   368 
   396 
   369 projectRepository
   397 projectRepository
   370     |box d|
   398     |box d|
   371 
   399 
   525 ! !
   553 ! !
   526 
   554 
   527 !ProjectView class methodsFor:'documentation'!
   555 !ProjectView class methodsFor:'documentation'!
   528 
   556 
   529 version
   557 version
   530 ^ '$Header: /cvs/stx/stx/libtool/ProjectView.st,v 1.21 1995-11-25 18:04:47 cg Exp $'! !
   558 ^ '$Header: /cvs/stx/stx/libtool/ProjectView.st,v 1.22 1995-12-09 17:41:15 cg Exp $'! !