class: UIPainterView
authorClaus Gittinger <cg@exept.de>
Mon, 15 Jul 2013 14:46:15 +0200
changeset 3031 a301eabbab46
parent 3030 c909ebfb2041
child 3032 41f4128c029c
class: UIPainterView added: #generateWindowSpecMethodSourceFor:class:selector: changed: #generateWindowSpecMethodSource refactored to make code generator reusable with different class/selector/selection
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|