BrowserView.st
changeset 120 05dd17f0b031
parent 118 5f130a3785bf
child 123 8490f8cecb6c
--- a/BrowserView.st	Thu Aug 24 05:03:47 1995 +0200
+++ b/BrowserView.st	Sun Aug 27 02:37:21 1995 +0200
@@ -29,7 +29,7 @@
 COPYRIGHT (c) 1989 by Claus Gittinger
 	     All Rights Reserved
 
-$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.18 1995-08-23 18:08:14 claus Exp $
+$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.19 1995-08-27 00:36:40 claus Exp $
 '!
 
 !BrowserView class methodsFor:'documentation'!
@@ -50,7 +50,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.18 1995-08-23 18:08:14 claus Exp $
+$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.19 1995-08-27 00:36:40 claus Exp $
 "
 !
 
@@ -146,16 +146,17 @@
 
     showInstance ~~ aBoolean ifTrue:[
 	self checkSelectionChangeAllowed ifTrue:[
-	    aBoolean ifTrue:[
-		offToggle := classToggle.
-		onToggle := instanceToggle.
-	    ] ifFalse:[
-		onToggle := classToggle.
-		offToggle := instanceToggle.
+	    instanceToggle notNil ifTrue:[
+		aBoolean ifTrue:[
+		    offToggle := classToggle.
+		    onToggle := instanceToggle.
+		] ifFalse:[
+		    onToggle := classToggle.
+		    offToggle := instanceToggle.
+		].
+		onToggle turnOn.
+		offToggle turnOff.
 	    ].
-	    onToggle turnOn.
-	    offToggle turnOff.
-
 	    showInstance := aBoolean.
 
 	    (variableListView notNil
@@ -4746,7 +4747,7 @@
 methodCategoryCreateDocumentationMethods
     "create empty documentation methods"
 
-    |cls|
+    |cls histStream|
 
     self checkClassSelected ifFalse:[^ self].
 
@@ -4755,30 +4756,61 @@
     self withWaitCursorDo:[
 	|nm names source|
 
+	"/ add version method containing RCS template
+	"/ but only if not already present.
+
 	(cls implements:#version) ifFalse:[
 	    Compiler compile:
 'version
 "
 $' , 'Header$
 "
-'                    forClass:cls inCategory:'documentation'.
+'                   forClass:cls 
+		  inCategory:'documentation'.
 	].
+
+	"/ add documentation method containing doc template
+	"/ but only if not already present.
+
 	(cls implements:#documentation) ifFalse:[
 	    Compiler compile:
 'documentation
 "
     documentation to be added.
 "
-'                    forClass:cls inCategory:'documentation'.
+'                   forClass:cls 
+		  inCategory:'documentation'.
 	].
+
+	"/ add examples method containing examples template
+	"/ but only if not already present.
+
 	(cls implements:#examples) ifFalse:[
 	    Compiler compile:
 'examples
 "
     examples to be added.
 "
-'                    forClass:cls inCategory:'documentation'.
+'                   forClass:cls 
+		  inCategory:'documentation'.
 	].
+
+	"/ add history method containing created-entry
+	"/ but only if not already present.
+
+	(cls implements:#history) ifFalse:[ 
+	    histStream := ReadWriteStream on: String new.
+	    histStream nextPutAll: 'history'; cr.
+	    HistoryLine isBehavior ifTrue:[ 
+		histStream nextPutAll: (HistoryLine created printString); cr.
+	    ] ifFalse:[
+		histStream cr.
+	    ].
+	    Compiler compile:(histStream contents)
+		    forClass:cls 
+		  inCategory:'documentation'.
+	].
+
 	self instanceProtocol:false.
 	self switchToMethodNamed:#documentation 
 "/        self updateMethodCategoryListWithScroll:false.