InspectorView.st
branchjv
changeset 12308 5d9291c0fc27
parent 12296 6921627a8c27
child 12314 0cbf76168690
--- a/InspectorView.st	Fri Nov 30 14:25:59 2012 +0000
+++ b/InspectorView.st	Fri Nov 30 17:23:39 2012 +0000
@@ -588,6 +588,12 @@
 !
 
 imageFor_nil
+    ^ self imageFor_nil2
+
+    "Modified: / 21-11-2012 / 14:24:21 / cg"
+!
+
+imageFor_nil1
     "This resource specification was automatically generated
      by the ImageEditor of ST/X."
 
@@ -595,21 +601,43 @@
      the ImageEditor may not be able to read the specification."
 
     "
-     self imageFor_nil inspect
-     ImageEditor openOnClass:self andSelector:#imageFor_nil
+     self imageFor_nil1 inspect
+     ImageEditor openOnClass:self andSelector:#imageFor_nil1
      Icon flushCachedIcons
     "
 
     <resource: #image>
 
     ^Icon
-        constantNamed:'InspectorView class imageFor_nil'
+        constantNamed:'InspectorView imageFor_nil1'
         ifAbsentPut:[(Depth8Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#[8]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@KEP4MEP,@@@@@@@@@@@@GEA$YAP4OA0@@@@@@@@@JEA$WF!!HM
 C1 J@@@@@@@@EQ$R@@ CEAXDDP@@@@@@@@4ED!!(ACQXXC@X@@@@@@@@ME@4TEAXXCALF@@@@@@@@EQXVE HXC@XNF@@@@@@@@@(DF@PLCALNC!!@@@@@@@@@@
 A1LSA 8NC 4@@@@@@@@@@@@JF@XFFA@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[226 226 226 176 176 176 155 155 155 169 169 169 152 152 152 164 164 164 149 149 149 192 192 192 240 240 240 255 255 255 202 202 202 201 201 201 151 151 151 162 162 162 148 148 148 158 158 158 173 173 173 154 154 154 167 167 167 150 150 150 160 160 160 180 180 180 156 156 156 170 170 170 153 153 153 165 165 165 183 183 183]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@A>@O<A?8G? _>A?8G? _>@?0A>@@@@@@@@@b') ; yourself); yourself]
 !
 
+imageFor_nil2
+    "This resource specification was automatically generated
+     by the ImageEditor of ST/X."
+
+    "Do not manually edit this!! If it is corrupted,
+     the ImageEditor may not be able to read the specification."
+
+    "
+     self imageFor_nil2 inspect
+     ImageEditor openOnClass:self andSelector:#imageFor_nil2
+     Icon flushCachedIcons
+    "
+
+    <resource: #image>
+
+    ^Icon
+        constantNamed:'InspectorView imageFor_nil2'
+        ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#[4]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
+"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"G]7]8"H"H"GQDP3BH"H"GQCL3NP"H"H]CL3L6BH"H!!4L3L3TH"H"GP3L3L "H"H\3L3M1BH"H!!3L3M:DH"H"H
+B*,QDH"H"H"@@@@H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H b') ; colorMapFromArray:#[0 0 0 74 74 0 94 99 0 240 240 240 255 255 255 132 132 0 143 148 0 142 131 128 226 226 226 151 156 0 107 107 0 87 90 0]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@A>@O<A?8G? _>A?8G? _>@?0A>@@@@@@@@@b') ; yourself); yourself]
+!
+
 imageFor_others
     "This resource specification was automatically generated
      by the ImageEditor of ST/X."
@@ -626,11 +654,10 @@
     <resource: #image>
 
     ^Icon
-        constantNamed:'InspectorView class imageFor_others'
-        ifAbsentPut:[(Depth8Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#[8]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@_G1<_G1<@@@@@@@@@@@@_BP$IBP HF0@@@@@@@@@_BP$HH@ \
-BA8[@@@@@@@@G0$HH  ,BB$(F0@@@@@@@A<IJ0 $BB$HGQ,@@@@@@@@_BP #BBDHJRX[@@@@@@@@G0 )BB4HHQ<%F0@@@@@@@A<HBB4HKQ<''IQ,@@@@@@@@@
-F2\''J"T%IQ,@@@@@@@@@@@@[F1,[F1,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[226 226 226 176 176 176 155 155 155 169 169 169 152 152 152 164 164 164 149 149 149 192 192 192 240 240 240 255 255 255 202 202 202 201 201 201 151 151 151 162 162 162 148 148 148 158 158 158 173 173 173 154 154 154 167 167 167 150 150 150 160 160 160 180 180 180 156 156 156 170 170 170 153 153 153 165 165 165 183 183 183 0 0 0 227 231 0 132 132 0 151 156 0 142 131 128 255 252 49 175 181 0 255 234 140 218 222 0 251 255 33 74 74 0 94 99 0 107 107 0 143 148 0 189 189 0 87 90 0 251 255 8 247 255 16 167 173 0]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@A>@O<A?8G? _>A?8G? _>@?0A>@@@@@@@@@b') ; yourself); yourself]
+        constantNamed:'InspectorView imageFor_others'
+        ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#[4]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
+H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H#L3L2H"H"H#&Y%U@"H"H#&U=WV0H"H"NU=WUK@"H"H9=WUE,BH"H#%VVES H"H"MTTU =@"H"H5TUD:4BH"H"
+B*3]4BH"H"H @@@BH"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"Hb') ; colorMapFromArray:#[0 0 0 168 174 0 228 226 230 144 132 130 188 190 0 240 240 240 220 222 0 228 232 0 176 182 0 255 255 255 108 108 0 152 156 0 88 90 0 76 74 0 96 100 0 255 252 50]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@A>@O<A?8G? _>A?8G? _>@?0A>@@@@@@@@@b') ; yourself); yourself]
 !
 
 imageFor_sequenceableCollections
@@ -1001,7 +1028,7 @@
 
     <resource: #keyboard (#BrowseIt #InspectIt)>
 
-    self selection notNil ifTrue:[
+    self theSingleSelectionIndex "selection" notNil ifTrue:[
         (key == #BrowseIt) ifTrue:[
             self browse.
             ^ self.
@@ -1716,7 +1743,7 @@
         selector := string asSymbolIfInterned.
 
         selector isNil ifTrue:[
-            self warn:'no such selector'
+            self warn:'No such selector'
         ] ifFalse:[
             self topView withWaitCursorDo:[MessageTracer trap:object 
                                                          selector:selector]
@@ -1749,7 +1776,7 @@
         "/ a named instVar ?
         idx := self instVarIndexForLine:selectionIndex.
         idx isNil ifTrue:[
-            self warn:'select an instance variable first.'.
+            self warn:'Select an instance variable first.'.
             ^ self.
         ].
         MessageTracer 
@@ -2127,6 +2154,9 @@
     anObject isNil ifTrue:[
         ^ self class imageFor_nil
     ].
+    anObject isLazyValue ifTrue:[
+        ^ self class imageFor_others
+    ].
     anObject isNumber ifTrue:[
         anObject isInteger ifTrue:[
             ^ self class imageFor_integers
@@ -2187,7 +2217,7 @@
         ^ nameString
     ] do:[
         entryString := nameString allBold,(self valueStringInListEntryForValue:value).
-        (value isColor and:[value red notNil]) ifTrue:[
+        (value isLazyValue not and:[value isColor and:[value red notNil]]) ifTrue:[
             entryString := entryString
                          , '  ' , ('   '
                             colorizeAllWith:((value brightness < 0.5)
@@ -2216,7 +2246,10 @@
         ].
         ^ nil
     ].
-
+    value isLazyValue ifTrue:[
+        "do not block on not yet finished Futures et al"
+        ^ '>>Lazy value<<'
+    ].
     (value isNumber or:[value isBoolean]) ifTrue:[
         ^ self basicDisplayStringForValue:value "value printString"
     ].
@@ -2603,16 +2636,25 @@
             | val |
             
             [
-                val := self indexedValueAtIndex: idx
+                val := self indexedValueAtIndex:idx.
             ] on:Error do:[
                 val := '** ERROR **'
             ].
+"/            [
+"/                val := object at:idx.
+"/            ] on:Error do:[
+"/                [
+"/                    val := object basicAt:idx
+"/                ] on:Error do:[
+"/                    val := ''
+"/                ]
+"/            ].
             self listEntryForName:nm value:val
         ].
 
 "/    ^ list.
 
-    "Modified: / 21-09-2012 / 11:18:28 / cg"
+    "Modified: / 27-09-2012 / 21:51:58 / cg"
     "Modified: / 06-07-2012 / 10:37:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
@@ -2803,14 +2845,18 @@
         list add:'-' , 'basicSize' allItalic, (self valueStringInListEntryForValue:object basicSize).
     ].
     object isCollection ifTrue:[
-        (cls whichClassImplements:#size) == (cls whichClassImplements:#basicSize) ifFalse:[
-            list add:'-' , 'size' allItalic , (self valueStringInListEntryForValue:object size).
+        (cls whichClassImplements:#size) ~~ (cls whichClassImplements:#basicSize) ifTrue:[
+            Error handle:[:ex |
+            ] do:[
+                "/ Iterator has trouble
+                list add:'-' , 'size' allItalic , (self valueStringInListEntryForValue:object size).
+            ].
         ]
     ].
 
     cls hasImmediateInstances ifFalse:[
         object dependents notEmptyOrNil ifTrue:[
-            list add:'-' , 'dependents' allItalic.
+            list add:'-' , 'dependents' allItalic, (self valueStringInListEntryForValue:object dependents size).
         ].
     ].
     cls instSize > 0 ifTrue:[
@@ -2928,7 +2974,9 @@
     ].
 
     ((l := self listEntryAt:lineNr) startsWith:$-) ifTrue:[
-        (l ~= '-' and:[(l at:2) isDigit not "negative number"]) ifTrue:[
+        (l ~= '-' 
+        and:[(l at:2) isSeparator not
+        and:[(l at:2) isDigit not "negative number"]]) ifTrue:[
             ^ self valueForSpecialLine:l
         ].
     ].
@@ -3097,8 +3145,15 @@
 !
 
 selectedKeyName
+    |sel|
+
     selectionIndex notNil ifTrue:[
-        ^ listView listAt:selectionIndex.
+        sel := listView listAt:selectionIndex.
+        sel notNil ifTrue:[
+            sel := sel string.
+            sel := sel copyUpTo:(Character space).
+            ^ sel
+        ].
     ].
     ^ nil
 !
@@ -3148,13 +3203,18 @@
     |s|
 
     self "topView" withWaitCursorDo:[
-        s := self displayStringForValue:someValue.
+        [
+            s := self displayStringForValue:someValue.
+        ] valueWithWatchDog:[
+            s := someValue classNameWithArticle
+        ] afterMilliseconds:100.
+
         s = workspace selectionAsString ifFalse:[
             workspace replace:s.
         ].
     ].
 
-    "Modified: / 30-11-2010 / 18:56:55 / cg"
+    "Modified: / 28-10-2012 / 11:03:04 / cg"
 ! !
 
 !InspectorView methodsFor:'user interaction'!
@@ -3198,7 +3258,7 @@
     |nm selIdx|
 
     (selIdx := self theSingleSelectionIndex) notNil ifTrue:[
-        nm := listView listAt:selIdx.
+        nm := self selectedKeyName.
         nm notNil ifTrue:[
             self setClipboardText:(nm asString)
         ]
@@ -3320,13 +3380,13 @@
 !InspectorView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.280 2012/09/24 10:34:43 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.293 2012/11/21 13:35:59 cg Exp $'
 !
 
 version_CVS
-    ^ 'Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.280 2012/09/24 10:34:43 cg Exp '
+    ^ 'Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.293 2012/11/21 13:35:59 cg Exp '
 !
 
 version_SVN
-    ^ '$Id: InspectorView.st 8059 2012-09-27 20:08:20Z vranyj1 $'
+    ^ '$Id: InspectorView.st 8074 2012-11-30 17:23:39Z vranyj1 $'
 ! !