InspectorView.st
branchjv
changeset 12287 400a99059170
parent 12268 cb43ab66c093
child 12289 75613e714c3d
--- a/InspectorView.st	Fri Sep 07 12:37:19 2012 +0100
+++ b/InspectorView.st	Fri Sep 07 18:28:09 2012 +0100
@@ -449,6 +449,29 @@
 S0$1LSEJBR<@@@@@@@@@@@AOO3D1O2<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@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 206 99 132 156 74 99 206 66 107 115 16 49 255 16 90 189 0 57 132 16 49 206 0 57 198 123 140 255 49 123 255 33 99 222 0 66 99 0 24 239 0 66 255 0 74 255 140 214 148 0 41 140 49 74 198 123 148 255 0 82 90 0 24 132 0 41 206 99 123 156 0 41 198 0 57 74 0 24 255 16 82 214 0 66 90 0 33 189 0 49 107 0 33 206 16 74 214 8 66 218 112 214 255 0 255 208 32 144 199 21 133 186 85 211]; 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_colors
+    "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_colors inspect
+     ImageEditor openOnClass:self andSelector:#imageFor_colors
+     Icon flushCachedIcons
+    "
+
+    <resource: #image>
+
+    ^Icon
+        constantNamed:'InspectorView imageFor_colors'
+        ifAbsentPut:[(Depth8Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#[8]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
+GQ4]GQ4]GQ4]GQ4]GQ4]GQ4]GQ4]GQ4]GQ4]GQ4]GQ4]GQ4]GQ4]GQ4]GQ4]GQ4]GQ4]GQ4@N#(:N @]GQ4]GQ4]GQ4@N#(:N#(*M!!4]GQ4]GQ4@@C(:N#(:
+J"(6@A4]GQ4]@@@@N!!HRD"(*J#P]GQ4]GP@@@AHRD!!H2L#D1GQ4]GQ4@@@@RD!!HRLB4,KA4]GQ4]@@@@D!!HRH"T*J"(]GQ4]GP@@@@,IH"H"H"(]GQ4]GQ4]
+@@@KDRH%H"\]GQ4]GQ4]GQ4@BP$ZH @]GQ4]GQ4]GQ4]GQ4]GQ4]GQ4]GQ4]GQ4]GQ4]GQ4]GQ4]GQ4]GQ4]GQ4]GQ4]GQ4]GQ4]GP@a') ; colorMapFromArray:#[0 58 255 0 135 255 0 230 255 0 252 254 0 255 127 0 255 175 0 255 244 0 255 249 63 243 47 115 82 16 125 141 170 128 32 210 156 131 74 158 160 171 161 153 136 180 196 100 191 187 200 192 22 179 195 255 19 198 173 123 198 181 123 206 165 66 206 173 99 206 182 99 207 206 217 216 179 229 219 0 153 223 255 19 225 255 19 226 226 226 229 255 19 246 223 40 247 246 216 248 221 223 250 0 86 252 233 208 254 255 25 255 59 19 255 98 19 255 115 19 255 127 26 255 137 26 255 167 32 255 185 155 255 186 0 255 188 0 255 189 16 255 193 19 255 197 19 255 200 19 255 206 19 255 210 26 255 213 26 255 236 19 255 248 0 255 255 0 255 255 19 255 255 255 0 206 0]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@<@G8@?0G? _>A?8G? O<@_ @<@@@@@@@@@b') ; yourself); yourself]
+!
+
 imageFor_dictionaries
     "This resource specification was automatically generated
      by the ImageEditor of ST/X."
@@ -960,7 +983,7 @@
 doubleClickOnLine:lineNr
     |objectToInspect app|
 
-    objectToInspect := self selection ? object.
+    objectToInspect := self selectedField.
 
     "HACK"
     app := (self topView perform:#application ifNotUnderstood: [nil]).
@@ -996,6 +1019,14 @@
     ].
 !
 
+selectedField
+    ^ self theSingleSelectionIndex isNil 
+                            ifTrue:[object] 
+                            ifFalse:[self selection].
+
+    "Created: / 27-07-2012 / 22:42:23 / cg"
+!
+
 sizeChanged:how
     super sizeChanged:how.
 
@@ -1502,47 +1533,47 @@
 browse
     |cls|
 
-    cls := (self selection ? object) class.
+    cls := self selectedField class.
     (cls browserClass ? UserPreferences current systemBrowserClass) 
         openInClass:cls selector:nil
 
     "Created: / 14-12-1995 / 19:15:50 / cg"
-    "Modified: / 03-08-2011 / 15:07:42 / cg"
+    "Modified: / 27-07-2012 / 22:42:44 / cg"
 !
 
 browseClass
     |cls|
 
-    cls := (self selection ? object) class.
+    cls := self selectedField class.
     cls browserClass 
         openInClass:cls selector:nil
         "/ browseClass:cls
 
-    "Modified: / 03-08-2011 / 15:05:58 / cg"
+    "Modified: / 27-07-2012 / 22:42:39 / cg"
 !
 
 browseClassHierarchy
     |cls|
 
-    cls := (self selection ? object) class.
+    cls := self selectedField class.
     cls browserClass browseClassHierarchy:cls
 
-    "Modified: 3.5.1996 / 12:40:04 / cg"
+    "Modified: / 27-07-2012 / 22:42:47 / cg"
 !
 
 browseFullClassProtocol
     |cls|
 
-    cls := (self selection ? object) class.
+    cls := self selectedField class.
     cls browserClass browseFullClassProtocol:cls
 
-    "Modified: 3.5.1996 / 12:40:17 / cg"
+    "Modified: / 27-07-2012 / 22:42:50 / cg"
 !
 
 browseHome
     |sel mthd|
 
-    sel := self selection ? object.
+    sel := self selectedField.
     sel isBlock ifTrue:[
         mthd := sel homeMethod
     ] ifFalse:[
@@ -1555,6 +1586,8 @@
     ].
     mthd class browserClass 
         openInClass:mthd mclass selector:mthd selector
+
+    "Modified: / 27-07-2012 / 22:42:55 / cg"
 !
 
 browseMethodsClass
@@ -1775,7 +1808,7 @@
 letSelectedObjectPerform:aSelector
     |sel argString|
 
-    sel := self selection ? object.
+    sel := self selectedField.
     aSelector numArgs == 0 ifTrue:[
         (sel perform:aSelector) inspect.
         ^ self.
@@ -1788,7 +1821,7 @@
     ].
 self halt.
 
-    "Modified: / 07-10-2010 / 14:34:21 / cg"
+    "Modified: / 27-07-2012 / 22:43:37 / cg"
 !
 
 openFileBrowser
@@ -2135,6 +2168,9 @@
     anObject isBehavior ifTrue:[
         ^ self class imageFor_classes
     ].
+    anObject isColor ifTrue:[
+        ^ self class imageFor_colors
+    ].
     ^ self class imageFor_others
 
     "Created: / 16-05-2012 / 17:58:20 / cg"
@@ -2147,19 +2183,22 @@
         ^ nameString
     ].
 
