class definition
authorClaus Gittinger <cg@exept.de>
Mon, 05 Sep 2011 09:54:45 +0200
changeset 2509 173f64701e6a
parent 2508 a6d7499693f0
child 2510 45b4c466a799
class definition changed: #apply
MethodChange.st
--- a/MethodChange.st	Mon Sep 05 08:41:16 2011 +0200
+++ b/MethodChange.st	Mon Sep 05 09:54:45 2011 +0200
@@ -13,7 +13,7 @@
 
 ClassChange subclass:#MethodChange
 	instanceVariableNames:'selector methodCategory privacy previousVersion'
-	classVariableNames:''
+	classVariableNames:'LastReplacementClass'
 	poolDictionaries:''
 	category:'System-Changes'
 !
@@ -221,14 +221,23 @@
 apply
     "apply the change"
 
-    |class|
+    |class className|
 
     class := self changeClass.
     class isNil ifTrue:[
-        self error:('Cannot apply change for missing class: ' , className) mayProceed:true.
-        ^ self
+        className := Dialog 
+                        request:('Cannot apply change for missing class: %1\\Use replacement class (or press cancel)' bindWith:className) withCRs
+                        initialAnswer:LastReplacementClass.
+        (className isEmptyOrNil
+        or:[ (class := Smalltalk classNamed:className) isNil]) ifTrue:[
+            self error:('Cannot apply change for missing class: ' , className) mayProceed:true.
+            ^ self
+        ].
+        LastReplacementClass := className
     ].
     class compile:source classified:methodCategory logged:true.
+
+    "Modified: / 05-09-2011 / 09:27:14 / cg"
 ! !
 
 !MethodChange methodsFor:'comparing'!
@@ -389,7 +398,7 @@
 !MethodChange class methodsFor:'documentation'!
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic3/MethodChange.st,v 1.59 2011-08-31 10:06:12 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/MethodChange.st,v 1.60 2011-09-05 07:54:45 cg Exp $'
 !
 
 version_SVN