ProtoObject.st
changeset 22385 1c6129237329
parent 22001 546f216b8947
child 22647 8d71f14e06fa
--- a/ProtoObject.st	Wed Nov 29 11:09:41 2017 +0100
+++ b/ProtoObject.st	Wed Nov 29 11:19:04 2017 +0100
@@ -143,13 +143,55 @@
 
 !ProtoObject methodsFor:'inspecting'!
 
-inspect
+basicInspect
     "this method is required to allow inspection of the object"
 
-    ^ (Object compiledMethodAt:#inspect)
+    ^ (Object compiledMethodAt:#basicInspect)
         valueWithReceiver:self
         arguments:nil
-        selector:#inspect
+        selector:#basicInspect
+
+    "Created: / 28-11-2017 / 19:23:47 / stefan"
+!
+
+inspect
+    "{ Pragma: +optSpace }"
+
+    "launch an inspector on the receiver.
+     this method (or better: inspectorClass) can be redefined in subclasses
+     to start special inspectors."
+
+    |cls|
+
+    cls := self inspectorClass.
+    cls isNil ifTrue:[
+        self basicInspect.
+        ^ self.
+    ].
+    cls openOn:self
+
+    "
+     ProtoObject new inspect
+    "
+
+    "Modified: / 29-11-2017 / 10:39:38 / stefan"
+!
+
+inspectorClass
+    Inspector ~~ MiniInspector ifTrue:[
+        |cls|
+
+        cls := Smalltalk classNamed: #'Tools::Inspector2'.
+        cls notNil ifTrue:[
+            ^ cls.
+        ].
+    ].
+    Inspector notNil ifTrue:[
+        ^ Inspector.
+    ].
+    ^ Smalltalk classNamed: #'InspectorView'.
+
+    "Created: / 29-11-2017 / 10:20:09 / stefan"
 !
 
 instVarAt:index
@@ -662,6 +704,17 @@
 
 !ProtoObject methodsFor:'queries'!
 
+basicSize
+    "this method is required to allow restore of the object"
+
+    ^ (Object compiledMethodAt:#basicSize)
+        valueWithReceiver:self
+        arguments:nil
+        selector:#basicSize
+
+    "Created: / 28-11-2017 / 19:30:09 / stefan"
+!
+
 class
     "return the receiver's class"