# HG changeset patch # User Claus Gittinger # Date 1373892375 -7200 # Node ID a301eabbab46a961ca0e5f3ec8a8b1bd6e50dd74 # Parent c909ebfb20417d6e5d1ab8eae0614afdf5236e9d class: UIPainterView added: #generateWindowSpecMethodSourceFor:class:selector: changed: #generateWindowSpecMethodSource refactored to make code generator reusable with different class/selector/selection diff -r c909ebfb2041 -r a301eabbab46 UIPainterView.st --- a/UIPainterView.st Sat Jul 13 22:25:22 2013 +0200 +++ b/UIPainterView.st Mon Jul 15 14:46:15 2013 +0200 @@ -1667,13 +1667,22 @@ ! generateWindowSpecMethodSource - |spec specArray str code category cls mthd specCode| - - spec := self generateWindowSpec. + ^ self + generateWindowSpecMethodSourceFor:(self generateWindowSpec) + class:className + selector:methodName + + "Modified: / 5.9.1995 / 21:01:35 / claus" + "Modified: / 15.10.1998 / 11:29:53 / cg" +! + +generateWindowSpecMethodSourceFor:spec class:className selector:methodName + |specArray str code category cls mthd specCode| + specArray := spec literalArrayEncoding. str := WriteStream on:String new. - UISpecification prettyPrintSpecArray:specArray on:str indent:5. + UISpecification prettyPrintSpecArray:specArray on:str indent:4. specCode := str contents. (specCode includes:$!!) ifTrue:[ @@ -1722,9 +1731,6 @@ , '\\'. ^ code withCRs - - "Modified: / 5.9.1995 / 21:01:35 / claus" - "Modified: / 15.10.1998 / 11:29:53 / cg" ! listOfAspects @@ -2474,7 +2480,7 @@ ! fullSpecFor:aView - "generate a full spec for an aView (or component)" + "generate a full spec for aView (or component)" |mySpec subSpecs|