diff -r 189c9cec8ce6 -r ba372586f899 UIPainter.st --- a/UIPainter.st Thu Feb 17 10:13:33 2000 +0100 +++ b/UIPainter.st Thu Feb 17 13:15:58 2000 +0100 @@ -3308,6 +3308,16 @@ ! +doGenerateAspectSelectorsMethod + "generates aspectSelectors method for the exported aspects" + + + self askForSectionModification. + + (ReadStream on:self painter generateAspectSelectorsMethod) fileIn. + +! + doGenerateHookMethods "generates hook methods for the application class" @@ -3502,12 +3512,13 @@ superclassName:specSuperclass selector:specSelector. + Transcript showCR:'generating windowSpec code...'. + code := painter generateWindowSpecMethodSource withCRs. - - Transcript showCR:'generating windowSpec code...'. - (ReadStream on:code) fileIn. + self doGenerateAspectSelectorsMethod. + self helpTool installHelpSpecsOnClass:specClass. self updateInfoLabel. @@ -3658,7 +3669,7 @@ canvasSpec "returns spec assigned to canvas" - |spec list key block exported cls canvas| + |spec list key block cls canvas modelBlock| spec := WindowSpec new. canvas := self canvas. @@ -3670,33 +3681,21 @@ ]. spec exportedAspects isNil ifTrue:[ - exported := IdentitySet new. - ( (cls := canvas className) notNil - and:[(cls := canvas resolveName:cls) notNil - and:[(list := cls perform:#aspectSelectors ifNotUnderstood:nil) notNil]] + and:[(cls := canvas resolveName:cls) notNil] ) ifTrue:[ - list do:[:el| exported add:el] + list := cls perform:#aspectSelectors ifNotUnderstood:nil. ]. - spec exportedAspects:exported. - - windowSpec notNil ifTrue:[ - windowSpec exportedAspects:(exported copy) - ]. + spec setExportedAspectsFrom:list. + windowSpec exportedAspects:(spec exportedAspects). ]. - list := OrderedCollection new. - block := [:k| - (k isSymbol and:[(list includesIdentical:k) not]) ifTrue:[list add:k] + self propertiesDo:[:aProp| |aspect entry| + spec exportedAspectsAddKey:(aProp model) type:nil. + aProp spec aspectSelectors do:[:aKey|spec exportedAspectsAddKey:aKey type:nil]. + aProp spec actionSelectors do:[:aKey|spec exportedAspectsAddKey:aKey type:#action]. ]. - - self propertiesDo:[:aProp| - block value:(aProp model). - aProp spec aspectSelectors do:block. - ]. - spec listOfExportedAspects:list. ^ spec - ! canvasSpec:aSpec @@ -3712,6 +3711,14 @@ spec setAttributesIn:(self canvas topView) with:(UIBuilder new isEditing:true). ! +exportedAspects + "returns spec assigned to canvas" + + windowSpec isNil ifTrue:[^ #()]. + ^ windowSpec exportedAspects ? #() + +! + itemOfView:aView "returns item assigned to view or nil"