# HG changeset patch # User Claus Gittinger # Date 931381099 -7200 # Node ID 7b5f408228195ff21ebd66a88958a657e7566bee # Parent e22253cb348f93c92d9e9e4390dfdd96981cc7ff code cleanup diff -r e22253cb348f -r 7b5f40822819 UIPainterView.st --- a/UIPainterView.st Wed Jul 07 22:56:56 1999 +0200 +++ b/UIPainterView.st Wed Jul 07 22:58:19 1999 +0200 @@ -1639,11 +1639,20 @@ ! -rebuildView:aView fromSpec:aSpec withBuilder:aBuilder - |v| +rebuildView:aView fromSpec:aSpec withBuilder:aBuilderOrNil + |v builder| + + (builder := aBuilderOrNil) isNil ifTrue:[ + "/ create a dummy builder + builder := UIBuilder new isEditing:true. + className notNil ifTrue:[ + builder applicationClass:(self resolveName:className). + ]. + ]. aSpec needsRebuildForAttributes ifTrue:[ - v := aSpec buildViewWithLayoutFor:aBuilder in:(self findContainerOfView:aView). + "/ needs a full rebuild (in case view class depends upon spec-attribute) + v := aSpec buildViewWithLayoutFor:builder in:(self findContainerOfView:aView). v realize. aView destroy. device sync. @@ -1651,7 +1660,7 @@ aView becomeSameAs:v. inputView raise. ] ifFalse:[ - aSpec setAttributesIn:aView with:aBuilder. + aSpec setAttributesIn:aView with:builder. self elementChangedSize:aView. ]. @@ -1683,7 +1692,7 @@ updateFromSpec:aSpec "update current selected view from specification " - |props name builder| + |props name| aSpec class == WindowSpec ifTrue:[ ^ treeView canvasSpec:aSpec @@ -1692,10 +1701,6 @@ self singleSelection notNil ifTrue:[ self withSelectionHiddenDo:[ self transaction:#specification selectionDo:[:aView| - builder := UIBuilder new isEditing:true. - className notNil ifTrue:[ - builder applicationClass:(self resolveName:className). - ]. props := self propertyOfView:aView. name := (aSpec name) withoutSeparators. @@ -1706,7 +1711,7 @@ ]. aSpec name:name. self createUndoSpecModify:props. - self rebuildView:aView fromSpec:aSpec withBuilder:builder. + self rebuildView:aView fromSpec:aSpec withBuilder:nil. props spec:(aSpec copy). treeView propertyChanged:props. ] @@ -1892,20 +1897,16 @@ undoSpecModify:args "undo method when changing a spec; see 'createUndoSpecModify:' " - |builder view spec props| + |view spec props| props := self propertyOfIdentifier:(args at:2). props notNil ifTrue:[ view := props view. spec := args at:1. - builder := UIBuilder new isEditing:true. - className notNil ifTrue:[ - builder applicationClass:(self resolveName:className). - ]. props spec:spec. - self rebuildView:view fromSpec:spec withBuilder:builder. + self rebuildView:view fromSpec:spec withBuilder:nil. treeView propertyChanged:props. ] ! !