--- a/MenuEditor.st Fri Jul 05 00:54:18 2013 +0200
+++ b/MenuEditor.st Tue Jul 09 21:55:06 2013 +0200
@@ -2594,7 +2594,7 @@
!
doBrowseApplicationMethodFor:aspect
- |selector cls category|
+ |selector cls implClass browsedClass category|
specClass isNil ifTrue:[
self warn:(resources string:'Please define the application class first.').
@@ -2617,16 +2617,27 @@
^ self
].
+ browsedClass := cls.
(cls includesSelector:selector) ifFalse:[
- category := UserPreferences current categoryForMenuActionsMethods.
-
- SmalltalkCodeGeneratorTool
- createActionMethodFor:selector in:cls
- category:category
- redefine:(self redefineAspectMethodsChannel value).
+ (implClass := cls whichClassImplements:selector) notNil ifTrue:[
+ (Dialog confirm:(resources
+ stringWithCRs:'The application does not directly implement %1.\However it inherits this from %2.\\Create a redefinition in %1?'
+ with:cls name
+ with:implClass name))
+ ifTrue:[
+ category := UserPreferences current categoryForMenuActionsMethods.
+
+ SmalltalkCodeGeneratorTool
+ createActionMethodFor:selector in:cls
+ category:category
+ redefine:(self redefineAspectMethodsChannel value).
+ ] ifFalse:[
+ browsedClass := implClass
+ ]
+ ]
].
- UserPreferences systemBrowserClass openInClass:cls selector:selector
+ UserPreferences systemBrowserClass openInClass:browsedClass selector:selector
"Created: / 21-10-2010 / 14:07:32 / cg"
"Modified: / 31-01-2011 / 18:28:59 / cg"