added: #fetchLintRuleHolder
authorClaus Gittinger <cg@exept.de>
Thu, 08 Mar 2012 01:25:59 +0100
changeset 11390 b5af6f49f10f
parent 11389 41cbd2e426f7
child 11391 730b258a005f
added: #fetchLintRuleHolder changed: #registerIn: #ruleHolderFromApp #syntaxHighlighter
Tools__LintService.st
--- a/Tools__LintService.st	Wed Mar 07 22:42:14 2012 +0100
+++ b/Tools__LintService.st	Thu Mar 08 01:25:59 2012 +0100
@@ -28,10 +28,10 @@
 "{ NameSpace: Tools }"
 
 CodeViewService subclass:#LintService
-	instanceVariableNames:'ruleHolderFromApp highlighter'
-	classVariableNames:''
-	poolDictionaries:''
-	category:'Interface-Lint'
+        instanceVariableNames:'ruleHolderFromApp highlighter'
+        classVariableNames:''
+        poolDictionaries:''
+        category:'Interface-Lint'
 !
 
 !LintService class methodsFor:'documentation'!
@@ -82,18 +82,16 @@
 
     app := codeView application.
     app notNil ifTrue:[
-        (app respondsTo: #selectedLintRules) ifTrue:[
-            rules := self ruleHolderFromApp value.
-            rules notEmptyOrNil ifTrue:[
-                highlighter rules: rules.
-                ^ highlighter
-            ]
+        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"
+    "Modified: / 08-03-2012 / 01:23:48 / cg"
 ! !
 
 !LintService methodsFor:'aspects'!
@@ -105,14 +103,14 @@
 
     ruleHolderFromApp isNil ifTrue:[
         (app := self application) notNil ifTrue:[
-            self ruleHolderFromApp: app selectedLintRules
+            self fetchLintRuleHolder
             "/ ruleHolderFromApp := ValueHolder new.
             "/ ruleHolderFromApp addDependent:self.
         ].
     ].
     ^ ruleHolderFromApp
 
-    "Modified: / 07-03-2012 / 17:20:42 / cg"
+    "Modified: / 08-03-2012 / 01:17:15 / cg"
 !
 
 ruleHolderFromApp:something
@@ -176,31 +174,38 @@
 
 !LintService methodsFor:'registering'!
 
-registerIn: aCodeView
+fetchLintRuleHolder
     |app|
 
-    super registerIn: aCodeView.
-
     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:[
+        (app respondsTo: #selectedLintRules) ifTrue:[
             self ruleHolderFromApp: app selectedLintRules
+        ] ifFalse:[
+            Transcript showCR:'oops - LintService''s app does not provide a lintRuleHolder'
         ]
     ].
 
+    "Created: / 08-03-2012 / 01:16:38 / cg"
+!
+
+registerIn: aCodeView
+    super registerIn: aCodeView.
+    self fetchLintRuleHolder.
+
     "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"
+    "Modified: / 08-03-2012 / 01:16:51 / cg"
 ! !
 
 !LintService class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__LintService.st,v 1.4 2012-03-07 21:42:14 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__LintService.st,v 1.5 2012-03-08 00:25:59 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__LintService.st,v 1.4 2012-03-07 21:42:14 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__LintService.st,v 1.5 2012-03-08 00:25:59 cg Exp $'
 ! !