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