Tools__LintRuleDetail.st
changeset 10672 577f9967dda8
parent 10671 cfa8293dbe9a
child 10673 5e23775830ee
--- a/Tools__LintRuleDetail.st	Wed Sep 07 04:04:16 2011 +0200
+++ b/Tools__LintRuleDetail.st	Wed Sep 07 04:53:50 2011 +0200
@@ -64,6 +64,31 @@
 "
 ! !
 
+!LintRuleDetail class methodsFor:'help specs'!
+
+flyByHelpSpec
+    "This resource specification was automatically generated
+     by the UIHelpTool of ST/X."
+
+    "Do not manually edit this!! If it is corrupted,
+     the UIHelpTool may not be able to read the specification."
+
+    "
+     UIHelpTool openOnClass:Tools::LintRuleDetail    
+    "
+
+    <resource: #help>
+
+    ^ super flyByHelpSpec addPairsFrom:#(
+
+#ruleName
+'Click to browse the lint rule'
+
+)
+
+    "Created: / 07-09-2011 / 04:08:11 / cg"
+! !
+
 !LintRuleDetail class methodsFor:'interface specs'!
 
 windowSpec
@@ -110,13 +135,14 @@
                     component: 
                    (SpecCollection
                       collection: (
-                       (LabelSpec
-                          label: 'Name...'
-                          name: 'Name'
-                          layout: (LayoutFrame 15 0 0 0 -150 1 30 0)
+                       (LinkButtonSpec
+                          name: 'Button1'
+                          layout: (LayoutFrame 0 0 0 0 -150 1 30 0)
+                          activeHelpKey: ruleName
                           translateLabel: true
                           labelChannel: ruleNameAspect
                           adjust: left
+                          model: browseLintRule
                         )
                        (CheckBoxSpec
                           label: 'Show Rationale'
@@ -170,6 +196,23 @@
 
 ! !
 
+!LintRuleDetail methodsFor:'actions'!
+
+browseLintRule
+    |rule ruleClass sel|
+
+    rule := self ruleHolder value.
+    rule isNil ifTrue:[^ self].
+    ruleClass := rule class.
+    (ruleClass implements:#rationale) ifTrue:[
+        sel := #rationale.
+    ].
+    UserPreferences current systemBrowserClass
+       openInClass:ruleClass selector:sel
+
+    "Created: / 07-09-2011 / 04:09:38 / cg"
+! !
+
 !LintRuleDetail methodsFor:'aspects'!
 
 rationaleVisibleHolder
@@ -237,14 +280,15 @@
     |holder|
 
     (holder := builder bindingAt:#ruleNameAspect) isNil ifTrue:[
-	holder := (AspectAdaptor forAspect: #displayString) subjectChannel: self ruleHolder.
-	builder aspectAt:#ruleNameAspect put:holder.
-"/       holder addDependent:self.
-"/       holder onChangeSend:#ruleNameAspectChanged to:self.
+        holder := BlockValue
+                    with:[:h | h displayString , ' ' , (('[browse]' actionForAll:[ self browseLintRule]) colorizeAllWith:Color blue) ]
+                    argument: self ruleHolder.
+        builder aspectAt:#ruleNameAspect put:holder.
     ].
     ^ holder.
 
     "Modified: / 05-02-2010 / 12:51:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 07-09-2011 / 04:49:20 / cg"
 !
 
 ruleRationaleAspect
@@ -253,14 +297,13 @@
     |holder|
 
     (holder := builder bindingAt:#ruleRationaleAspect) isNil ifTrue:[
-	holder := (AspectAdaptor forAspect: #rationale) subjectChannel: self ruleHolder.
-	builder aspectAt:#ruleRationaleAspect put:holder.
-"/       holder addDependent:self.
-"/       holder onChangeSend:#ruleRationaleAspectChanged to:self.
+        holder := (AspectAdaptor forAspect: #rationale) subjectChannel: self ruleHolder.
+        builder aspectAt:#ruleRationaleAspect put:holder.
     ].
     ^ holder.
 
     "Modified: / 05-02-2010 / 12:51:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (comment): / 07-09-2011 / 04:12:16 / cg"
 ! !
 
 !LintRuleDetail methodsFor:'change & update'!
@@ -360,8 +403,12 @@
 
 !LintRuleDetail class methodsFor:'documentation'!
 
+version
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__LintRuleDetail.st,v 1.9 2011-09-07 02:53:50 cg Exp $'
+!
+
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__LintRuleDetail.st,v 1.8 2011-09-07 02:04:16 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__LintRuleDetail.st,v 1.9 2011-09-07 02:53:50 cg Exp $'
 !
 
 version_SVN