-    entryString := nameString allBold,(self valueStringInListEntryForValue:value).
-
-    value isColor ifTrue:[
-        entryString := entryString
-                     , '  ' , ('   '
-                        colorizeAllWith:((value brightness < 0.5)
-                                ifTrue:[ Color white ]
-                                ifFalse:[ Color black ])
-                        on:value).
+    Error handle:[:ex |
+        ^ nameString
+    ] do:[
+        entryString := nameString allBold,(self valueStringInListEntryForValue:value).
+        (value isColor and:[value red notNil]) ifTrue:[
+            entryString := entryString
+                         , '  ' , ('   '
+                            colorizeAllWith:((value brightness < 0.5)
+                                    ifTrue:[ Color white ]
+                                    ifFalse:[ Color black ])
+                            on:value).
+        ].
+
+        ^ LabelAndIcon string:entryString image:(self iconForValue:value)
     ].
 
-    ^ LabelAndIcon string:entryString image:(self iconForValue:value)
-
     "Created: / 16-05-2012 / 18:42:28 / cg"
 !
 
@@ -2191,7 +2230,7 @@
         ^ value storeString,(' "%1"' bindWith:(value codePoint))
     ].
     value isString ifTrue:[
-        ^ value contractTo:30.
+        ^ value storeString contractTo:30.
     ].
     value isColor ifTrue:[
         ^ value htmlPrintString
@@ -2587,7 +2626,7 @@
 
     ^ list.
 
-    "Modified: / 16-05-2012 / 18:43:10 / cg"
+    "Modified: / 22-08-2012 / 19:19:05 / cg"
     "Modified: / 06-07-2012 / 10:37:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
@@ -2701,7 +2740,7 @@
 
     entry := listView at:lineNr.
     entry isNil ifTrue:[^ entry].
-    ^ entry string
+    ^ entry perform:#string ifNotUnderstood:[ entry printString ].
 
     "Created: / 16-05-2012 / 17:53:39 / cg"
 !
@@ -2717,7 +2756,7 @@
 namedFieldList 
     "return a list of instVar names to show in the selectionList."
 
-    |aList cls baseCls|
+    |aList cls baseCls offset|
 
     cls := object class.
     baseCls := self baseInspectedObjectClass.
@@ -2725,20 +2764,22 @@
     aList := OrderedCollection new.
 
     aList addAll:(cls allInstVarNames).
+    offset := 0.
     (cls includesBehavior:baseCls) ifTrue:[
         "/ hide some stuff
-        aList := aList copyFrom:(self baseInspectedObjectClass instSize + 1).
+        offset := self baseInspectedObjectClass instSize.
+        aList := aList copyFrom:(offset + 1).
     ].
     aList := aList 
                 keysAndValuesCollect:[:idx :nm |
-                    self listEntryForName:nm value:(object instVarAt:idx)
+                    self listEntryForName:nm value:(object instVarAt:idx+offset)
                 ].
     sortOrder == #alphabetical ifTrue:[
         aList sort:[:a :b | a string < b string].
     ].
     ^ aList
 
-    "Modified: / 20-07-2012 / 10:58:13 / cg"
+    "Modified: / 29-07-2012 / 12:11:06 / cg"
 !
 
 numIndexedFields
@@ -3183,7 +3224,7 @@
 
     |objectToInspect app |
 
-    objectToInspect := self selection ? object.
+    objectToInspect := self selectedField.
     objectToInspect notNil ifTrue:[
         (basic == #new and:[NewInspector::NewInspectorView notNil]) ifTrue:[
             NewInspector::NewInspectorView inspect:objectToInspect
@@ -3206,7 +3247,7 @@
     ].
 
     "Modified: / 06-07-2011 / 15:58:55 / jv"
-    "Modified: / 29-07-2011 / 21:07:21 / cg"
+    "Modified: / 27-07-2012 / 22:43:11 / cg"
 !
 
 doUpdate
@@ -3293,13 +3334,13 @@
 !InspectorView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.272 2012/07/25 11:22:23 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.278 2012/08/23 11:45:48 cg Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.272 2012/07/25 11:22:23 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.278 2012/08/23 11:45:48 cg Exp §'
 !
 
 version_SVN
-    ^ '$Id: InspectorView.st 8026 2012-07-26 16:09:41Z vranyj1 $'
+    ^ '$Id: InspectorView.st 8048 2012-09-07 17:28:09Z vranyj1 $'
 ! !