2652 methodRedefinitionInfoFor:aMethod |
2652 methodRedefinitionInfoFor:aMethod |
2653 "return a user readable string telling in how many subclasses |
2653 "return a user readable string telling in how many subclasses |
2654 a method is redefined. |
2654 a method is redefined. |
2655 To be shown in the info line of a browser" |
2655 To be shown in the info line of a browser" |
2656 |
2656 |
2657 |redefiningClasses msg cls| |
2657 |redefiningClasses msg methodsClass| |
2658 |
2658 |
2659 cls := aMethod mclass. |
2659 methodsClass := aMethod mclass. |
2660 cls isNil ifTrue:[^ nil]. |
2660 methodsClass isNil ifTrue:[^ nil]. |
2661 |
2661 |
2662 redefiningClasses := cls allSubclasses select:[:cls | cls includesSelector:aMethod selector. ]. |
2662 redefiningClasses := methodsClass allSubclasses select:[:eachClass | eachClass includesSelector:aMethod selector]. |
2663 redefiningClasses size > 0 ifTrue:[ |
2663 redefiningClasses size ~~ 0 ifTrue:[ |
2664 msg := 'redefined in '. |
2664 msg := 'redefined in '. |
2665 msg := msg , (self |
2665 msg := msg , (self |
2666 infoStringForClasses:redefiningClasses |
2666 infoStringForClasses:redefiningClasses |
2667 withPrefix:'sub' |
2667 withPrefix:'sub' |
2668 actionGenerator:[:classes | |
2668 actionGenerator:[:classes | |
2669 classes size == 1 ifTrue:[ |
2669 classes size == 1 ifTrue:[ |
2670 |cls| |
2670 |cls| |
|
2671 |
2671 cls := classes first. |
2672 cls := classes first. |
2672 self |
2673 self |
2673 actionToBrowseClass:cls |
2674 actionToBrowseClass:cls |
2674 selector:aMethod selector |
2675 selector:aMethod selector |
2675 info:('Browse implementation in %1' bindWith:cls name) |
2676 info:('Browse implementation in %1' bindWith:cls name) |