allow master to provide an alternative help text
authorClaus Gittinger <cg@exept.de>
Wed, 13 May 2009 19:18:29 +0200
changeset 2524 759b4b908fcb
parent 2523 1f315c18f4da
child 2525 16c3872003d7
allow master to provide an alternative help text
UISpecificationTool.st
--- a/UISpecificationTool.st	Wed May 13 18:40:04 2009 +0200
+++ b/UISpecificationTool.st	Wed May 13 19:18:29 2009 +0200
@@ -344,21 +344,44 @@
 
 !UISpecificationTool methodsFor:'help'!
 
+basicFlyByHelpTextForKey:aKey
+    "activeHelp interface: return some help text for a key.
+     Redefined to ask the current components Spec first."
+
+    |helpText|
+
+    "/ first, ask the master (a hook for expecco, to provide different help texts)
+    masterApplication notNil ifTrue:[
+        helpText := masterApplication basicFlyByHelpTextForKey:aKey.
+        helpText notNil ifTrue:[^ helpText ].
+    ].
+
+    "/ then, ask the spec
+    helpText := (specification helpSpec) at:aKey ifAbsent:nil.
+    helpText notNil ifTrue:[^ helpText ].
+
+    "/ finally, ask myself...
+    ^ super basicFlyByHelpTextForKey:aKey.
+!
+
 basicHelpTextForKey:aKey
     "activeHelp interface: return some help text for a key.
      Redefined to ask the current components Spec first."
 
     |helpText|
 
-    "/ first, ask the spec
-    helpText := (specification helpSpec) at:aKey ifAbsent:nil.
-"/ DEBUG:    helpText isNil ifTrue:[^ 'No help for key: ', aKey ].
+    "/ first, ask the master (a hook for expecco, to provide different help texts)
+    masterApplication notNil ifTrue:[
+        helpText := masterApplication basicHelpTextForKey:aKey.
+        helpText notNil ifTrue:[^ helpText ].
+    ].
 
-    helpText isNil ifTrue:[
-        helpText := super basicHelpTextForKey:aKey.
-    ].
-"/ DEBUG:    ^ aKey , ': ' , helpText
-    ^ helpText
+    "/ then, ask the spec
+    helpText := (specification helpSpec) at:aKey ifAbsent:nil.
+    helpText notNil ifTrue:[^ helpText ].
+
+    "/ finally, ask myself...
+    ^ super basicHelpTextForKey:aKey.
 ! !
 
 !UISpecificationTool methodsFor:'initialization'!