UIPainterView.st
changeset 310 a68c182d050f
parent 288 675327dd4d7d
child 312 386932d91a97
equal deleted inserted replaced
309:c59bbc7a0a85 310:a68c182d050f
   524 
   524 
   525 
   525 
   526 !
   526 !
   527 
   527 
   528 generateWindowSpecMethodSource
   528 generateWindowSpecMethodSource
   529     |spec specArray str code category cls mthd|
   529     |spec str code category cls mthd|
   530 
   530 
   531     specArray := OrderedCollection new.
   531     spec := OrderedCollection new.
   532 
   532 
   533     self subViews do:[:aView|
   533     self subViews do:[:aView|
   534         aView ~~ inputView ifTrue:[
   534         aView ~~ inputView ifTrue:[
   535             specArray add:(self fullSpecFor:aView)
   535             spec add:(self fullSpecFor:aView)
   536         ]
   536         ]
   537     ].
   537     ].
   538     spec := FullSpec new.
   538     spec := treeView generateFullSpecForComponents:spec.
   539     spec fromBuilder:self topView components:(SpecCollection new collection:specArray).
   539     str  := WriteStream on:String new.
   540     specArray := spec literalArrayEncoding.
   540     UISpecification prettyPrintSpecArray:spec on:str indent:5.
   541 
       
   542     str := WriteStream on:String new.
       
   543     UISpecification prettyPrintSpecArray:specArray on:str indent:5.
       
   544 
   541 
   545     "/ if that method already exists, do not overwrite the category
   542     "/ if that method already exists, do not overwrite the category
   546 
   543 
   547     category := 'interface specs'.
   544     category := 'interface specs'.
   548     (cls := Smalltalk classNamed:className) notNil ifTrue:[
   545     (cls := Smalltalk classNamed:className) notNil ifTrue:[
   606         builder := UIBuilder new.
   603         builder := UIBuilder new.
   607         spec window setupView:self topView for:builder.
   604         spec window setupView:self topView for:builder.
   608         self addSpec:(spec component) builder:builder in:self.
   605         self addSpec:(spec component) builder:builder in:self.
   609         self realizeAllSubViews.
   606         self realizeAllSubViews.
   610         inputView raise.
   607         inputView raise.
   611         treeView canvasNameChanged:(spec window name).
   608         treeView setAttributesFromWindowSpec:(spec window).
   612     ]
   609     ]
   613 !
   610 !
   614 
   611 
   615 treeView:aTreeView
   612 treeView:aTreeView
   616     treeView := aTreeView
   613     treeView := aTreeView
   963     "update current selected view from specification
   960     "update current selected view from specification
   964     "
   961     "
   965     |props name builder v|
   962     |props name builder v|
   966 
   963 
   967     aSpec class == WindowSpec ifTrue:[
   964     aSpec class == WindowSpec ifTrue:[
   968         aSpec setAttributesIn:self topView with:(UIBuilder new).
   965         ^ treeView canvasSpec:aSpec
   969         ^ treeView canvasNameChanged:aSpec name.
       
   970     ].
   966     ].
   971 
   967 
   972     self singleSelection notNil ifTrue:[
   968     self singleSelection notNil ifTrue:[
   973         self withSelectionHiddenDo:[
   969         self withSelectionHiddenDo:[
   974             self transaction:#specification selectionDo:[:aView|
   970             self transaction:#specification selectionDo:[:aView|