BrowserView.st
changeset 1269 122015faaba9
parent 1268 e74c05a6a049
child 1278 0b0ee3c97910
--- a/BrowserView.st	Fri Aug 01 11:56:35 1997 +0200
+++ b/BrowserView.st	Fri Aug 01 12:45:38 1997 +0200
@@ -4188,19 +4188,22 @@
     "return a class definition template - be smart in what is offered initially"
 
     |cat aString name nameProto namePrefix i existingNames withNameSpaceDirective
-     className ownerName|
+     className ownerName s|
+
+    s := TextStream on:''.
 
     isNameSpace ifTrue:[
-        ^ 'Namespace name:''NewNameSpace''
-
-
-"
+        s nextPutAll:'Namespace name:''NewNameSpace'''.
+        s cr; cr.
+        s emphasis:(self commentEmphasis).
+        s nextPutAll:'"
  Replace ''NewNameSpace'' by the desired name.
 
  Create the namespace by ''accepting'',
  either via the menu or the keyboard (usually CMD-A).
 "
-'
+'.
+        ^ s contents.
     ].
 
     withNameSpaceDirective :=
@@ -4210,6 +4213,8 @@
 
     withNameSpaceDirective ifTrue:[
         className := aSuperClass nameWithoutNameSpacePrefix
+        s nextPutAll:('"{ Namespace: ''' , currentNamespace name , ''' }"').
+        s cr; cr.
     ] ifFalse:[    
         className := aSuperClass name.
     ].
@@ -4242,31 +4247,34 @@
         ].
     ].
 
+    s nextPutAll:className.
+
     isPrivate ifTrue:[
         withNameSpaceDirective ifTrue:[
             ownerName := currentClass nameWithoutNameSpacePrefix
         ] ifFalse:[
             ownerName := currentClass name
         ].
-        aString := className , ' subclass:#' , name  , '
+        s nextPutAll:(' subclass:#' , name  , '
 ' , '    instanceVariableNames: ''''
 ' , '    classVariableNames: ''''
 ' , '    poolDictionaries: ''''
-' , '    privateIn:' , ownerName
+' , '    privateIn:' , ownerName)
     ] ifFalse:[
-        aString := className , ' subclass:#' , name , '
+        s nextPutAll:(' subclass:#' , name , '
 ' , '    instanceVariableNames: ''''
 ' , '    classVariableNames: ''''
 ' , '    poolDictionaries: ''''
-' , '    category: '''.
+' , '    category: ''').
         cat notNil ifTrue:[
-            aString := aString , cat
-        ].
-        aString := aString , ''''
-    ].
-    aString := aString , '
-
-
+            s nextPutAll: cat
+        ].
+        s nextPutAll: ''''
+    ].
+
+    s cr; cr.
+    s emphasis:(self commentEmphasis).
+    s nextPutAll:'
 "
  Replace ''' , className , ''', ''', name , ''' and
  the empty string arguments by true values.
@@ -4281,15 +4289,10 @@
 "
 '.
 
-    withNameSpaceDirective ifTrue:[
-        aString := '"{ Namespace: ''' , currentNamespace name , ''' }"
-
-' , aString
-    ].
-    ^ aString
+    ^ s contents
 
     "Created: 23.12.1996 / 12:46:31 / cg"
-    "Modified: 22.3.1997 / 16:15:26 / cg"
+    "Modified: 1.8.1997 / 12:39:10 / cg"
 !
 
 doClassMenu:aBlock
@@ -8034,8 +8037,10 @@
 methodTemplate
     "return a method definition template"
 
-    ^ 
-'message selector and argument names
+    |s|
+
+    s := TextStream on:''.
+    s nextPutAll:'message selector and argument names
     "comment stating purpose of this message"
 
     |temporaries|
@@ -8047,23 +8052,29 @@
     "
      optional: comment giving example use
     "
-
-"
- change above template into real code.
+'.
+    s cr.
+    s emphasis:(self commentEmphasis).
+    s nextPutAll:'"
+ change the above template into real code.
  Then `accept'' either via the menu 
  or via the keyboard (usually CMD-A).
 
  You do not need this template; you can also
  select any existing methods code, change it,
- and finally `accept''.
+ and finally `accept''. The method will then be
+ installed under the selector as defined in the
+ actual text - no matter which method is selected
+ in the browser.
 
  Or clear this text, type in the method from scratch
  and install it with `accept''.
 "
-'
-
-    "Modified: 8.2.1996 / 13:45:58 / cg"
+'.
+    ^ s contents
+
     "Created: 8.2.1996 / 18:21:53 / cg"
+    "Modified: 1.8.1997 / 12:43:51 / cg"
 !
 
 switchToAnyMethodNamed:matchString
@@ -9746,6 +9757,12 @@
 
 !BrowserView methodsFor:'private - defaults'!
 
+commentEmphasis
+    ^ (#color -> (Color red:0 green:0 blue:25))
+
+    "Created: 1.8.1997 / 12:36:14 / cg"
+!
+
 stopIcon
     "answer an icon to mark breakPointed methods"
 
@@ -10483,6 +10500,6 @@
 !BrowserView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.327 1997-08-01 09:56:35 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.328 1997-08-01 10:45:38 cg Exp $'
 ! !
 BrowserView initialize!