3379 |
3379 |
3380 (methods := self painter aspectMethods) isEmpty ifTrue:[ |
3380 (methods := self painter aspectMethods) isEmpty ifTrue:[ |
3381 self warn:'No aspect methods found !!'. |
3381 self warn:'No aspect methods found !!'. |
3382 ^ self. |
3382 ^ self. |
3383 ]. |
3383 ]. |
3384 UserPreferences systemBrowserClass browseMethods:methods title:'Aspect methods'. |
3384 UserPreferences systemBrowserClass |
|
3385 browseMethods:methods |
|
3386 title:'Aspect methods'. |
3385 ! |
3387 ! |
3386 |
3388 |
3387 doBrowseClass |
3389 doBrowseClass |
3388 "opens a System Browser on the specClass" |
3390 "opens a System Browser on the specClass" |
3389 |
3391 |
3516 ]. |
3519 ]. |
3517 |
3520 |
3518 displayedList := aspectList collect:[:entry | (((entry first) paddedTo:25) contractTo:25) , ' -> ' , entry second ]. |
3521 displayedList := aspectList collect:[:entry | (((entry first) paddedTo:25) contractTo:25) , ' -> ' , entry second ]. |
3519 aspectList := aspectList collect:[:each | each first]. |
3522 aspectList := aspectList collect:[:each | each first]. |
3520 |
3523 |
|
3524 doBrowse := false. |
3521 selectorsToGenerateCode := Dialog |
3525 selectorsToGenerateCode := Dialog |
3522 chooseMultiple:'Select aspect(s) for which code shall be generated:' |
3526 choose:'Select aspect(s) for which code shall be generated:' |
3523 fromList:displayedList |
3527 fromList:displayedList |
3524 values:aspectList |
3528 values:aspectList |
3525 initialSelection:nil |
3529 initialSelection:nil |
3526 lines:15. |
3530 buttons:nil |
|
3531 values:nil |
|
3532 lines:15 |
|
3533 cancel:nil |
|
3534 multiple:true |
|
3535 postBuildBlock:[:dialog | |
|
3536 |b| |
|
3537 |
|
3538 b := Button label:'Generate & Browse'. |
|
3539 b action:[doBrowse := true. dialog okPressed]. |
|
3540 b := dialog addButton:b before:dialog okButton. |
|
3541 ]. |
3527 |
3542 |
3528 selectorsToGenerateCode isEmptyOrNil ifTrue:[^ self]. |
3543 selectorsToGenerateCode isEmptyOrNil ifTrue:[^ self]. |
3529 |
3544 |
3530 code := self painter generateAspectMethodCodeFiltering:selectorsToGenerateCode. |
3545 code := self painter generateAspectMethodCodeFiltering:selectorsToGenerateCode. |
3531 code readStream fileIn. |
3546 code readStream fileIn. |
|
3547 |
|
3548 doBrowse ifTrue:[ |
|
3549 methods := selectorsToGenerateCode |
|
3550 collect:[:sel | cls compiledMethodAt:sel] |
|
3551 thenSelect:[:m | m notNil]. |
|
3552 |
|
3553 UserPreferences systemBrowserClass |
|
3554 browseMethods:methods |
|
3555 title:'Some Aspect methods'. |
|
3556 ]. |
3532 ! |
3557 ! |
3533 |
3558 |
3534 doGenerateAspectMethods |
3559 doGenerateAspectMethods |
3535 "generates aspect and action methods for the application class" |
3560 "generates aspect and action methods for the application class" |
3536 |
3561 |