Tools__Inspector2.st
changeset 17125 279b7a2a1241
parent 17099 ffa1ce5b5f51
child 17127 ddc52a770246
child 17139 bbe5b1ec2b88
--- a/Tools__Inspector2.st	Wed Nov 30 15:35:09 2016 +0100
+++ b/Tools__Inspector2.st	Wed Nov 30 15:38:24 2016 +0100
@@ -832,7 +832,7 @@
 
 currentObjectIsFilename
     ^ BlockValue
-        with:[:o | o isFilename ]
+        with:[:o | o isProtoObject not and:[o isFilename] ]
         argument:self currentObjectHolder
 
     "Created: / 19-08-2011 / 08:56:27 / cg"
@@ -840,7 +840,7 @@
 
 currentObjectIsImage
     ^ BlockValue
-        with:[:o | o isImage ]
+        with:[:o | o isProtoObject not and:[o isImage] ]
         argument:self currentObjectHolder
 
     "Created: / 15-01-2012 / 10:06:28 / cg"
@@ -1055,8 +1055,10 @@
 
 updateOperationsMenu
     |items|
-    
-    items := currentObjectHolder value inspectorExtraMenuOperations.
+
+    currentObjectHolder value isProtoObject ifFalse:[
+        items := currentObjectHolder value inspectorExtraMenuOperations.
+    ].
     self operationsMenuEnabledHolder value:(items notEmptyOrNil).
 ! !
 
@@ -1495,7 +1497,7 @@
         ] do:[
             displayString := theObject printString contractAtEndTo:15.
         ].
-        displayString := displayString , ' [', (theObject className ? '???')  , ']'
+        displayString := displayString , ' [', (theObject class name ? '???')  , ']'
     ].
     aGCOrStream nextPutAll:displayString.
 
@@ -1510,8 +1512,18 @@
 
     | tab |
 
-    [ 
-        tab := theObject perform:selector 
+    [
+        selector == #inspector2TabForBasicInspect ifTrue:[
+            "kludge for ProtoObject, which does not implement this selector
+             nor #perform:"
+            tab := Tools::Inspector2Tab new
+                        priority: 90;
+                        label:'Basic';
+                        view: (InspectorView new inspect:self);
+                        yourself
+        ] ifFalse:[
+            tab := theObject perform:selector.
+        ].
     ] on: Error do:[:ex|
         "/ for debugging:  
         "/ ex reject.
@@ -1539,7 +1551,14 @@
     tabs := OrderedCollection new.        
 
     "/ Old style - tabs are specified by method #inspector2Tabs
-    selectors := (theObject inspector2Tabs ? #(inspector2TabCommon)) asSet.
+    (theObject isProtoObject or:[theObject isNil]) ifTrue:[
+        "kludge for ProtoObject, which does not implement this selector
+         nor #perform: -- see #initializeTab:"
+        selectors := #(inspector2TabForBasicInspect).
+    ] ifFalse:[
+        selectors := theObject inspector2Tabs.
+    ].
+    selectors := selectors asSet.
 
     "/ New style - tab are defined by methods with <inspector2Tab> annotation
     theObject class withAllSuperclassesDo:[:eachClass|