BrowserView.st
changeset 2232 a46837dc0c5c
parent 2223 0e114ab45a6b
child 2238 906331fe4118
--- a/BrowserView.st	Tue Jul 06 13:18:53 1999 +0200
+++ b/BrowserView.st	Tue Jul 06 17:41:04 1999 +0200
@@ -2788,87 +2788,95 @@
      it when exploring the system."
 
     self doClassMenu:[:currentClass |
-	|m s cls aStream isComment src highlighter|
-
-	aStream := TextStream on:(String new:200).
-
-	cls := acceptClass ? currentClass.
-	cls isMeta ifTrue:[
-	    cls := cls soleInstance
-	].
-
-	cls isNamespace ifTrue:[
-	    cls fileOutDefinitionOn:aStream
-	] ifFalse:[
-
-	    "/
-	    "/ here, show it with a nameSpace pragma
-	    "/ and prefer short names.
-	    "/
-	    cls
-		basicFileOutDefinitionOn:aStream 
-		withNameSpace:true.
-
-	    cls isLoaded ifTrue:[
-		"
-		 add documentation as a comment, if there is any
-		"
-		m := cls class compiledMethodAt:#documentation.
-		m notNil ifTrue:[
-		    s := m comment.
-		    isComment := false.
-		] ifFalse:[
-		    "try comment"
-		    s := cls comment.
-		    s isString ifTrue:[
-			s isEmpty ifTrue:[
-			    s := nil
-			] ifFalse:[
-			    (s includes:$") ifTrue:[
-				s := s copyReplaceAll:$" with:$'.
-			    ].
-			    isComment := true
-			]
-		    ] ifFalse:[
-			"/ class redefines comment ?
-			s := nil
-		    ]
-		].
-	    ].
-	    aStream cr; cr; cr; cr; cr.
-	    aStream emphasis:(self commentEmphasis).
-	    s isNil ifTrue:[
-		aStream nextPut:$" ; cr; nextPutLine:' no comment or documentation method found'.
-	    ] ifFalse:[
-		aStream nextPut:$" ; cr; nextPutLine:' Documentation:'.
-		aStream cr; nextPutLine:s; cr.
-		aStream nextPutLine:' Notice: '.
-		aStream nextPutAll:'   the above text has been extracted from the classes '.
-		aStream nextPutLine:(isComment ifTrue:['comment.'] ifFalse:['documentation method.']).
-		aStream nextPutLine:'   Any change in it will be lost if you ''accept'' here.'.
-		aStream nextPutAll:'   To change the '.
-		aStream nextPutAll:(isComment ifTrue:['comment'] ifFalse:['documentation']).
-		aStream nextPutAll:', switch to the '.
-		aStream nextPutAll:(isComment ifTrue:['comment'] ifFalse:['documentation method']).
-		aStream nextPutLine:' and ''accept'' any changes there.'.
-	    ].
-	    aStream nextPut:$".
-	    aStream emphasis:nil.
-	].
-
-	src := aStream contents.
-	UserPreferences current syntaxColoring ifTrue:[
-	    highlighter := cls syntaxHighlighterClass.
-	    highlighter notNil ifTrue:[
-		src := highlighter formatExpression:src in:nil.
-	    ]
-	].
-
-	codeView contents:src.
-	codeView modified:false.
-	codeModified := false.
-
-	self setAcceptActionForClass.
+        |m s cls aStream isComment src highlighter|
+
+        aStream := TextStream on:(String new:200).
+
+        cls := acceptClass ? currentClass.
+        cls isMeta ifTrue:[
+            cls := cls soleInstance
+        ].
+
+        cls isNamespace ifTrue:[
+            cls fileOutDefinitionOn:aStream
+        ] ifFalse:[
+
+            "/
+            "/ here, show it with a nameSpace pragma
+            "/ and prefer short names.
+            "/
+            cls
+                basicFileOutDefinitionOn:aStream 
+                withNameSpace:true.
+
+            cls isLoaded ifTrue:[
+                "/ show the definition now...
+                src := aStream contents.
+                codeView contents:src.
+
+                "/ ...but continue fetching with the documentation,
+                "/ which may take longer, if the source must be fetched
+                "/ from the repository.
+
+                "
+                 add documentation as a comment, if there is any
+                "
+                m := cls class compiledMethodAt:#documentation.
+                m notNil ifTrue:[
+                    s := m comment.
+                    isComment := false.
+                ] ifFalse:[
+                    "try comment"
+                    s := cls comment.
+                    s isString ifTrue:[
+                        s isEmpty ifTrue:[
+                            s := nil
+                        ] ifFalse:[
+                            (s includes:$") ifTrue:[
+                                s := s copyReplaceAll:$" with:$'.
+                            ].
+                            isComment := true
+                        ]
+                    ] ifFalse:[
+                        "/ class redefines comment ?
+                        s := nil
+                    ]
+                ].
+            ].
+            aStream cr; cr; cr; cr; cr.
+            aStream emphasis:(self commentEmphasis).
+            s isNil ifTrue:[
+                aStream nextPut:$" ; cr; nextPutLine:' no comment or documentation method found'.
+            ] ifFalse:[
+                aStream nextPut:$" ; cr; nextPutLine:' Documentation:'.
+                aStream cr; nextPutLine:s; cr.
+                aStream nextPutLine:' Notice: '.
+                aStream nextPutAll:'   the above text has been extracted from the classes '.
+                aStream nextPutLine:(isComment ifTrue:['comment.'] ifFalse:['documentation method.']).
+                aStream nextPutLine:'   Any change in it will be lost if you ''accept'' here.'.
+                aStream nextPutAll:'   To change the '.
+                aStream nextPutAll:(isComment ifTrue:['comment'] ifFalse:['documentation']).
+                aStream nextPutAll:', switch to the '.
+                aStream nextPutAll:(isComment ifTrue:['comment'] ifFalse:['documentation method']).
+                aStream nextPutLine:' and ''accept'' any changes there.'.
+            ].
+            aStream nextPut:$".
+            aStream emphasis:nil.
+        ].
+
+        src := aStream contents.
+        UserPreferences current syntaxColoring ifTrue:[
+            highlighter := cls syntaxHighlighterClass.
+            highlighter notNil ifTrue:[
+                src := highlighter formatExpression:src in:nil.
+            ]
+        ].
+
+        codeView contents:src.
+        codeView modified:false.
+        codeModified := false.
+
+        self setAcceptActionForClass.
 
 "/        currentClass isNamespace ifTrue:[
 "/            codeView acceptAction:nil.
@@ -2907,13 +2915,13 @@
 "/                codeView cursor:Cursor normal.
 "/            ].
 "/        ].
-	self clearExplainAction.
-
-	methodListView notNil ifTrue:[
-	    methodListView setSelection:nil
-	].
-	aspect := #definition.
-	self normalLabel
+        self clearExplainAction.
+
+        methodListView notNil ifTrue:[
+            methodListView setSelection:nil
+        ].
+        aspect := #definition.
+        self normalLabel
     ]
 
     "Modified: / 18.7.1998 / 22:52:50 / cg"
@@ -13580,6 +13588,6 @@
 !BrowserView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.513 1999-07-05 16:25:49 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.514 1999-07-06 15:41:04 cg Exp $'
 ! !
 BrowserView initialize!