SmalltalkCodeGeneratorTool.st
changeset 18375 85e3084484fa
parent 18359 665a7bc9c1e4
child 18422 e53c5e8ee417
--- a/SmalltalkCodeGeneratorTool.st	Thu Sep 13 10:00:04 2018 +0200
+++ b/SmalltalkCodeGeneratorTool.st	Thu Sep 13 14:35:21 2018 +0200
@@ -804,6 +804,36 @@
     self executeCollectedChangesNamed:('Make ',className,' abstract').
 !
 
+createIsObsoleteMethodIn:aClass
+    "create a #isObsolete query method (I'm tired of typing)"
+
+    |metaClass className code|
+
+    metaClass := aClass theMetaclass.
+    className := aClass theNonMetaclass name.
+
+    self startCollectChanges.
+
+    (metaClass includesSelector:#isObsolete) ifFalse:[
+        code :=
+'isObsolete
+    "Return if this class is considered an obsolete class 
+     (it will be marked as such in the browser).
+     True is returned here for myself only; false for subclasses.
+     Obsolete subclasses must redefine this again."
+
+    ^ self == ',className,'.
+'.
+            self 
+                compile:code
+                forClass:metaClass 
+                inCategory:#'queries'.
+    ].
+    self executeCollectedChangesNamed:('Mark ',className,' as obsolete').
+
+    "Created: / 13-09-2018 / 14:35:05 / Claus Gittinger"
+!
+
 createParametrizedInstanceCreationMethodsNamed:selector in:aClass
     "create a #selector instance creation method (I'm tired of typing)"