Explainer.st
changeset 4709 1d9dcc6348ee
parent 4708 527bda38efd8
child 4710 acb9573fa8e7
equal deleted inserted replaced
4708:527bda38efd8 4709:1d9dcc6348ee
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 1993 by Claus Gittinger
     4  COPYRIGHT (c) 1993 by Claus Gittinger
     3               All Rights Reserved
     5               All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
    47 "
    49 "
    48     a very simple explainer - much more should be added...
    50     a very simple explainer - much more should be added...
    49 
    51 
    50     This one is involved, when the 'explain' menu function is used in a
    52     This one is involved, when the 'explain' menu function is used in a
    51     codeView (popup or via CMD-E), or if the mouse button is clicked
    53     codeView (popup or via CMD-E), or if the mouse button is clicked
    52     on some code construct in the new browser (then a short explanaition
    54     on some code construct in the new browser (then a short explanation
    53     is shown in the lower info area).
    55     is shown in the lower info area).
    54 
    56 
    55     Most of the texts returned here are heuristically motivated,
    57     Most of the texts returned here are heuristically motivated,
    56     based on the experience with beginners and their frequently asked questions.
    58     based on the experience with beginners and their frequently asked questions.
    57 
    59 
   305         |clsName action1 action2|
   307         |clsName action1 action2|
   306 
   308 
   307         implMethod := implClass compiledMethodAt:selector.
   309         implMethod := implClass compiledMethodAt:selector.
   308         clsName := implClass name.
   310         clsName := implClass name.
   309         clsName := self asLink:clsName to:(self actionToBrowseClass:implClass selector:selector).
   311         clsName := self asLink:clsName to:(self actionToBrowseClass:implClass selector:selector).
   310         "/ info := '%1 » %2' bindWith:clsName "allBold" with:selectorString.
   312         "/ info := '%1 » %2' bindWith:clsName "allBold" with:selectorString.
   311         info := '%1 %2' bindWith:clsName with:(implMethod methodDefinitionTemplateForSelector:selector).
   313         info := '%1 %2' bindWith:clsName with:(implMethod methodDefinitionTemplateForSelector:selector).
   312         info := self asLink:info to:(action1 := self actionToBrowseClass:implClass selector:selector info:nil).
   314         info := self asLink:info to:(action1 := self actionToBrowseClass:implClass selector:selector info:nil).
   313         
   315         
   314         redefiningClasses size ~~ 0 ifTrue:[
   316         redefiningClasses size ~~ 0 ifTrue:[
   315             redefiningClasses size == 1 ifTrue:[
   317             redefiningClasses size == 1 ifTrue:[
  2879                         asLink:selectorString "allBold" 
  2881                         asLink:selectorString "allBold" 
  2880                         info:('Browse all implementors of %1' bindWith:selectorString)
  2882                         info:('Browse all implementors of %1' bindWith:selectorString)
  2881                         to:(self actionToOpenMethodFinderFor:sel)) 
  2883                         to:(self actionToOpenMethodFinderFor:sel)) 
  2882             with:(self 
  2884             with:(self 
  2883                     asLink:inheritedClass name "allBold" 
  2885                     asLink:inheritedClass name "allBold" 
  2884                     info:('Browse %1 » %2' bindWith:inheritedClass name with:sel)
  2886                     info:('Browse %1 » %2' bindWith:inheritedClass name with:sel)
  2885                     to:(self actionToBrowseClass:inheritedClass selector:sel)).
  2887                     to:(self actionToBrowseClass:inheritedClass selector:sel)).
  2886     ].
  2888     ].
  2887 
  2889 
  2888     ^ msg
  2890     ^ msg
  2889 
  2891