--- a/UIHelpTool.st Mon Feb 13 15:30:41 2017 +0100
+++ b/UIHelpTool.st Mon Feb 13 18:14:54 2017 +0100
@@ -730,8 +730,14 @@
specClass := self getHelpSpecClassFromClass:aClass.
aClass notNil ifTrue:[
- (aClass theMetaclass implements:helpSpecSelector) ifFalse:[
- alternativeSelector := (self alternativeSpecSelectors ? #()) detect:[:sel | aClass theMetaclass implements:sel] ifNone:nil.
+ ((aClass theMetaclass implements:helpSpecSelector)
+ and:[(aClass theMetaclass compiledMethodAt:helpSpecSelector) hasResource:#help]) ifFalse:[
+ alternativeSelector := (self alternativeSpecSelectors ? #())
+ detect:[:sel |
+ (aClass theMetaclass implements:sel)
+ and:[(aClass theMetaclass compiledMethodAt:sel) hasResource:#help]
+ ]
+ ifNone:nil.
alternativeSelector notNil ifTrue:[
helpSpecSelector := specSelector := alternativeSelector.
specClass := aClass.
@@ -791,6 +797,8 @@
self updateIcons.
classItemModel value:(list last)
].
+
+ "Modified: / 13-02-2017 / 17:47:02 / cg"
!
loadFromClass:aClass andSelector:aSelector
@@ -1201,6 +1209,9 @@
!UIHelpTool::ClassItem methodsFor:'code generation'!
createHelpMethodNamed:aMethodName
+ "cg: special case for helpPairs.
+ this returns a plain array, not invoking super"
+
|stream|
modified ifFalse:[
@@ -1214,9 +1225,24 @@
].
stream := '' writeStream.
- stream nextPutAll:
- aMethodName, '\' withCRs,
- (ResourceSpecEditor codeGenerationCommentForClass:UIHelpTool) withCRs,
+ aMethodName = 'helpPairs' ifTrue:[
+ stream nextPutAll:
+ aMethodName, '\' withCRs,
+ (ResourceSpecEditor codeGenerationCommentForClass:UIHelpTool) withCRs,
+ '\\' withCRs,
+ ' "\' withCRs,
+ ' UIHelpTool openOnClass:', theClass name asString ,'
+ "
+
+ <resource: #help>
+
+ ^ #(
+
+'.
+ ] ifFalse:[
+ stream nextPutAll:
+ aMethodName, '\' withCRs,
+ (ResourceSpecEditor codeGenerationCommentForClass:UIHelpTool) withCRs,
'\\' withCRs,
' "\' withCRs,
' UIHelpTool openOnClass:', theClass name asString ,'
@@ -1227,7 +1253,8 @@
^ super ', aMethodName, ' addPairsFrom:#(
'.
-
+ ].
+
self do:[:aKeyItem| |helpText|
helpText := aKeyItem helpText.
helpText isNil ifTrue:[ helpText := '' ].
@@ -1243,6 +1270,8 @@
inCategory:'help specs'.
self modified:false.
+
+ "Modified: / 13-02-2017 / 17:51:53 / cg"
! !
!UIHelpTool::ClassItem methodsFor:'displaying'!