Tools__LintService.st
changeset 11382 c078e68a2ffe
parent 11227 3d57003855a7
child 11389 41cbd2e426f7
--- a/Tools__LintService.st	Wed Mar 07 18:19:06 2012 +0100
+++ b/Tools__LintService.st	Wed Mar 07 18:19:49 2012 +0100
@@ -78,19 +78,22 @@
 !LintService methodsFor:'accessing'!
 
 syntaxHighlighter
-
     | app rules |
 
-    ((app :=codeView application) respondsTo: #selectedLintRules) ifTrue:[
-        rules := self ruleHolderFromApp value.
-        rules isEmptyOrNil not ifTrue:[
-            highlighter rules: rules.
-            ^highlighter
-        ]
+    app := codeView application.
+    app notNil ifTrue:[
+        true "(app respondsTo: #selectedLintRules)" ifTrue:[
+            rules := self ruleHolderFromApp value.
+            rules notEmptyOrNil ifTrue:[
+                highlighter rules: rules.
+                ^ highlighter
+            ]
+        ].
     ].
     ^nil
 
     "Created: / 05-08-2011 / 10:59:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (format): / 07-03-2012 / 17:22:14 / cg"
 ! !
 
 !LintService methodsFor:'aspects'!
@@ -98,11 +101,18 @@
 ruleHolderFromApp
     "return/create the 'ruleHolderFromApp' value holder (automatically generated)"
 
+    |app|
+
     ruleHolderFromApp isNil ifTrue:[
-        ruleHolderFromApp := ValueHolder new.
-        ruleHolderFromApp addDependent:self.
+        (app := self application) notNil ifTrue:[
+            self ruleHolderFromApp: app selectedLintRules
+            "/ ruleHolderFromApp := ValueHolder new.
+            "/ ruleHolderFromApp addDependent:self.
+        ].
     ].
     ^ ruleHolderFromApp
+
+    "Modified: / 07-03-2012 / 17:20:42 / cg"
 !
 
 ruleHolderFromApp:something
@@ -127,13 +137,16 @@
 !LintService methodsFor:'change & update'!
 
 update: aspect with: param from: sender
-
-
-    sender == ruleHolderFromApp ifTrue:[
-        self syntaxHighlight: true
-    ]
+    aspect == #sizeOfView ifFalse:[
+        sender == ruleHolderFromApp ifTrue:[
+            self syntaxHighlight: true.
+            ^ self.
+        ]
+    ].
+    super update: aspect with: param from: sender.
 
     "Created: / 05-08-2011 / 11:49:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 07-03-2012 / 17:16:59 / cg"
 ! !
 
 !LintService methodsFor:'initialization'!
@@ -164,22 +177,30 @@
 !LintService methodsFor:'registering'!
 
 registerIn: aCodeView
+    |app|
 
     super registerIn: aCodeView.
-    (self application respondsTo: #selectedLintRules) ifTrue:[
-        self ruleHolderFromApp: self application selectedLintRules
+
+    app := self application.
+    app notNil ifTrue:[
+        "/ bad design; better idea would be to pass the lintRuleHolder back from the
+        "/ application to me explicitely (in a postBuild method for some ruleCanvas of the app)
+        true "(app respondsTo: #selectedLintRules)" ifTrue:[
+            self ruleHolderFromApp: app selectedLintRules
+        ]
     ].
 
     "Modified: / 17-06-2011 / 13:07:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Created: / 05-08-2011 / 11:47:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (format): / 07-03-2012 / 17:21:27 / cg"
 ! !
 
 !LintService class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__LintService.st,v 1.2 2012-01-27 21:18:53 vrany Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__LintService.st,v 1.3 2012-03-07 17:19:49 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__LintService.st,v 1.2 2012-01-27 21:18:53 vrany Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__LintService.st,v 1.3 2012-03-07 17:19:49 cg Exp $'
 ! !