ask class for syntaxHighliter (avoid formatting Java classes ...)
authorClaus Gittinger <cg@exept.de>
Mon, 27 Apr 1998 15:51:48 +0200
changeset 1623 d8ec0dca0923
parent 1622 fecb0d17cb42
child 1624 5bec63471d4d
ask class for syntaxHighliter (avoid formatting Java classes ...)
BrowserView.st
BrwsrView.st
--- a/BrowserView.st	Sun Apr 26 01:34:57 1998 +0200
+++ b/BrowserView.st	Mon Apr 27 15:51:48 1998 +0200
@@ -2080,7 +2080,7 @@
      it when exploring the system."
 
     self doClassMenu:[:currentClass |
-        |m s aStream isComment src|
+        |m s aStream isComment src highlighter|
 
         aStream := TextStream on:(String new:200).
 
@@ -2145,7 +2145,10 @@
 
         src := aStream contents.
         UserPreferences current syntaxColoring ifTrue:[
-            src := SyntaxHighlighter formatExpression:src in:nil.
+            highlighter := currentClass syntaxHighlighterClass.
+            highlighter notNil ifTrue:[
+                src := highlighter formatExpression:src in:nil.
+            ]
         ].
 
         codeView contents:src.
@@ -2198,7 +2201,7 @@
         self normalLabel
     ]
 
-    "Modified: / 19.4.1998 / 21:02:04 / cg"
+    "Modified: / 27.4.1998 / 15:35:33 / cg"
 !
 
 classDocumentation
@@ -9122,7 +9125,7 @@
 !
 
 startSyntaxHighlightProcess
-    |oldCodeList|
+    |oldCodeList highlighter|
 
     coloringProcess notNil ifTrue:[
         coloringProcess terminate.
@@ -9130,6 +9133,8 @@
     ].
     currentMethod isNil ifTrue:[^ self].
     UserPreferences current syntaxColoring ifFalse:[^ self].
+    highlighter := actualClass syntaxHighlighterClass.
+    highlighter isNil ifTrue:[^ self].
 
     oldCodeList := codeView list.
 
@@ -9141,7 +9146,7 @@
         code := oldCode string.
         cls := actualClass.
         
