author | Claus Gittinger <cg@exept.de> |
Mon, 14 Feb 2011 18:16:30 +0100 | |
changeset 9774 | 5bde45b1c359 |
parent 9691 | 312706640f5c |
child 10051 | 5b7e30460ea4 |
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 |
||
9691
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
122 |
!Date methodsFor:'inspecting'! |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
123 |
|
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
124 |
inspectorExtraAttributes |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
125 |
"extra (pseudo instvar) entries to be shown in an inspector." |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
126 |
|
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
127 |
^ Dictionary new |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
128 |
declareAllNewFrom:(super inspectorExtraAttributes ? #()); |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
129 |
add:'-dayInWeek' -> [ self dayInWeek printString , ' "', self dayOfWeekName , '"' ]; |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
130 |
add:'-dayInYear' -> [ self dayInYear ]; |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
131 |
add:'-daysInMonth' -> [ self daysInMonth ]; |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
132 |
add:'-monthName' -> [ self monthName ]; |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
133 |
add:'-leapYear' -> [ self isLeapYear ]; |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
134 |
yourself |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
135 |
|
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
136 |
" |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
137 |
Date today inspect |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
138 |
" |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
139 |
|
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
140 |
"Created: / 20-01-2011 / 12:19:05 / cg" |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
141 |
! ! |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
142 |
|
8843 | 143 |
!Dictionary methodsFor:'inspecting'! |
144 |
||
145 |
inspectorClass |
|
146 |
"redefined to use DictionaryInspector |
|
147 |
(instead of the default Inspector)." |
|
148 |
||
149 |
^ DictionaryInspectorView |
|
150 |
! ! |
|
151 |
||
152 |
!ExecutableFunction methodsFor:'printing & storing'! |
|
153 |
||
154 |
printStringForBrowserWithSelector:selector |
|
155 |
"return a printString to represent myself to the user in a browser." |
|
156 |
||
157 |
^ self printStringForBrowserWithSelector:selector inClass:nil |
|
158 |
! ! |
|
159 |
||
160 |
!Form methodsFor:'inspecting'! |
|
161 |
||
162 |
inspectorClass |
|
163 |
"redefined to launch an ImageInspector |
|
164 |
(instead of the default InspectorView)." |
|
165 |
||
166 |
^ ImageInspectorView |
|
167 |
! ! |
|
168 |
||
8839 | 169 |
!Image methodsFor:'inspecting'! |
170 |
||
8843 | 171 |
inspectorClass |
172 |
"redefined to launch an ImageInspector |
|
173 |
(instead of the default InspectorView)." |
|
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
174 |
|
8843 | 175 |
(width notNil and:[height notNil]) ifTrue:[ |
176 |
^ ImageInspectorView |
|
177 |
]. |
|
178 |
^ super inspectorClass |
|
179 |
||
180 |
"Modified: 10.6.1996 / 18:23:55 / cg" |
|
8839 | 181 |
! ! |
182 |
||
183 |
!Integer methodsFor:'inspecting'! |
|
184 |
||
8843 | 185 |
inspectorExtraAttributes |
186 |
"extra (pseudo instvar) entries to be shown in an inspector." |
|
187 |
||
188 |
^ Dictionary new |
|
189 |
declareAllNewFrom:(super inspectorExtraAttributes ? #()); |
|
190 |
add:'-hexadecimal' -> [ self radixPrintStringRadix:16 ]; |
|
191 |
add:'-octal' -> [ self radixPrintStringRadix:8 ]; |
|
192 |
add:'-binary' -> [ self radixPrintStringRadix:2 ]; |
|
193 |
yourself |
|
194 |
||
195 |
" |
|
196 |
123 inspect |
|
197 |
" |
|
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
198 |
|
8843 | 199 |
"Created: / 18-09-2006 / 21:22:46 / cg" |
200 |
"Modified: / 06-10-2006 / 13:57:28 / cg" |
|
201 |
! ! |
|
202 |
||
8839 | 203 |
!Method methodsFor:'inspecting'! |
7735 | 204 |
|
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
205 |
inspectorExtraAttributes |
8677 | 206 |
"extra (pseudo instvar) entries to be shown in an inspector." |
207 |
||
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
208 |
^ Dictionary new |
8843 | 209 |
declareAllNewFrom:(super inspectorExtraAttributes ? #()); |
210 |
add:'-code' -> [ String streamContents:[:s | self decompileTo:s] ]; |
|
211 |
add:'-source' -> [ self source ]; |
|
212 |
yourself |
|
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
213 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
214 |
" |
8843 | 215 |
(Method compiledMethodAt:#inspectorExtraAttributes) inspect |
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
216 |
" |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
217 |
|
8843 | 218 |
"Created: / 18-09-2006 / 21:34:01 / cg" |
219 |
"Modified: / 06-10-2006 / 13:57:33 / cg" |
|
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
220 |
! ! |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
221 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
222 |
!Method methodsFor:'printing & storing'! |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
223 |
|
8843 | 224 |
printStringForBrowserWithSelector:selector inClass:aClass |
225 |
"return a printString to represent myself to the user in a browser. |
|
226 |
Defined here to allow for browsers to deal with nonStandard pseudoMethods" |
|
227 |
||
228 |
|s privInfo moreInfo p info n cls currentChangeSet isInChangeSet mthdPackage |
|
229 |
userPreferences shownSelector suppressPackage timeRounded| |
|
230 |
||
231 |
moreInfo := ''. |
|
232 |
privInfo := ''. |
|
233 |
userPreferences := UserPreferences current. |
|
234 |
||
235 |
self isWrapped ifTrue:[ |
|
8970 | 236 |
(MessageTracer isCounting:self) ifTrue:[ |
237 |
(MessageTracer isCountingMemoryUsage:self) ifTrue:[ |
|
238 |
moreInfo := moreInfo , (' (mem usage avg: %1 bytes)' bindWith:(MessageTracer memoryUsageOfMethod:self) printString allBold). |
|
239 |
] ifFalse:[ |
|
240 |
moreInfo := moreInfo , (' (called %1 times)' bindWith:(MessageTracer executionCountOfMethod:self) printString allBold). |
|
241 |
] |
|
242 |
] ifFalse:[ |
|
243 |
(MessageTracer isTiming:self) ifTrue:[ |
|
244 |
info := MessageTracer executionTimesOfMethod:self. |
|
245 |
((n := info count) == 0) ifTrue:[ |
|
246 |
moreInfo := moreInfo , (' (cnt: %1)' bindWith:n) |
|
247 |
] ifFalse:[ |
|
248 |
timeRounded := [:millis | |
|
249 |
|rnd| |
|
250 |
rnd := (millis > 100) |
|
251 |
ifTrue:[ 1 ] |
|
252 |
ifFalse:[ |
|
253 |
(millis > 10) |
|
254 |
ifTrue:[ 0.1 ] |
|
255 |
ifFalse:[ |
|
256 |
(millis > 1) |
|
257 |
ifTrue:[ 0.01 ] |
|
258 |
ifFalse:[ 0.001 ]]]. |
|
259 |
millis roundTo:rnd |
|
260 |
]. |
|
8843 | 261 |
|
8970 | 262 |
(n == 1 or:[ info avgTimeRounded = info minTimeRounded ]) ifTrue:[ |
263 |
moreInfo := moreInfo , |
|
264 |
(' (t: %1ms cnt: %2)' |
|
265 |
bindWith:((timeRounded value:info avgTimeRounded) printString allBold) |
|
266 |
with:n) |
|
267 |
] ifFalse:[ |
|
268 |
moreInfo := moreInfo , |
|
269 |
(' (avg: %1ms min: %2 max: %3 cnt: %4)' |
|
270 |
bindWith:((timeRounded value:info avgTimeRounded) printString allBold) |
|
271 |
with:((timeRounded value:info minTimeRounded) printString) |
|
272 |
with:((timeRounded value:info maxTimeRounded) printString) |
|
273 |
with:n) |
|
274 |
]. |
|
275 |
]. |
|
276 |
] ifFalse:[ |
|
277 |
moreInfo := ' !!' |
|
278 |
] |
|
279 |
]. |
|
7703 | 280 |
]. |
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
281 |
p := self privacy. |
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 |
p ~~ #public ifTrue:[ |
9050
b9df3c89888d
comment/format in: #colorizeAllWith:on:
Claus Gittinger <cg@exept.de>
parents:
8970
diff
changeset
|
284 |
privInfo := (' (* ' , p , ' *)') allItalic. |
7299
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 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
287 |
"/ self isInvalid ifTrue:[ |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
288 |
"/ moreInfo := ' (** not executable **)'. |
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 |
(self isLazyMethod not and:[self isUnloaded]) ifTrue:[ |
8970 | 292 |
moreInfo := ' (** unloaded **)' |
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
293 |
]. |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
294 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
295 |
privInfo size ~~ 0 ifTrue:[ |
8970 | 296 |
moreInfo := privInfo , ' ' , moreInfo |
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
297 |
]. |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
298 |
|
7703 | 299 |
s := shownSelector := (self selectorPrintStringInBrowserFor:selector class:aClass). |
300 |
||
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
301 |
(cls := aClass) isNil ifTrue:[ |
8970 | 302 |
cls := self containingClass |
7299
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 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
305 |
currentChangeSet := ChangeSet current. |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
306 |
isInChangeSet := currentChangeSet includesChangeForClass:cls selector:selector. |
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 |
isInChangeSet ifTrue:[ |
8970 | 309 |
s := s asText emphasisAllAdd:(userPreferences emphasisForChangedCode) |
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 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
312 |
(cls isNil or:[(mthdPackage := self package) ~= cls package]) ifTrue:[ |
8970 | 313 |
suppressPackage := false. |
314 |
mthdPackage = PackageId noProjectID ifTrue:[ |
|
315 |
mthdPackage := '+'. |
|
316 |
"/ suppressPackage := true |
|
317 |
]. |
|
318 |
suppressPackage ifFalse:[ |
|
319 |
p := ' [' , (mthdPackage ? '?') allItalic , '] '. |
|
320 |
p := p asText emphasisAllAdd:(userPreferences emphasisForDifferentPackage). |
|
321 |
s := s , ' ' , p |
|
322 |
]. |
|
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
323 |
]. |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
324 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
325 |
moreInfo size == 0 ifTrue:[^ s]. |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
326 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
327 |
s := shownSelector , moreInfo. |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
328 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
329 |
self isInvalid ifTrue:[ |
8970 | 330 |
s := s asText emphasizeAllWith:(userPreferences emphasisForObsoleteCode). |
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
331 |
]. |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
332 |
^ s |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
333 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
334 |
"Modified: / 23-01-1998 / 13:15:15 / stefan" |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
335 |
"Created: / 05-02-2000 / 22:55:56 / cg" |
7703 | 336 |
"Modified: / 05-03-2007 / 16:18:53 / cg" |
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
337 |
! ! |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
338 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
339 |
!Method methodsFor:'printing & storing'! |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
340 |
|
8843 | 341 |
selectorPrintStringInBrowserFor:selector |
342 |
^ selector |
|
7735 | 343 |
! ! |
344 |
||
8843 | 345 |
!Method methodsFor:'printing & storing'! |
7703 | 346 |
|
8843 | 347 |
selectorPrintStringInBrowserFor:selector class:aClass |
348 |
|nsPart selPart idx ns| |
|
7703 | 349 |
|
8843 | 350 |
selector isNameSpaceSelector ifFalse:[^ selector]. |
7703 | 351 |
|
8843 | 352 |
idx := selector indexOf:$: startingAt:3. |
7703 | 353 |
nsPart := selector copyFrom:2 to:idx-1. |
354 |
ns := Smalltalk at:nsPart asSymbol. |
|
355 |
selPart := selector copyFrom:idx+2. |
|
356 |
^ selPart , ' {',nsPart,'}'. |
|
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
357 |
! ! |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
358 |
|
8843 | 359 |
!MethodDictionary methodsFor:'inspecting'! |
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
360 |
|
8843 | 361 |
inspectorClass |
362 |
"redefined to use DictionaryInspector |
|
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
363 |
(instead of the default Inspector)." |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
364 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
365 |
^ DictionaryInspectorView |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
366 |
|
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
367 |
"Created: 12.6.1996 / 12:29:13 / stefan" |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
368 |
! ! |
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
369 |
|
8843 | 370 |
!NameSpace class methodsFor:'inspecting'! |
371 |
||
372 |
inspectorClass |
|
373 |
"{ Pragma: +optSpace }" |
|
374 |
||
375 |
"redefined to launch a DictionaryInspector |
|
376 |
(instead of the default Inspector)." |
|
377 |
||
378 |
^ DictionaryInspectorView |
|
379 |
||
380 |
||
381 |
! ! |
|
382 |
||
383 |
!Object methodsFor:'debugging'! |
|
384 |
||
385 |
inspectorExtraAttributes |
|
386 |
"extra (pseudo instvar) entries to be shown in an inspector. |
|
387 |
Answers a dictionary of aString -> aBlock. |
|
388 |
aString is name of extra attribute and MUST start with minus ($-). |
|
389 |
aBlock returns the object representing extra attribute." |
|
390 |
||
391 |
^Dictionary new |
|
392 |
||
393 |
" Try to uncomment following and inspect any object " |
|
394 |
||
395 |
"/ ^Dictionary new |
|
396 |
"/ add:'-test' -> ['TEST TEST']; |
|
397 |
"/ yourself |
|
398 |
||
399 |
"Created: / 16-08-2005 / 20:43:33 / janfrog" |
|
400 |
"Modified: / 02-09-2005 / 19:00:01 / janfrog" |
|
401 |
"Modified: / 04-10-2006 / 14:33:34 / cg" |
|
402 |
! ! |
|
403 |
||
404 |
!OrderedCollection methodsFor:'inspecting'! |
|
405 |
||
406 |
inspectorClass |
|
407 |
"redefined to launch an OrderedCollectionInspector |
|
408 |
(instead of the default InspectorView)." |
|
409 |
||
410 |
^ OrderedCollectionInspectorView |
|
411 |
||
412 |
" |
|
413 |
(OrderedCollection withAll:#(3 2 1)) inspect |
|
414 |
(OrderedCollection withAll:#(3 2 1)) removeFirst; yourself; inspect |
|
415 |
#(0 8 15 3 99 2) asSortedCollection inspect |
|
416 |
" |
|
417 |
! ! |
|
418 |
||
9673 | 419 |
!RunArray methodsFor:'inspecting'! |
8843 | 420 |
|
421 |
inspectorClass |
|
422 |
"Re-reimplemented so that we don't get an ordered collection inspector |
|
423 |
which would get very confused when confronted with a runArray." |
|
424 |
||
425 |
^ InspectorView |
|
426 |
||
427 |
"Modified: / 30.10.1997 / 14:28:20 / cg" |
|
428 |
! ! |
|
429 |
||
430 |
!Set methodsFor:'inspecting'! |
|
431 |
||
432 |
inspectorClass |
|
433 |
"redefined to use SetInspector |
|
434 |
(instead of the default Inspector)." |
|
435 |
||
436 |
^ SetInspectorView |
|
437 |
! ! |
|
438 |
||
9673 | 439 |
!SharedPool class methodsFor:'inspecting'! |
440 |
||
441 |
inspectorClass |
|
442 |
"{ Pragma: +optSpace }" |
|
443 |
||
444 |
"redefined to launch a DictionaryInspector (instead of the default Inspector)." |
|
445 |
||
446 |
^ DictionaryInspectorView |
|
447 |
! ! |
|
448 |
||
7754 | 449 |
!Smalltalk class methodsFor:'inspecting'! |
450 |
||
8843 | 451 |
inspectorClass |
452 |
"{ Pragma: +optSpace }" |
|
453 |
||
454 |
"redefined to launch a DictionaryInspector (instead of the default Inspector)." |
|
455 |
||
456 |
^ DictionaryInspectorView |
|
457 |
! ! |
|
458 |
||
7754 | 459 |
!Text methodsFor:'inspecting'! |
460 |
||
8843 | 461 |
inspectorExtraAttributes |
462 |
"extra (pseudo instvar) entries to be shown in an inspector." |
|
463 |
||
464 |
^ Dictionary new |
|
465 |
declareAllNewFrom:(super inspectorExtraAttributes ? #()); |
|
466 |
add:'-text' -> [ self ]; |
|
467 |
yourself |
|
468 |
||
469 |
" |
|
470 |
'hello' allBold inspect |
|
471 |
" |
|
472 |
||
473 |
"Created: / 18-09-2006 / 21:25:52 / cg" |
|
474 |
"Modified: / 06-10-2006 / 13:57:38 / cg" |
|
7299
efa954fda5c1
inspector code now as extension
Claus Gittinger <cg@exept.de>
parents:
7298
diff
changeset
|
475 |
! ! |
8918 | 476 |
|
9691
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
477 |
!Timestamp methodsFor:'inspecting'! |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
478 |
|
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
479 |
inspectorExtraAttributes |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
480 |
"extra (pseudo instvar) entries to be shown in an inspector." |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
481 |
|
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
482 |
^ Dictionary new |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
483 |
declareAllNewFrom:(super inspectorExtraAttributes ? #()); |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
484 |
add:'-dayInWeek' -> [ self dayInWeek printString , ' "', self asDate dayOfWeekName , '"' ]; |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
485 |
add:'-dayInYear' -> [ self dayInYear ]; |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
486 |
add:'-daysInMonth' -> [ self asDate daysInMonth ]; |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
487 |
add:'-monthName' -> [ self asDate monthName ]; |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
488 |
add:'-leapYear' -> [ self asDate isLeapYear ]; |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
489 |
yourself |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
490 |
|
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
491 |
" |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
492 |
Timestamp now inspect |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
493 |
" |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
494 |
|
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
495 |
"Created: / 20-01-2011 / 12:19:05 / cg" |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
496 |
! ! |
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
497 |
|
8919 | 498 |
!stx_libtool class methodsFor:'documentation'! |
499 |
||
500 |
extensionsVersion_CVS |
|
9691
312706640f5c
better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents:
9673
diff
changeset
|
501 |
^ '$Header: /cvs/stx/stx/libtool/extensions.st,v 1.30 2011-01-20 11:24:55 cg Exp $' |
8970 | 502 |
! ! |