author | Claus Gittinger <cg@exept.de> |
Tue, 16 Nov 2010 15:29:06 +0100 | |
changeset 9635 | aaaff033bfba |
parent 9324 | 86307b0d7c57 |
child 9673 | c590ef71ca2a |
permissions | -rw-r--r-- |
8970 | 1 |
"{ Package: 'stx:libtool' }"! |
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
2 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
3 |
!ByteArray methodsFor:'inspecting'! |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
4 |
|
8843 | 5 |
inspectorExtraAttributes |
6 |
"extra (pseudo instvar) entries to be shown in an inspector." |
|
8839 | 7 |
|
8843 | 8 |
^ Dictionary new |
9324
86307b0d7c57
hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents:
9050
diff
changeset
|
9 |
declareAllNewFrom:(super inspectorExtraAttributes ? #()); |
86307b0d7c57
hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents:
9050
diff
changeset
|
10 |
add:'-hexstring' -> [ self hexPrintString "WithSeparator:Character space" ]; |
86307b0d7c57
hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents:
9050
diff
changeset
|
11 |
add:'-hexadecimal' -> |
86307b0d7c57
hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents:
9050
diff
changeset
|
12 |
[ |
86307b0d7c57
hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents:
9050
diff
changeset
|
13 |
String |
86307b0d7c57
hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents:
9050
diff
changeset
|
14 |
streamContents:[:s | |
86307b0d7c57
hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents:
9050
diff
changeset
|
15 |
self class isWords ifTrue:[ |
86307b0d7c57
hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents:
9050
diff
changeset
|
16 |
self asWordArray printOn:s base:16 showRadix:true |
86307b0d7c57
hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents:
9050
diff
changeset
|
17 |
] ifFalse:[ |
86307b0d7c57
hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents:
9050
diff
changeset
|
18 |
self class isLongs ifTrue:[ |
86307b0d7c57
hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents:
9050
diff
changeset
|
19 |
self asLongIntegerArray printOn:s base:16 showRadix:true |
86307b0d7c57
hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents:
9050
diff
changeset
|
20 |
] ifFalse:[ |
86307b0d7c57
hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents:
9050
diff
changeset
|
21 |
self asByteArray printOn:s base:16 showRadix:true |
86307b0d7c57
hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents:
9050
diff
changeset
|
22 |
] |
86307b0d7c57
hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents:
9050
diff
changeset
|
23 |
] |
86307b0d7c57
hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents:
9050
diff
changeset
|
24 |
] |
86307b0d7c57
hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents:
9050
diff
changeset
|
25 |
]; |
86307b0d7c57
hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents:
9050
diff
changeset
|
26 |
yourself |
7365 | 27 |
|
28 |
"Created: / 18-09-2006 / 21:29:59 / cg" |
|
29 |
"Modified: / 06-10-2006 / 13:57:20 / cg" |
|
30 |
! ! |
|
31 |
||
8843 | 32 |
!Character methodsFor:'inspecting'! |
33 |
||
34 |
inspectorExtraAttributes |
|
35 |
"extra (pseudo instvar) entries to be shown in an inspector." |
|
8677 | 36 |
|
8843 | 37 |
^ Dictionary new |
38 |
declareAllNewFrom:(super inspectorExtraAttributes ? #()); |
|
39 |
add:'-hexValue' -> [ self codePoint radixPrintStringRadix:16 ]; |
|
40 |
add:'-string' -> [ self stringSpecies with:self ]; |
|
41 |
add:'-utf8String' -> [ self utf8Encoded ]; |
|
42 |
add:'-utf8' -> [ self utf8Encoded asByteArray hexPrintStringWithSeparator:Character space ]; |
|
43 |
yourself |
|
44 |
||
45 |
" |
|
46 |
$a inspect |
|
47 |
" |
|
48 |
||
49 |
"Created: / 22-10-2006 / 03:52:20 / cg" |
|
7447 | 50 |
! ! |
51 |
||
8843 | 52 |
!CharacterArray methodsFor:'inspecting'! |
8417 | 53 |
|
8843 | 54 |
inspectorExtraAttributes |
55 |
"extra (pseudo instvar) entries to be shown in an inspector." |
|
56 |
||
57 |
|d| |
|
8417 | 58 |
|
8843 | 59 |
d := Dictionary new |
60 |
declareAllNewFrom:(super inspectorExtraAttributes ? #()); |
|
61 |
add:'-utf8String' -> [ self utf8Encoded ]; |
|
62 |
add:'-utf8' -> [ self utf8Encoded asByteArray hexPrintStringWithSeparator:Character space ]; |
|
63 |
yourself. |
|
8839 | 64 |
|
8843 | 65 |
HTMLUtilities notNil ifTrue:[ |
66 |
d add:'-html' -> [ HTMLUtilities escapeCharacterEntities:self ]. |
|
8417 | 67 |
]. |
68 |
^ d |
|
69 |
||
70 |
" |
|
71 |
'aouäöü' inspect |
|
72 |
" |
|
73 |
||
74 |
"Created: / 22-10-2006 / 03:52:20 / cg" |
|
75 |
! ! |
|
76 |
||
8843 | 77 |
!Collection methodsFor:'inspecting'! |
78 |
||
79 |
inspectorExtraAttributes |
|
80 |
"extra (pseudo instvar) entries to be shown in an inspector." |
|
8677 | 81 |
|
8843 | 82 |
^ Dictionary new |
83 |
declareAllNewFrom:(super inspectorExtraAttributes ? #()); |
|
84 |
add:('-size' -> [ self size ]); |
|
85 |
yourself |
|
86 |
||
87 |
" |
|
88 |
'hello' inspect |
|
89 |
" |
|
90 |
||
91 |
"Created: / 06-10-2006 / 13:56:52 / cg" |
|
92 |
"Modified: / 06-10-2006 / 17:43:45 / cg" |
|
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
93 |
! ! |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
94 |
|
8843 | 95 |
!Color methodsFor:'inspecting'! |
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
96 |
|
8843 | 97 |
inspectorClass |
98 |
"return the class of an appropriate inspector. |
|
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
99 |
ST/X has a specialized ColorInspectorView for that" |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
100 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
101 |
^ ColorInspectorView |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
102 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
103 |
"Modified: 23.4.1996 / 13:39:50 / cg" |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
104 |
! ! |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
105 |
|
8843 | 106 |
!Color methodsFor:'inspecting'! |
8406 | 107 |
|
8843 | 108 |
inspectorExtraAttributes |
8677 | 109 |
"extra (pseudo instvar) entries to be shown in an inspector." |
110 |
||
8406 | 111 |
^ Dictionary new |
8843 | 112 |
declareAllNewFrom:(super inspectorExtraAttributes ? #()); |
113 |
add:'-rgb' -> [ self rgbValue hexPrintString ]; |
|
114 |
add:'-html' -> [ self htmlPrintString ]; |
|
115 |
yourself |
|
8417 | 116 |
|
117 |
" |
|
118 |
Color red inspect |
|
119 |
" |
|
8406 | 120 |
! ! |
121 |
||
8843 | 122 |
!Dictionary methodsFor:'inspecting'! |
123 |
||
124 |
inspectorClass |
|
125 |
"redefined to use DictionaryInspector |
|
126 |
(instead of the default Inspector)." |
|
127 |
||
128 |
^ DictionaryInspectorView |
|
129 |
! ! |
|
130 |
||
131 |
!ExecutableFunction methodsFor:'printing & storing'! |
|
132 |
||
133 |
printStringForBrowserWithSelector:selector |
|
134 |
"return a printString to represent myself to the user in a browser." |
|
135 |
||
136 |
^ self printStringForBrowserWithSelector:selector inClass:nil |
|
137 |
! ! |
|
138 |
||
139 |
!Form methodsFor:'inspecting'! |
|
140 |
||
141 |
inspectorClass |
|
142 |
"redefined to launch an ImageInspector |
|
143 |
(instead of the default InspectorView)." |
|
144 |
||
145 |
^ ImageInspectorView |
|
146 |
! ! |
|
147 |
||
8839 | 148 |
!Image methodsFor:'inspecting'! |
149 |
||
8843 | 150 |
inspectorClass |
151 |
"redefined to launch an ImageInspector |
|
152 |
(instead of the default InspectorView)." |
|
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
153 |
|
8843 | 154 |
(width notNil and:[height notNil]) ifTrue:[ |
155 |
^ ImageInspectorView |
|
156 |
]. |
|
157 |
^ super inspectorClass |
|
158 |
||
159 |
"Modified: 10.6.1996 / 18:23:55 / cg" |
|
8839 | 160 |
! ! |
161 |
||
162 |
!Integer methodsFor:'inspecting'! |
|
163 |
||
8843 | 164 |
inspectorExtraAttributes |
165 |
"extra (pseudo instvar) entries to be shown in an inspector." |
|
166 |
||
167 |
^ Dictionary new |
|
168 |
declareAllNewFrom:(super inspectorExtraAttributes ? #()); |
|
169 |
add:'-hexadecimal' -> [ self radixPrintStringRadix:16 ]; |
|
170 |
add:'-octal' -> [ self radixPrintStringRadix:8 ]; |
|
171 |
add:'-binary' -> [ self radixPrintStringRadix:2 ]; |
|
172 |
yourself |
|
173 |
||
174 |
" |
|
175 |
123 inspect |
|
176 |
" |
|
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
177 |
|
8843 | 178 |
"Created: / 18-09-2006 / 21:22:46 / cg" |
179 |
"Modified: / 06-10-2006 / 13:57:28 / cg" |
|
180 |
! ! |
|
181 |
||
8839 | 182 |
!Method methodsFor:'inspecting'! |
7735 | 183 |
|
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
184 |
inspectorExtraAttributes |
8677 | 185 |
"extra (pseudo instvar) entries to be shown in an inspector." |
186 |
||
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
187 |
^ Dictionary new |
8843 | 188 |
declareAllNewFrom:(super inspectorExtraAttributes ? #()); |
189 |
add:'-code' -> [ String streamContents:[:s | self decompileTo:s] ]; |
|
190 |
add:'-source' -> [ self source ]; |
|
191 |
yourself |
|
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
192 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
193 |
" |
8843 | 194 |
(Method compiledMethodAt:#inspectorExtraAttributes) inspect |
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
195 |
" |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
196 |
|
8843 | 197 |
"Created: / 18-09-2006 / 21:34:01 / cg" |
198 |
"Modified: / 06-10-2006 / 13:57:33 / cg" |
|
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
199 |
! ! |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
200 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
201 |
!Method methodsFor:'printing & storing'! |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
202 |
|
8843 | 203 |
printStringForBrowserWithSelector:selector inClass:aClass |
204 |
"return a printString to represent myself to the user in a browser. |
|
205 |
Defined here to allow for browsers to deal with nonStandard pseudoMethods" |
|
206 |
||
207 |
|s privInfo moreInfo p info n cls currentChangeSet isInChangeSet mthdPackage |
|
208 |
userPreferences shownSelector suppressPackage timeRounded| |
|
209 |
||
210 |
moreInfo := ''. |
|
211 |
privInfo := ''. |
|
212 |
userPreferences := UserPreferences current. |
|
213 |
||
214 |
self isWrapped ifTrue:[ |
|
8970 | 215 |
(MessageTracer isCounting:self) ifTrue:[ |
216 |
(MessageTracer isCountingMemoryUsage:self) ifTrue:[ |
|
217 |
moreInfo := moreInfo , (' (mem usage avg: %1 bytes)' bindWith:(MessageTracer memoryUsageOfMethod:self) printString allBold). |
|
218 |
] ifFalse:[ |
|
219 |
moreInfo := moreInfo , (' (called %1 times)' bindWith:(MessageTracer executionCountOfMethod:self) printString allBold). |
|
220 |
] |
|
221 |
] ifFalse:[ |
|
222 |
(MessageTracer isTiming:self) ifTrue:[ |
|
223 |
info := MessageTracer executionTimesOfMethod:self. |
|
224 |
((n := info count) == 0) ifTrue:[ |
|
225 |
moreInfo := moreInfo , (' (cnt: %1)' bindWith:n) |
|
226 |
] ifFalse:[ |
|
227 |
timeRounded := [:millis | |
|
228 |
|rnd| |
|
229 |
rnd := (millis > 100) |
|
230 |
ifTrue:[ 1 ] |
|
231 |
ifFalse:[ |
|
232 |
(millis > 10) |
|
233 |
ifTrue:[ 0.1 ] |
|
234 |
ifFalse:[ |
|
235 |
(millis > 1) |
|
236 |
ifTrue:[ 0.01 ] |
|
237 |
ifFalse:[ 0.001 ]]]. |
|
238 |
millis roundTo:rnd |
|
239 |
]. |
|
8843 | 240 |
|
8970 | 241 |
(n == 1 or:[ info avgTimeRounded = info minTimeRounded ]) ifTrue:[ |
242 |
moreInfo := moreInfo , |
|
243 |
(' (t: %1ms cnt: %2)' |
|
244 |
bindWith:((timeRounded value:info avgTimeRounded) printString allBold) |
|
245 |
with:n) |
|
246 |
] ifFalse:[ |
|
247 |
moreInfo := moreInfo , |
|
248 |
(' (avg: %1ms min: %2 max: %3 cnt: %4)' |
|
249 |
bindWith:((timeRounded value:info avgTimeRounded) printString allBold) |
|
250 |
with:((timeRounded value:info minTimeRounded) printString) |
|
251 |
with:((timeRounded value:info maxTimeRounded) printString) |
|
252 |
with:n) |
|
253 |
]. |
|
254 |
]. |
|
255 |
] ifFalse:[ |
|
256 |
moreInfo := ' !!' |
|
257 |
] |
|
258 |
]. |
|
7703 | 259 |
]. |
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
260 |
p := self privacy. |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
261 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
262 |
p ~~ #public ifTrue:[ |
9050
b9df3c89888d
comment/format in: #colorizeAllWith:on:
Claus Gittinger <cg@exept.de>
parents:
8970
diff
changeset
|
263 |
privInfo := (' (* ' , p , ' *)') allItalic. |
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
264 |
]. |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
265 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
266 |
"/ self isInvalid ifTrue:[ |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
267 |
"/ moreInfo := ' (** not executable **)'. |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
268 |
"/ ]. |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
269 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
270 |
(self isLazyMethod not and:[self isUnloaded]) ifTrue:[ |
8970 | 271 |
moreInfo := ' (** unloaded **)' |
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
272 |
]. |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
273 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
274 |
privInfo size ~~ 0 ifTrue:[ |
8970 | 275 |
moreInfo := privInfo , ' ' , moreInfo |
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
276 |
]. |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
277 |
|
7703 | 278 |
s := shownSelector := (self selectorPrintStringInBrowserFor:selector class:aClass). |
279 |
||
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
280 |
(cls := aClass) isNil ifTrue:[ |
8970 | 281 |
cls := self containingClass |
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
282 |
]. |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
283 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
284 |
currentChangeSet := ChangeSet current. |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
285 |
isInChangeSet := currentChangeSet includesChangeForClass:cls selector:selector. |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
286 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
287 |
isInChangeSet ifTrue:[ |
8970 | 288 |
s := s asText emphasisAllAdd:(userPreferences emphasisForChangedCode) |
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
289 |
]. |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
290 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
291 |
(cls isNil or:[(mthdPackage := self package) ~= cls package]) ifTrue:[ |
8970 | 292 |
suppressPackage := false. |
293 |
mthdPackage = PackageId noProjectID ifTrue:[ |
|
294 |
mthdPackage := '+'. |
|
295 |
"/ suppressPackage := true |
|
296 |
]. |
|
297 |
suppressPackage ifFalse:[ |
|
298 |
p := ' [' , (mthdPackage ? '?') allItalic , '] '. |
|
299 |
p := p asText emphasisAllAdd:(userPreferences emphasisForDifferentPackage). |
|
300 |
s := s , ' ' , p |
|
301 |
]. |
|
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
302 |
]. |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
303 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
304 |
moreInfo size == 0 ifTrue:[^ s]. |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
305 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
306 |
s := shownSelector , moreInfo. |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
307 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
308 |
self isInvalid ifTrue:[ |
8970 | 309 |
s := s asText emphasizeAllWith:(userPreferences emphasisForObsoleteCode). |
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
310 |
]. |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
311 |
^ s |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
312 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
313 |
"Modified: / 23-01-1998 / 13:15:15 / stefan" |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
314 |
"Created: / 05-02-2000 / 22:55:56 / cg" |
7703 | 315 |
"Modified: / 05-03-2007 / 16:18:53 / cg" |
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
316 |
! ! |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
317 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
318 |
!Method methodsFor:'printing & storing'! |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
319 |
|
8843 | 320 |
selectorPrintStringInBrowserFor:selector |
321 |
^ selector |
|
7735 | 322 |
! ! |
323 |
||
8843 | 324 |
!Method methodsFor:'printing & storing'! |
7703 | 325 |
|
8843 | 326 |
selectorPrintStringInBrowserFor:selector class:aClass |
327 |
|nsPart selPart idx ns| |
|
7703 | 328 |
|
8843 | 329 |
selector isNameSpaceSelector ifFalse:[^ selector]. |
7703 | 330 |
|
8843 | 331 |
idx := selector indexOf:$: startingAt:3. |
7703 | 332 |
nsPart := selector copyFrom:2 to:idx-1. |
333 |
ns := Smalltalk at:nsPart asSymbol. |
|
334 |
selPart := selector copyFrom:idx+2. |
|
335 |
^ selPart , ' {',nsPart,'}'. |
|
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
336 |
! ! |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
337 |
|
8843 | 338 |
!MethodDictionary methodsFor:'inspecting'! |
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
339 |
|
8843 | 340 |
inspectorClass |
341 |
"redefined to use DictionaryInspector |
|
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
342 |
(instead of the default Inspector)." |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
343 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
344 |
^ DictionaryInspectorView |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
345 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
346 |
"Created: 12.6.1996 / 12:29:13 / stefan" |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
347 |
! ! |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
348 |
|
8843 | 349 |
!NameSpace class methodsFor:'inspecting'! |
350 |
||
351 |
inspectorClass |
|
352 |
"{ Pragma: +optSpace }" |
|
353 |
||
354 |
"redefined to launch a DictionaryInspector |
|
355 |
(instead of the default Inspector)." |
|
356 |
||
357 |
^ DictionaryInspectorView |
|
358 |
||
359 |
||
360 |
! ! |
|
361 |
||
362 |
!Object methodsFor:'debugging'! |
|
363 |
||
364 |
inspectorExtraAttributes |
|
365 |
"extra (pseudo instvar) entries to be shown in an inspector. |
|
366 |
Answers a dictionary of aString -> aBlock. |
|
367 |
aString is name of extra attribute and MUST start with minus ($-). |
|
368 |
aBlock returns the object representing extra attribute." |
|
369 |
||
370 |
^Dictionary new |
|
371 |
||
372 |
" Try to uncomment following and inspect any object " |
|
373 |
||
374 |
"/ ^Dictionary new |
|
375 |
"/ add:'-test' -> ['TEST TEST']; |
|
376 |
"/ yourself |
|
377 |
||
378 |
"Created: / 16-08-2005 / 20:43:33 / janfrog" |
|
379 |
"Modified: / 02-09-2005 / 19:00:01 / janfrog" |
|
380 |
"Modified: / 04-10-2006 / 14:33:34 / cg" |
|
381 |
! ! |
|
382 |
||
383 |
!OrderedCollection methodsFor:'inspecting'! |
|
384 |
||
385 |
inspectorClass |
|
386 |
"redefined to launch an OrderedCollectionInspector |
|
387 |
(instead of the default InspectorView)." |
|
388 |
||
389 |
^ OrderedCollectionInspectorView |
|
390 |
||
391 |
" |
|
392 |
(OrderedCollection withAll:#(3 2 1)) inspect |
|
393 |
(OrderedCollection withAll:#(3 2 1)) removeFirst; yourself; inspect |
|
394 |
#(0 8 15 3 99 2) asSortedCollection inspect |
|
395 |
" |
|
396 |
! ! |
|
397 |
||
398 |
!RunArray methodsFor:'user interface'! |
|
399 |
||
400 |
inspectorClass |
|
401 |
"Re-reimplemented so that we don't get an ordered collection inspector |
|
402 |
which would get very confused when confronted with a runArray." |
|
403 |
||
404 |
^ InspectorView |
|
405 |
||
406 |
"Modified: / 30.10.1997 / 14:28:20 / cg" |
|
407 |
! ! |
|
408 |
||
409 |
!Set methodsFor:'inspecting'! |
|
410 |
||
411 |
inspectorClass |
|
412 |
"redefined to use SetInspector |
|
413 |
(instead of the default Inspector)." |
|
414 |
||
415 |
^ SetInspectorView |
|
416 |
! ! |
|
417 |
||
7754 | 418 |
!Smalltalk class methodsFor:'inspecting'! |
419 |
||
8843 | 420 |
inspectorClass |
421 |
"{ Pragma: +optSpace }" |
|
422 |
||
423 |
"redefined to launch a DictionaryInspector (instead of the default Inspector)." |
|
424 |
||
425 |
^ DictionaryInspectorView |
|
426 |
! ! |
|
427 |
||
7754 | 428 |
!Text methodsFor:'inspecting'! |
429 |
||
8843 | 430 |
inspectorExtraAttributes |
431 |
"extra (pseudo instvar) entries to be shown in an inspector." |
|
432 |
||
433 |
^ Dictionary new |
|
434 |
declareAllNewFrom:(super inspectorExtraAttributes ? #()); |
|
435 |
add:'-text' -> [ self ]; |
|
436 |
yourself |
|
437 |
||
438 |
" |
|
439 |
'hello' allBold inspect |
|
440 |
" |
|
441 |
||
442 |
"Created: / 18-09-2006 / 21:25:52 / cg" |
|
443 |
"Modified: / 06-10-2006 / 13:57:38 / cg" |
|
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
444 |
! ! |
8918 | 445 |
|
8919 | 446 |
!stx_libtool class methodsFor:'documentation'! |
447 |
||
448 |
extensionsVersion_CVS |
|
9324
86307b0d7c57
hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents:
9050
diff
changeset
|
449 |
^ '$Header: /cvs/stx/stx/libtool/extensions.st,v 1.28 2009-12-16 17:17:11 cg Exp $' |
8970 | 450 |
! ! |