-        code := SyntaxHighlighter formatMethod:code in:cls.
+        code := highlighter formatMethod:code in:cls.
         code emphasis ~= oldEmp ifTrue:[
             Processor activeProcess withPriority:(Processor activePriority + 2) do:[
                 code asCollectionOfLines keysAndValuesDo:[:lNr :line |
@@ -9165,11 +9170,11 @@
     ] forkAt:(Processor userBackgroundPriority).
 
     "Created: / 31.3.1998 / 14:25:29 / cg"
-    "Modified: / 1.4.1998 / 13:17:14 / cg"
+    "Modified: / 27.4.1998 / 15:36:36 / cg"
 !
 
 updateCodeView
-    |code sourceLineNumber doStartSyntax invalidate|
+    |code sourceLineNumber doStartSyntax invalidate highlighter|
 
     codeView modifiedChannel retractInterestsFor:self.
 
@@ -9244,11 +9249,14 @@
                 codeView acceptAction:[:text | nil].
             ] ifFalse:[
                 UserPreferences current syntaxColoring ifTrue:[
-                    code size < 5000 ifTrue:[       
-                        code := SyntaxHighlighter formatMethod:code in:actualClass.
-                        codeView modifiedChannel onChangeSend:#codeChanged to:self.
-                    ] ifFalse:[
-                        doStartSyntax := true.
+                    highlighter := actualClass syntaxHighlighterClass.
+                    highlighter notNil ifTrue:[
+                        code size < 5000 ifTrue:[       
+                            code := highlighter formatMethod:code in:actualClass.
+                            codeView modifiedChannel onChangeSend:#codeChanged to:self.
+                        ] ifFalse:[
+                            doStartSyntax := true.
+                        ]
                     ]
                 ]
             ]
@@ -9287,7 +9295,7 @@
     self normalLabel.
 
     "Created: / 23.11.1995 / 14:16:43 / cg"
-    "Modified: / 22.4.1998 / 18:36:13 / cg"
+    "Modified: / 27.4.1998 / 15:37:10 / cg"
 ! !
 
 !BrowserView methodsFor:'namespace menu'!
@@ -11618,6 +11626,6 @@
 !BrowserView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.402 1998-04-25 18:39:02 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.403 1998-04-27 13:51:48 cg Exp $'
 ! !
 BrowserView initialize!
--- a/BrwsrView.st	Sun Apr 26 01:34:57 1998 +0200
+++ b/BrwsrView.st	Mon Apr 27 15:51:48 1998 +0200
@@ -2080,7 +2080,7 @@
      it when exploring the system."
 
     self doClassMenu:[:currentClass |
-        |m s aStream isComment src|
+        |m s aStream isComment src highlighter|
 
         aStream := TextStream on:(String new:200).
 
@@ -2145,7 +2145,10 @@
 
         src := aStream contents.
         UserPreferences current syntaxColoring ifTrue:[
-            src := SyntaxHighlighter formatExpression:src in:nil.
+            highlighter := currentClass syntaxHighlighterClass.
+            highlighter notNil ifTrue:[
+                src := highlighter formatExpression:src in:nil.
+            ]
         ].
 
         codeView contents:src.
@@ -2198,7 +2201,7 @@
         self normalLabel
     ]
 
-    "Modified: / 19.4.1998 / 21:02:04 / cg"
+    "Modified: / 27.4.1998 / 15:35:33 / cg"
 !
 
 classDocumentation
@@ -9122,7 +9125,7 @@
 !
 
 startSyntaxHighlightProcess
-    |oldCodeList|
+    |oldCodeList highlighter|
 
     coloringProcess notNil ifTrue:[
         coloringProcess terminate.
@@ -9130,6 +9133,8 @@
     ].
     currentMethod isNil ifTrue:[^ self].
     UserPreferences current syntaxColoring ifFalse:[^ self].
+    highlighter := actualClass syntaxHighlighterClass.
+    highlighter isNil ifTrue:[^ self].
 
     oldCodeList := codeView list.
 
@@ -9141,7 +9146,7 @@
         code := oldCode string.
         cls := actualClass.
         
-        code := SyntaxHighlighter formatMethod:code in:cls.
+        code := highlighter formatMethod:code in:cls.
         code emphasis ~= oldEmp ifTrue:[
             Processor activeProcess withPriority:(Processor activePriority + 2) do:[
                 code asCollectionOfLines keysAndValuesDo:[:lNr :line |
@@ -9165,11 +9170,11 @@
     ] forkAt:(Processor userBackgroundPriority).
 
     "Created: / 31.3.1998 / 14:25:29 / cg"
-    "Modified: / 1.4.1998 / 13:17:14 / cg"
+    "Modified: / 27.4.1998 / 15:36:36 / cg"
 !
 
 updateCodeView
-    |code sourceLineNumber doStartSyntax invalidate|
+    |code sourceLineNumber doStartSyntax invalidate highlighter|
 
     codeView modifiedChannel retractInterestsFor:self.
 
@@ -9244,11 +9249,14 @@
                 codeView acceptAction:[:text | nil].
             ] ifFalse:[
                 UserPreferences current syntaxColoring ifTrue:[
-                    code size < 5000 ifTrue:[       
-                        code := SyntaxHighlighter formatMethod:code in:actualClass.
-                        codeView modifiedChannel onChangeSend:#codeChanged to:self.
-                    ] ifFalse:[
-                        doStartSyntax := true.
+                    highlighter := actualClass syntaxHighlighterClass.
+                    highlighter notNil ifTrue:[
+                        code size < 5000 ifTrue:[       
+                            code := highlighter formatMethod:code in:actualClass.
+                            codeView modifiedChannel onChangeSend:#codeChanged to:self.
+                        ] ifFalse:[
+                            doStartSyntax := true.
+                        ]
                     ]
                 ]
             ]
@@ -9287,7 +9295,7 @@
     self normalLabel.
 
     "Created: / 23.11.1995 / 14:16:43 / cg"
-    "Modified: / 22.4.1998 / 18:36:13 / cg"
+    "Modified: / 27.4.1998 / 15:37:10 / cg"
 ! !
 
 !BrowserView methodsFor:'namespace menu'!
@@ -11618,6 +11626,6 @@
 !BrowserView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Attic/BrwsrView.st,v 1.402 1998-04-25 18:39:02 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Attic/BrwsrView.st,v 1.403 1998-04-27 13:51:48 cg Exp $'
 ! !
 BrowserView initialize!