author | Claus Gittinger <cg@exept.de> |
Sun, 02 Nov 1997 19:29:16 +0100 | |
changeset 1367 | 80e92dd370c8 |
parent 1356 | 0080df099c35 |
child 1561 | 102b90f99e58 |
permissions | -rw-r--r-- |
36 | 1 |
" |
2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
45 | 3 |
All Rights Reserved |
36 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
85 | 13 |
ApplicationModel subclass:#SystemBrowser |
279
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
14 |
instanceVariableNames:'currentClass currentMethodCategory currentMethod currentSelector |
270 | 15 |
showInstance actualClasslastMethodCategory aspect lockUpdates |
16 |
autoSearch myLabel acceptClass' |
|
279
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
17 |
classVariableNames:'CheckForInstancesWhenRemovingClasses' |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
18 |
poolDictionaries:'' |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
19 |
category:'Interface-Browsers' |
36 | 20 |
! |
21 |
||
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
22 |
!SystemBrowser class methodsFor:'documentation'! |
203 | 23 |
|
24 |
copyright |
|
25 |
" |
|
26 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
27 |
All Rights Reserved |
|
28 |
||
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
37 |
||
38 |
documentation |
|
39 |
" |
|
40 |
this class implements all kinds of class browsers. |
|
41 |
Typically, it is started with 'SystemBrowser open', but there are many other |
|
42 |
startup messages, to launch special browsers. |
|
43 |
See the categories 'startup' and 'special search startup' in the classes |
|
44 |
protocol. |
|
45 |
||
46 |
Alse, see the extra document 'doc/misc/sbrowser.doc' or the HTML online doc |
|
47 |
for how to use the browser. |
|
48 |
||
49 |
written winter 89 by claus. |
|
50 |
||
51 |
Notice: SystemBrowser is currently being rewritten to be an instance |
|
52 |
of ApplicationModel - this transition is not yet complete and you see |
|
53 |
here an intermediate version. The instance variables defined here are NOT |
|
54 |
currently used - instead, everything is really done in the BrowserView |
|
55 |
which (currently) keeps the real state of the browser. |
|
56 |
This will certainly change ... |
|
508 | 57 |
|
58 |
[author:] |
|
59 |
Claus Gittinger |
|
60 |
||
203 | 61 |
" |
62 |
! ! |
|
63 |
||
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
64 |
!SystemBrowser class methodsFor:'initialization'! |
75 | 65 |
|
66 |
initialize |
|
67 |
"Browser configuration; |
|
68 |
(values can be changed from your private startup file)" |
|
45 | 69 |
|
254 | 70 |
"/ self classResources. |
85 | 71 |
|
75 | 72 |
" |
73 |
setting this to false, the removeClass function will remove |
|
74 |
classes WITHOUT checking for instances. Otherwise, |
|
75 |
it will check and let you confirm in case there are instances. |
|
76 |
Checking for instances may be a bit time consuming, though. |
|
77 |
The default is true - therefore, it will check |
|
78 |
" |
|
79 |
CheckForInstancesWhenRemovingClasses := true |
|
80 |
||
81 |
" |
|
82 |
CheckForInstancesWhenRemovingClasses := true |
|
83 |
CheckForInstancesWhenRemovingClasses := false |
|
84 |
||
85 | 85 |
SystemBrowser initialize |
75 | 86 |
" |
87 |
! ! |
|
36 | 88 |
|
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
89 |
!SystemBrowser class methodsFor:'instance creation'! |
52 | 90 |
|
75 | 91 |
open |
92 |
"launch a standard browser" |
|
93 |
||
105 | 94 |
^ self openOnDevice:(Screen current) |
75 | 95 |
|
93 | 96 |
" |
97 |
SystemBrowser open |
|
98 |
" |
|
194 | 99 |
! |
100 |
||
523 | 101 |
openInClass:aClass |
102 |
"launch a standard browser which immediately switches |
|
103 |
to aClass" |
|
104 |
||
105 |
^ self openInClass:aClass selector:nil |
|
106 |
||
107 |
" |
|
108 |
SystemBrowser openInClass:Object |
|
109 |
" |
|
110 |
||
111 |
"Created: 30.4.1996 / 14:43:45 / cg" |
|
112 |
! |
|
113 |
||
194 | 114 |
openInClass:aClass selector:aSelector |
115 |
"launch a standard browser which immediately switches |
|
116 |
to aClass>>aSelector." |
|
117 |
||
118 |
|brwsr cls| |
|
119 |
||
120 |
brwsr := self openOnDevice:(Screen current). |
|
121 |
brwsr waitUntilVisible. |
|
122 |
cls := aClass. |
|
123 |
cls notNil ifTrue:[ |
|
124 |
cls isMeta ifTrue:[ |
|
125 |
cls := aClass soleInstance |
|
126 |
]. |
|
127 |
brwsr switchToClassNamed:cls name. |
|
128 |
brwsr updateClassCategoryList. |
|
129 |
aClass isMeta ifTrue:[ |
|
130 |
brwsr instanceProtocol:false |
|
131 |
]. |
|
132 |
brwsr updateMethodCategoryList. |
|
133 |
aSelector notNil ifTrue:[ |
|
134 |
brwsr switchToMethodNamed:aSelector. |
|
135 |
] |
|
136 |
]. |
|
137 |
^ brwsr |
|
138 |
||
139 |
" |
|
140 |
SystemBrowser openInClass:Object selector:#at:put: |
|
141 |
SystemBrowser openInClass:Object selector:nil |
|
142 |
SystemBrowser openInClass:nil selector:nil |
|
143 |
" |
|
144 |
||
145 |
"Created: 22.11.1995 / 21:04:50 / cg" |
|
203 | 146 |
! |
147 |
||
148 |
openOnDevice:aDisplay |
|
149 |
"launch a standard browser on another display." |
|
150 |
||
151 |
^ self newWithLabel:(self classResources string:'System Browser') |
|
152 |
setupBlock:[:browser | browser setupForAll] |
|
153 |
onDevice:aDisplay |
|
154 |
||
155 |
"|d| |
|
156 |
||
157 |
d := XWorkstation new initializeFor:'porty:0'. |
|
158 |
d startDispatch. |
|
159 |
SystemBrowser openOnDevice:d |
|
160 |
" |
|
36 | 161 |
! ! |
162 |
||
1356 | 163 |
!SystemBrowser class methodsFor:'ST-80 compatibility'! |
164 |
||
165 |
newOnClass:aClass |
|
166 |
^ self browseClass:aClass |
|
167 |
||
168 |
"Created: / 27.10.1997 / 20:10:39 / cg" |
|
169 |
! ! |
|
170 |
||
1203 | 171 |
!SystemBrowser class methodsFor:'interface specs'! |
172 |
||
1367 | 173 |
metaSpec |
174 |
"UIPainter new openOnClass: self andSelector: #metaSpec" |
|
175 |
||
176 |
<resource: #canvas> |
|
177 |
^#(#FullSpec |
|
178 |
#window: |
|
179 |
#(#WindowSpec |
|
180 |
#label: 'Unlabeled Canvas' |
|
181 |
#bounds: #(#Rectangle 27 249 325 334 ) ) |
|
182 |
#component: |
|
183 |
#(#SpecCollection |
|
184 |
#collection: #( |
|
185 |
#(#RadioButtonSpec |
|
186 |
#layout: #(#LayoutFrame 0 0 4 0 -1 0.575 20 0 ) |
|
187 |
#name: #instanceSwitch |
|
188 |
#model: #metaHolder |
|
189 |
#callbacksSpec: |
|
190 |
#(#UIEventCallbackSubSpec |
|
191 |
#requestValueChangeSelector: #changeRequest ) |
|
192 |
#label: 'instance' |
|
193 |
#select: false ) |
|
194 |
#(#RadioButtonSpec |
|
195 |
#layout: #(#LayoutFrame 1 0.575 4 0 -1 1 20 0 ) |
|
196 |
#name: #classSwitch |
|
197 |
#model: #metaHolder |
|
198 |
#callbacksSpec: |
|
199 |
#(#UIEventCallbackSubSpec |
|
200 |
#requestValueChangeSelector: #changeRequest ) |
|
201 |
#label: 'class' |
|
202 |
#select: true ) ) ) ) |
|
203 |
||
204 |
"Created: / 30.10.1997 / 19:07:29 / cg" |
|
205 |
! |
|
206 |
||
1203 | 207 |
methodMoveDialogSpec |
208 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
209 |
||
210 |
"do not manually edit this - the painter/builder may not be able to |
|
211 |
handle the specification if its corrupted." |
|
212 |
||
213 |
" |
|
214 |
UIPainter new openOnClass:SystemBrowser andSelector:#methodMoveDialogSpec |
|
215 |
SystemBrowser new openDialogInterface:#methodMoveDialogSpec |
|
216 |
" |
|
217 |
||
218 |
<resource: #canvas> |
|
219 |
||
220 |
^ |
|
221 |
||
222 |
#(#FullSpec |
|
223 |
#'window:' |
|
224 |
#(#WindowSpec |
|
225 |
#'name:' 'uIPainterView' |
|
226 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
227 |
#'label:' 'move method' |
|
228 |
#'bounds:' #(#Rectangle 0 0 279 118) |
|
229 |
) |
|
230 |
#'component:' |
|
231 |
#(#SpecCollection |
|
232 |
#'collection:' |
|
233 |
#( |
|
234 |
#(#HorizontalPanelViewSpec |
|
235 |
#'name:' 'horizontalPanelView' |
|
236 |
#'layout:' #(#LayoutFrame 0 0.0 -35 1.0 0 1.0 -2 1.0) |
|
237 |
#'component:' |
|
238 |
#(#SpecCollection |
|
239 |
#'collection:' |
|
240 |
#( |
|
241 |
#(#ActionButtonSpec |
|
242 |
#'name:' 'actionButton2' |
|
243 |
#'label:' 'cancel' |
|
244 |
#'tabable:' true |
|
245 |
#'model:' #cancel |
|
246 |
#'extent:' #(#Point 133 27) |
|
247 |
) |
|
248 |
#(#ActionButtonSpec |
|
249 |
#'name:' 'actionButton1' |
|
250 |
#'label:' 'move' |
|
251 |
#'tabable:' true |
|
252 |
#'isDefault:' true |
|
253 |
#'model:' #accept |
|
254 |
#'extent:' #(#Point 134 27) |
|
255 |
) |
|
256 |
) |
|
257 |
) |
|
258 |
#'level:' 0 |
|
259 |
#'horizontalLayout:' #fitSpace |
|
260 |
#'verticalLayout:' #center |
|
261 |
#'horizontalSpace:' 4 |
|
262 |
#'verticalSpace:' 4 |
|
263 |
) |
|
264 |
#(#LabelSpec |
|
265 |
#'name:' 'label' |
|
266 |
#'layout:' #(#LayoutFrame 2 0 2 0 -2 1.0 25 0) |
|
267 |
#'label:' 'move current method to which class:' |
|
268 |
#'style:' |
|
269 |
#(#Font |
|
270 |
'helvetica' 'medium' |
|
271 |
'roman' 12 |
|
272 |
) |
|
273 |
#'foregroundColor:' #(#Color 0.0 0.0 0.0) |
|
274 |
#'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) |
|
275 |
#'adjust:' #left |
|
276 |
) |
|
277 |
#(#ComboBoxSpec |
|
278 |
#'name:' 'comboBox1' |
|
279 |
#'layout:' #(#LayoutFrame 2 0 29 0 -2 1.0 51 0) |
|
280 |
#'tabable:' true |
|
281 |
#'model:' #className |
|
282 |
#'comboList:' #classList |
|
283 |
) |
|
284 |
) |
|
285 |
) |
|
286 |
) |
|
287 |
||
288 |
"Created: 25.6.1997 / 13:45:20 / cg" |
|
289 |
"Modified: 25.6.1997 / 13:46:44 / cg" |
|
290 |
! ! |
|
291 |
||
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
292 |
!SystemBrowser class methodsFor:'private helpers'! |
36 | 293 |
|
203 | 294 |
showNoneFound |
215
244f3a9b2a60
check for existing class in rename; avoid warnbox if no refs are found after rename
Claus Gittinger <cg@exept.de>
parents:
204
diff
changeset
|
295 |
super warn:(self classResources string:'None found'). |
203 | 296 |
! |
36 | 297 |
|
203 | 298 |
showNoneFound:what |
215
244f3a9b2a60
check for existing class in rename; avoid warnbox if no refs are found after rename
Claus Gittinger <cg@exept.de>
parents:
204
diff
changeset
|
299 |
super warn:(self classResources string:(what , '...\\... none found') withCRs). |
203 | 300 |
! ! |
36 | 301 |
|
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
302 |
!SystemBrowser class methodsFor:'private instance creation'! |
203 | 303 |
|
304 |
newWithLabel:aString setupBlock:aBlock |
|
305 |
"common helper method for all creation methods" |
|
306 |
||
307 |
^ self newWithLabel:aString setupBlock:aBlock onDevice:Screen current |
|
36 | 308 |
! |
309 |
||
203 | 310 |
newWithLabel:aString setupBlock:aBlock onDevice:aWorkstation |
311 |
"common helper method for all creation methods" |
|
36 | 312 |
|
203 | 313 |
|newBrowser| |
45 | 314 |
|
203 | 315 |
newBrowser := BrowserView onDevice:aWorkstation. |
316 |
newBrowser title:aString. |
|
317 |
aBlock value:newBrowser. |
|
45 | 318 |
|
203 | 319 |
newBrowser open. |
320 |
^ newBrowser |
|
321 |
! |
|
45 | 322 |
|
203 | 323 |
newWithLabel:aString setupSelector:aSymbol arg:arg |
324 |
"common helper method for all creation methods" |
|
36 | 325 |
|
203 | 326 |
^ self newWithLabel:aString setupSelector:aSymbol arg:arg onDevice:Screen current |
36 | 327 |
! |
328 |
||
203 | 329 |
newWithLabel:aString setupSelector:aSymbol arg:arg onDevice:aWorkstation |
330 |
"common helper method for all creation methods" |
|
331 |
||
332 |
|newBrowser| |
|
52 | 333 |
|
203 | 334 |
newBrowser := BrowserView onDevice:aWorkstation. |
335 |
newBrowser title:aString. |
|
336 |
newBrowser perform:aSymbol with:arg. |
|
337 |
newBrowser open. |
|
338 |
^ newBrowser |
|
339 |
! ! |
|
340 |
||
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
341 |
!SystemBrowser class methodsFor:'special search startup'! |
203 | 342 |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
343 |
allCallsOn:aSelectorString |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
344 |
"return a collection of methods which send aSelector." |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
345 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
346 |
^ self allCallsOn:#at:put: in:(Smalltalk allClasses) |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
347 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
348 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
349 |
SystemBrowser allCallsOn:#at:put: |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
350 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
351 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
352 |
"Created: 24.1.1997 / 19:42:57 / cg" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
353 |
! |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
354 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
355 |
allCallsOn:aSelectorString in:aCollectionOfClasses |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
356 |
"return a collection of methods which send aSelector. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
357 |
Methods from classes in aCollectionOfClasses are searched only." |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
358 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
359 |
|sel searchBlock| |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
360 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
361 |
((aSelectorString ~= '*') |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
362 |
and:[aSelectorString includesMatchCharacters]) ifTrue:[ |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
363 |
"/ a matchString - need string matching procedure |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
364 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
365 |
searchBlock := [:class :method :s | |
1059
918deae4d1c7
care for lazy methods when searching senders
Claus Gittinger <cg@exept.de>
parents:
1036
diff
changeset
|
366 |
method isLazyMethod ifTrue:[ |
1143
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
367 |
(method source includesMatchString:aSelectorString) ifTrue:[ |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
368 |
method makeRealMethod. |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
369 |
(method literalsDetect:[:aLiteral| |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
370 |
(aLiteral isMemberOf:Symbol) |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
371 |
and:[aSelectorString match:aLiteral] |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
372 |
] ifNone:nil) notNil |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
373 |
] ifFalse:[ |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
374 |
false |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
375 |
] |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
376 |
] ifFalse:[ |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
377 |
(method literalsDetect:[:aLiteral| |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
378 |
(aLiteral isMemberOf:Symbol) |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
379 |
and:[aSelectorString match:aLiteral] |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
380 |
] ifNone:nil) notNil |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
381 |
] |
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
382 |
]. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
383 |
] ifFalse:[ |
1018 | 384 |
(aSelectorString = '*') ifTrue:[ |
385 |
searchBlock := [:class :method :s | true]. |
|
386 |
] ifFalse:[ |
|
387 |
"/ no matchString - can do it much faster |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
388 |
|
1018 | 389 |
sel := aSelectorString asSymbolIfInterned. |
390 |
sel isNil ifTrue:[ |
|
391 |
^ nil "/ none |
|
392 |
]. |
|
1059
918deae4d1c7
care for lazy methods when searching senders
Claus Gittinger <cg@exept.de>
parents:
1036
diff
changeset
|
393 |
searchBlock := [:class :method :s | |
918deae4d1c7
care for lazy methods when searching senders
Claus Gittinger <cg@exept.de>
parents:
1036
diff
changeset
|
394 |
method isLazyMethod ifTrue:[ |
1143
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
395 |
(method source includesString:sel) ifTrue:[ |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
396 |
method makeRealMethod. |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
397 |
method sends:sel. |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
398 |
] ifFalse:[ |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
399 |
false |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
400 |
] |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
401 |
] ifFalse:[ |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
402 |
method sends:sel |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
403 |
] |
1059
918deae4d1c7
care for lazy methods when searching senders
Claus Gittinger <cg@exept.de>
parents:
1036
diff
changeset
|
404 |
]. |
1018 | 405 |
] |
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
406 |
]. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
407 |
^ self allMethodsIn:aCollectionOfClasses where:searchBlock |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
408 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
409 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
410 |
SystemBrowser allCallsOn:#at:put: in:(Smalltalk allClasses) |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
411 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
412 |
|
1143
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
413 |
"Modified: 18.4.1997 / 10:32:50 / cg" |
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
414 |
! |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
415 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
416 |
allMethodsIn:aCollectionOfClasses inst:wantInst class:wantClass where:aBlock |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
417 |
"return a collection of methods which pass the given test. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
418 |
wantInst/wantClass control if instMethods and/or classMethods are to be |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
419 |
considered. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
420 |
Only classes in aCollectionOfClasses are inspected in the search" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
421 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
422 |
|list| |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
423 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
424 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
425 |
since this may take a long time, lower my priority ... |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
426 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
427 |
Processor activeProcess withLowerPriorityDo:[ |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
428 |
|checkedClasses checkBlock| |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
429 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
430 |
checkedClasses := IdentitySet new. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
431 |
list := OrderedCollection new. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
432 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
433 |
checkBlock := [:cls | |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
434 |
(checkedClasses includes:cls) ifFalse:[ |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
435 |
cls isObsolete ifTrue:[ |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
436 |
Transcript showCR:'skipping obsolete class: ' , cls displayString |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
437 |
] ifFalse:[ |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
438 |
cls methodDictionary keysAndValuesDo:[:sel :method | |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
439 |
(aBlock value:cls value:method value:sel) ifTrue:[ |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
440 |
list add:method "/ (cls name , ' ' , sel) |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
441 |
] |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
442 |
]. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
443 |
checkedClasses add:cls. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
444 |
] |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
445 |
] |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
446 |
]. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
447 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
448 |
aCollectionOfClasses do:[:aClass | |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
449 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
450 |
output disabled - it slows down things too much (when searching for |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
451 |
implementors or senders) |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
452 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
453 |
wantInst ifTrue:[ |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
454 |
"/ Transcript show:'searching '; show:aClass name; showCR:' ...'; endEntry. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
455 |
checkBlock value:aClass |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
456 |
]. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
457 |
wantClass ifTrue:[ |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
458 |
"/ Transcript show:'searching '; show:aClass class name; showCR:' ...'; endEntry. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
459 |
checkBlock value:(aClass class) |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
460 |
]. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
461 |
Processor yield |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
462 |
] |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
463 |
]. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
464 |
^ list |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
465 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
466 |
"Created: 24.1.1997 / 19:41:12 / cg" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
467 |
! |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
468 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
469 |
allMethodsIn:aCollectionOfClasses where:aBlock |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
470 |
"return a collection of methods which pass the given test. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
471 |
Only classes in aCollectionOfClasses are inspected in the search" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
472 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
473 |
^ self |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
474 |
allMethodsIn:aCollectionOfClasses |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
475 |
inst:true |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
476 |
class:true |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
477 |
where:aBlock |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
478 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
479 |
"Created: 24.1.1997 / 19:41:49 / cg" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
480 |
! |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
481 |
|
203 | 482 |
aproposSearch:aString |
483 |
"browse all methods, which have aString in their selector or |
|
484 |
in the methods comment. |
|
485 |
This is relatively slow, since all source must be processed." |
|
486 |
||
487 |
^ self aproposSearch:aString in:(Smalltalk allClasses) |
|
75 | 488 |
|
52 | 489 |
! |
490 |
||
203 | 491 |
aproposSearch:aString in:aCollectionOfClasses |
492 |
"browse all methods, which have aString in their selector or |
|
493 |
in the methods comment. |
|
494 |
This is relatively slow, since all source must be processed." |
|
52 | 495 |
|
203 | 496 |
|matchString list s searchBlock browser| |
52 | 497 |
|
203 | 498 |
matchString := '*' , aString , '*'. |
52 | 499 |
|
203 | 500 |
list := OrderedCollection new. |
52 | 501 |
|
203 | 502 |
(aString includesMatchCharacters) ifTrue:[ |
256 | 503 |
s := '*' , aString , '*'. |
504 |
"a matchString" |
|
505 |
searchBlock := [:text | (text asCollectionOfLinesfindFirst:[:line | s match:line]) ~~ 0]. |
|
203 | 506 |
] ifFalse:[ |
256 | 507 |
searchBlock := [:source | (source findString:aString) ~~ 0] |
203 | 508 |
]. |
52 | 509 |
|
203 | 510 |
browser := self browseMethodsIn:aCollectionOfClasses |
256 | 511 |
where:[:class :method :sel | |
512 |
|comment| |
|
52 | 513 |
|
256 | 514 |
Processor yield. |
515 |
(searchBlock value:sel) ifTrue:[ |
|
516 |
true |
|
517 |
] ifFalse:[ |
|
518 |
comment := method comment. |
|
519 |
comment notNil |
|
520 |
and:[searchBlock value:method comment] |
|
521 |
]. |
|
522 |
] |
|
523 |
title:(ClassResources string:'apropos: %1' with:aString). |
|
52 | 524 |
|
203 | 525 |
browser notNil ifTrue:[ |
256 | 526 |
browser autoSearch:aString |
203 | 527 |
]. |
528 |
^ browser |
|
52 | 529 |
|
530 |
" |
|
203 | 531 |
SystemBrowser aproposSearch:'append' in:(Collection withAllSubclasses) |
532 |
SystemBrowser aproposSearch:'add' in:(Collection withAllSubclasses) |
|
533 |
SystemBrowser aproposSearch:'sort' in:(Collection withAllSubclasses) |
|
534 |
SystemBrowser aproposSearch:'[Aa]bsent' in:(Collection withAllSubclasses) |
|
52 | 535 |
" |
203 | 536 |
|
256 | 537 |
"Created: 9.12.1995 / 18:02:36 / cg" |
204
6f4460d5a09d
added supersend searches; offer comparing the current version with the
Claus Gittinger <cg@exept.de>
parents:
203
diff
changeset
|
538 |
! |
6f4460d5a09d
added supersend searches; offer comparing the current version with the
Claus Gittinger <cg@exept.de>
parents:
203
diff
changeset
|
539 |
|
203 | 540 |
browseAllCallsOn:aSelectorString |
541 |
"launch a browser for all senders of aSelector" |
|
52 | 542 |
|
666 | 543 |
^ self browseAllCallsOn:aSelectorString in:(Smalltalk allClasses) |
52 | 544 |
|
545 |
" |
|
203 | 546 |
SystemBrowser browseAllCallsOn:#+ |
52 | 547 |
" |
256 | 548 |
|
549 |
"Created: 9.12.1995 / 18:00:41 / cg" |
|
666 | 550 |
"Modified: 10.7.1996 / 10:26:15 / cg" |
551 |
! |
|
552 |
||
553 |
browseAllCallsOn:aSelectorString in:aSetOfClasses |
|
554 |
"launch a browser for all senders of aSelector" |
|
555 |
||
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
556 |
^ self |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
557 |
browseAllCallsOn:aSelectorString |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
558 |
in:aSetOfClasses |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
559 |
title:(self classResources string:'senders of: %1' with:aSelectorString) |
666 | 560 |
|
561 |
" |
|
562 |
SystemBrowser browseAllCallsOn:#+ in:(Number withAllSubclasses) |
|
563 |
" |
|
564 |
||
565 |
"Created: 10.7.1996 / 10:25:49 / cg" |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
566 |
"Modified: 24.1.1997 / 19:49:34 / cg" |
52 | 567 |
! |
568 |
||
569 |
browseAllCallsOn:aSelectorString in:aCollectionOfClasses title:title |
|
570 |
"launch a browser for all senders of aSelector in aCollectionOfClasses" |
|
571 |
||
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
572 |
|browser| |
52 | 573 |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
574 |
browser := self |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
575 |
browseMethods:(self allCallsOn:aSelectorString in:aCollectionOfClasses) |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
576 |
title:title. |
52 | 577 |
|
578 |
browser notNil ifTrue:[ |
|
648
6ec086b7972c
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
634
diff
changeset
|
579 |
|s| |
52 | 580 |
|
648
6ec086b7972c
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
634
diff
changeset
|
581 |
" |
6ec086b7972c
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
634
diff
changeset
|
582 |
kludge for now, if its a multipart selector, |
6ec086b7972c
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
634
diff
changeset
|
583 |
no easy search is (as yet) possible |
6ec086b7972c
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
634
diff
changeset
|
584 |
" |
6ec086b7972c
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
634
diff
changeset
|
585 |
s := aSelectorString. |
6ec086b7972c
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
634
diff
changeset
|
586 |
(s includes:$:) ifTrue:[ |
6ec086b7972c
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
634
diff
changeset
|
587 |
s := s copyTo:(s indexOf:$:) |
6ec086b7972c
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
634
diff
changeset
|
588 |
]. |
6ec086b7972c
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
634
diff
changeset
|
589 |
browser autoSearch:s |
52 | 590 |
]. |
591 |
^ browser |
|
648
6ec086b7972c
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
634
diff
changeset
|
592 |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
593 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
594 |
SystemBrowser |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
595 |
browseAllCallsOn:#+ |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
596 |
in:(Number withAllSubclasses) |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
597 |
title:'just a test' |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
598 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
599 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
600 |
"Modified: 24.1.1997 / 19:48:54 / cg" |
52 | 601 |
! |
602 |
||
203 | 603 |
browseCallsOn:aSelectorString under:aClass |
604 |
"launch a browser for all senders of aSelector in aClass and subclasses" |
|
605 |
||
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
606 |
^ self |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
607 |
browseAllCallsOn:aSelectorString |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
608 |
in:(aClass withAllSubclasses) |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
609 |
title:(self classResources |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
610 |
string:'senders of: %1 (in and below %2)' |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
611 |
with:aSelectorString |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
612 |
with:aClass name) |
203 | 613 |
|
614 |
" |
|
256 | 615 |
SystemBrowser browseCallsOn:#+ under:Number |
203 | 616 |
" |
256 | 617 |
|
618 |
"Created: 9.12.1995 / 17:59:57 / cg" |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
619 |
"Modified: 24.1.1997 / 19:50:33 / cg" |
203 | 620 |
! |
621 |
||
622 |
browseClassRefsTo:aString in:aCollectionOfClasses modificationsOnly:modsOnly |
|
623 |
"launch a browser for all methods in aClass where the classVar named |
|
624 |
aString is referenced; if modsOnly is true, browse only methods where the |
|
625 |
classvar is modified" |
|
626 |
||
627 |
^ self browseRefsTo:aString classVars:true in:aCollectionOfClasses modificationsOnly:modsOnly |
|
628 |
! |
|
629 |
||
630 |
browseClassRefsTo:varName in:aCollectionOfClasses modificationsOnly:modsOnly title:title |
|
631 |
"launch a browser for all methods in aCollectionOfClasses, |
|
632 |
where the classVar named aString is referenced; |
|
633 |
if modsOnly is true, browse only methods where the classvar is modified" |
|
634 |
||
635 |
^ self browseRefsTo:varName classVars:true in:aCollectionOfClasses modificationsOnly:modsOnly title:title |
|
636 |
! |
|
637 |
||
638 |
browseClassRefsTo:aString under:aClass modificationsOnly:modsOnly |
|
639 |
"launch a browser for all methods in aClass and subclasses |
|
640 |
where the classVar named aString is referenced; |
|
641 |
if modsOnly is true, browse only methods where the classvar is modified" |
|
642 |
||
643 |
^ self browseClassRefsTo:aString in:(aClass withAllSubclasses) modificationsOnly:modsOnly |
|
644 |
||
645 |
! |
|
646 |
||
929
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
647 |
browseForResource:aResourceSymbol containing:item in:aCollectionOfClasses title:title |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
648 |
"launch a browser for all methods which have a particular (or any, ifNil) |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
649 |
resource in aCollectionOfClasses. |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
650 |
If aKey is nonNil, only methods which have aKey in the (any) resourceSpec |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
651 |
are parsed. |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
652 |
I.e. to find all methods, which access the styleSheets, use: |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
653 |
browseForResource:#style containing:nil in:... title:... |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
654 |
to find methods which access the 'arrowButtonDownForm' styleSheet entry, use: |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
655 |
browseForResource:#style containing:'arrowButtonDownForm' in:... title:..." |
573
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
656 |
|
742
2ef5e22d8983
code cleanup (unused vars eliminated)
Claus Gittinger <cg@exept.de>
parents:
675
diff
changeset
|
657 |
|browser searchBlock| |
573
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
658 |
|
1356 | 659 |
"/ search for any resource can be done without looking |
660 |
"/ at the source ... |
|
661 |
(aResourceSymbol isNil and:[item isNil]) ifTrue:[ |
|
662 |
searchBlock := [:class :method :s | method hasResource] |
|
663 |
] ifFalse:[ |
|
664 |
searchBlock := [:class :method :s | |
|
665 |
|src parser rsrc val found| |
|
929
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
666 |
|
1356 | 667 |
found := false. |
668 |
method hasResource ifTrue:[ |
|
669 |
src := method source. |
|
670 |
src isNil ifTrue:[ |
|
671 |
found := true "/ actually: dont know |
|
672 |
] ifFalse:[ |
|
673 |
(src findString:'resource:') ~~ 0 ifTrue:[ |
|
674 |
parser := Parser |
|
675 |
parseMethod:src |
|
676 |
in:class |
|
677 |
ignoreErrors:true |
|
678 |
ignoreWarnings:true. |
|
679 |
||
680 |
rsrc := parser primitiveResources. |
|
681 |
rsrc notNil ifTrue:[ |
|
682 |
aResourceSymbol isNil ifTrue:[ |
|
929
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
683 |
item isNil ifTrue:[ |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
684 |
found := true |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
685 |
] ifFalse:[ |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
686 |
rsrc isCollection ifTrue:[ |
1356 | 687 |
rsrc keysAndValuesDo:[:rsrc :val | |
688 |
val isCollection ifTrue:[ |
|
689 |
val do:[:v | |
|
690 |
found := item match:v printString |
|
691 |
] |
|
692 |
] ifFalse:[ |
|
693 |
found := item match:val printString |
|
929
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
694 |
] |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
695 |
] |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
696 |
] ifFalse:[ |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
697 |
found := item match:rsrc printString |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
698 |
] |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
699 |
] |
1356 | 700 |
] ifFalse:[ |
701 |
(rsrc includesKey:aResourceSymbol) ifTrue:[ |
|
702 |
item isNil ifTrue:[ |
|
703 |
found := true |
|
704 |
] ifFalse:[ |
|
705 |
rsrc isCollection ifTrue:[ |
|
706 |
val := rsrc at:aResourceSymbol. |
|
707 |
val isCollection ifTrue:[ |
|
708 |
val do:[:v | |
|
709 |
found := item match:v printString |
|
710 |
] |
|
711 |
] ifFalse:[ |
|
712 |
found := item match:val printString |
|
713 |
] |
|
714 |
] ifFalse:[ |
|
715 |
found := item match:rsrc printString |
|
716 |
] |
|
717 |
] |
|
718 |
] |
|
929
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
719 |
] |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
720 |
] |
573
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
721 |
] |
1356 | 722 |
]. |
929
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
723 |
]. |
1356 | 724 |
found |
725 |
]. |
|
726 |
]. |
|
573
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
727 |
|
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
728 |
browser := self browseMethodsIn:aCollectionOfClasses |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
729 |
where:searchBlock |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
730 |
title:title. |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
731 |
browser notNil ifTrue:[ |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
732 |
browser autoSearch:'resource:' |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
733 |
]. |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
734 |
^ browser |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
735 |
|
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
736 |
" |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
737 |
SystemBrowser |
929
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
738 |
browseForResource:nil |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
739 |
in:Smalltalk allClasses |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
740 |
title:'methods with a resource' |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
741 |
" |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
742 |
" |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
743 |
SystemBrowser |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
744 |
browseForResource:#style |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
745 |
containing:nil |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
746 |
in:Smalltalk allClasses |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
747 |
title:'methods with a #style resource' |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
748 |
" |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
749 |
" |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
750 |
SystemBrowser |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
751 |
browseForResource:#style |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
752 |
containing:'arrowButton*' |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
753 |
in:Smalltalk allClasses |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
754 |
title:'methods with a #style resource' |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
755 |
" |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
756 |
|
1356 | 757 |
"Modified: / 27.10.1997 / 17:32:43 / cg" |
929
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
758 |
! |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
759 |
|
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
760 |
browseForResource:aResourceSymbol in:aCollectionOfClasses title:title |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
761 |
"launch a browser for all methods which have a particular (or any, ifNil) |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
762 |
resource in aCollectionOfClasses" |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
763 |
|
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
764 |
^ self |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
765 |
browseForResource:aResourceSymbol |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
766 |
containing:nil |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
767 |
in:aCollectionOfClasses |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
768 |
title:title |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
769 |
|
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
770 |
" |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
771 |
SystemBrowser |
573
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
772 |
browseForResource:#style |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
773 |
in:Smalltalk allClasses |
929
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
774 |
title:'methods accessing styleSheet values' |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
775 |
" |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
776 |
" |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
777 |
SystemBrowser |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
778 |
browseForResource:#keyboard |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
779 |
in:Smalltalk allClasses |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
780 |
title:'methods handling keyboard events' |
573
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
781 |
" |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
782 |
" |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
783 |
SystemBrowser |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
784 |
browseForResource:nil |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
785 |
in:Smalltalk allClasses |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
786 |
title:'methods with a resource' |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
787 |
" |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
788 |
|
929
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
789 |
"Modified: 9.1.1997 / 12:44:38 / cg" |
573
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
790 |
! |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
791 |
|
203 | 792 |
browseForString:aString |
793 |
"launch a browser for all methods containing a string in their source. |
|
794 |
This may be slow, since source-code has to be scanned." |
|
795 |
||
796 |
^ self browseForString:aString in:(Smalltalk allClasses) |
|
797 |
! |
|
798 |
||
799 |
browseForString:aString in:aCollectionOfClasses |
|
800 |
"launch a browser for all methods in aCollectionOfClasses |
|
801 |
containing a string in their source. |
|
802 |
This may be slow, since source-code has to be scanned." |
|
803 |
||
804 |
|browser searchBlock title s| |
|
805 |
||
256 | 806 |
title := self classResources string:'methods containing: %1' with:aString displayString. |
203 | 807 |
|
808 |
(aString includesMatchCharacters) ifTrue:[ |
|
256 | 809 |
s := '*' , aString , '*'. |
810 |
"a matchString" |
|
475
b14b3ab39af6
dont crash if searching a string in a method which has no accessable source
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
811 |
searchBlock := [:c :m :sel | |
b14b3ab39af6
dont crash if searching a string in a method which has no accessable source
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
812 |
|src| |
b14b3ab39af6
dont crash if searching a string in a method which has no accessable source
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
813 |
src := m source. |
b14b3ab39af6
dont crash if searching a string in a method which has no accessable source
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
814 |
src isNil ifTrue:['no source' printNL. false] |
b14b3ab39af6
dont crash if searching a string in a method which has no accessable source
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
815 |
ifFalse:[s match:m source] |
b14b3ab39af6
dont crash if searching a string in a method which has no accessable source
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
816 |
] |
203 | 817 |
] ifFalse:[ |
475
b14b3ab39af6
dont crash if searching a string in a method which has no accessable source
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
818 |
searchBlock := [:c :m :sel | |
b14b3ab39af6
dont crash if searching a string in a method which has no accessable source
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
819 |
|src| |
b14b3ab39af6
dont crash if searching a string in a method which has no accessable source
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
820 |
|
b14b3ab39af6
dont crash if searching a string in a method which has no accessable source
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
821 |
src := m source. |
b14b3ab39af6
dont crash if searching a string in a method which has no accessable source
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
822 |
src isNil ifTrue:['no source' printNL. false] |
b14b3ab39af6
dont crash if searching a string in a method which has no accessable source
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
823 |
ifFalse:[ (m source findString:aString) ~~ 0 ] |
b14b3ab39af6
dont crash if searching a string in a method which has no accessable source
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
824 |
] |
203 | 825 |
]. |
826 |
browser := self browseMethodsIn:aCollectionOfClasses where:searchBlock title:title. |
|
827 |
||
828 |
browser notNil ifTrue:[ |
|
256 | 829 |
browser autoSearch:aString |
203 | 830 |
]. |
831 |
^ browser |
|
832 |
||
833 |
" |
|
834 |
SystemBrowser browseForString:'all' in:(Array with:Object) |
|
835 |
SystemBrowser browseForString:'should' in:(Array with:Object) |
|
836 |
SystemBrowser browseForString:'[eE]rror' in:(Array with:Object) |
|
837 |
" |
|
838 |
||
256 | 839 |
"Created: 9.12.1995 / 18:03:12 / cg" |
475
b14b3ab39af6
dont crash if searching a string in a method which has no accessable source
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
840 |
"Modified: 12.4.1996 / 19:03:29 / cg" |
203 | 841 |
! |
842 |
||
843 |
browseForSymbol:aSymbol |
|
844 |
"launch a browser for all methods referencing aSymbol" |
|
845 |
||
666 | 846 |
^ self |
847 |
browseForSymbol:aSymbol |
|
848 |
title:(self classResources string:'users of: %1' with:aSymbol) |
|
849 |
warnIfNone:true |
|
256 | 850 |
|
851 |
"Created: 9.12.1995 / 18:04:34 / cg" |
|
666 | 852 |
"Modified: 10.7.1996 / 10:35:34 / cg" |
853 |
! |
|
854 |
||
855 |
browseForSymbol:aSymbol in:aSetOfClasses title:title warnIfNone:doWarn |
|
856 |
"launch a browser for all methods referencing aSymbol" |
|
857 |
||
858 |
|browser searchBlock sym| |
|
859 |
||
860 |
(aSymbol includesMatchCharacters) ifTrue:[ |
|
861 |
"a matchString" |
|
862 |
searchBlock := [:c :m :s | |
|
863 |
(m literalsDetect:[:aLiteral| |
|
864 |
(aLiteral isMemberOf:Symbol) |
|
865 |
and:[aSymbol match:aLiteral] |
|
866 |
] ifNone:nil) notNil |
|
867 |
]. |
|
868 |
] ifFalse:[ |
|
869 |
" |
|
870 |
can do a faster search |
|
871 |
" |
|
872 |
sym := aSymbol asSymbolIfInterned. |
|
873 |
sym isNil ifTrue:[ |
|
874 |
self showNoneFound:title. |
|
875 |
^ nil |
|
876 |
]. |
|
877 |
||
878 |
searchBlock := [:c :m :s | |
|
879 |
(m literalsDetect:[:aLiteral| |
|
880 |
(sym == aLiteral) |
|
881 |
] ifNone:nil) notNil |
|
882 |
]. |
|
883 |
]. |
|
884 |
doWarn ifFalse:[ |
|
885 |
WarningSignal ignoreIn:[ |
|
886 |
browser := self browseMethodsIn:aSetOfClasses where:searchBlock title:title. |
|
887 |
] |
|
888 |
] ifTrue:[ |
|
889 |
browser := self browseMethodsIn:aSetOfClasses where:searchBlock title:title. |
|
890 |
]. |
|
891 |
browser notNil ifTrue:[ |
|
892 |
browser autoSearch:aSymbol |
|
893 |
]. |
|
894 |
^ browser |
|
895 |
||
896 |
"Modified: 24.6.1996 / 14:39:07 / stefan" |
|
897 |
"Modified: 30.6.1996 / 16:45:25 / cg" |
|
898 |
"Created: 10.7.1996 / 10:36:36 / cg" |
|
203 | 899 |
! |
900 |
||
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
901 |
browseForSymbol:aSymbol in:aSetOfClasses title:title warnIfNone:doWarn searchFor:searchString |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
902 |
"launch a browser for all methods referencing aSymbol" |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
903 |
|
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
904 |
|browser searchBlock sym| |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
905 |
|
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
906 |
(aSymbol includesMatchCharacters) ifTrue:[ |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
907 |
"a matchString" |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
908 |
searchBlock := [:c :m :s | |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
909 |
(m literalsDetect:[:aLiteral| |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
910 |
(aLiteral isMemberOf:Symbol) |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
911 |
and:[aSymbol match:aLiteral] |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
912 |
] ifNone:nil) notNil |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
913 |
]. |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
914 |
] ifFalse:[ |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
915 |
" |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
916 |
can do a faster search |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
917 |
" |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
918 |
sym := aSymbol asSymbolIfInterned. |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
919 |
sym isNil ifTrue:[ |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
920 |
self showNoneFound:title. |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
921 |
^ nil |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
922 |
]. |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
923 |
|
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
924 |
searchBlock := [:c :m :s | |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
925 |
(m literalsDetect:[:aLiteral| |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
926 |
(sym == aLiteral) |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
927 |
] ifNone:nil) notNil |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
928 |
]. |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
929 |
]. |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
930 |
doWarn ifFalse:[ |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
931 |
WarningSignal ignoreIn:[ |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
932 |
browser := self browseMethodsIn:aSetOfClasses where:searchBlock title:title. |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
933 |
] |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
934 |
] ifTrue:[ |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
935 |
browser := self browseMethodsIn:aSetOfClasses where:searchBlock title:title. |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
936 |
]. |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
937 |
|
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
938 |
(browser notNil |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
939 |
and:[searchString notNil]) ifTrue:[ |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
940 |
browser autoSearch:searchString |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
941 |
]. |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
942 |
^ browser |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
943 |
|
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
944 |
"Modified: 24.6.1996 / 14:39:07 / stefan" |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
945 |
"Modified: 30.6.1996 / 16:45:25 / cg" |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
946 |
"Created: 31.10.1996 / 14:57:30 / cg" |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
947 |
! |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
948 |
|
203 | 949 |
browseForSymbol:aSymbol title:title warnIfNone:doWarn |
950 |
"launch a browser for all methods referencing aSymbol" |
|
951 |
||
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
952 |
^ self |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
953 |
browseForSymbol:aSymbol |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
954 |
title:title |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
955 |
warnIfNone:doWarn |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
956 |
searchFor:aSymbol |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
957 |
|
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
958 |
"Modified: 31.10.1996 / 14:45:38 / cg" |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
959 |
! |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
960 |
|
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
961 |
browseForSymbol:aSymbol title:title warnIfNone:doWarn searchFor:searchString |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
962 |
"launch a browser for all methods referencing aSymbol" |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
963 |
|
203 | 964 |
|browser searchBlock sym| |
965 |
||
966 |
(aSymbol includesMatchCharacters) ifTrue:[ |
|
375 | 967 |
"a matchString" |
968 |
searchBlock := [:c :m :s | |
|
653
c89148d005d5
fixed calls to literalsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents:
648
diff
changeset
|
969 |
(m literalsDetect:[:aLiteral| |
648
6ec086b7972c
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
634
diff
changeset
|
970 |
(aLiteral isMemberOf:Symbol) |
6ec086b7972c
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
634
diff
changeset
|
971 |
and:[aSymbol match:aLiteral] |
653
c89148d005d5
fixed calls to literalsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents:
648
diff
changeset
|
972 |
] ifNone:nil) notNil |
375 | 973 |
]. |
203 | 974 |
] ifFalse:[ |
375 | 975 |
" |
976 |
can do a faster search |
|
977 |
" |
|
978 |
sym := aSymbol asSymbolIfInterned. |
|
979 |
sym isNil ifTrue:[ |
|
980 |
self showNoneFound:title. |
|
981 |
^ nil |
|
982 |
]. |
|
203 | 983 |
|
375 | 984 |
searchBlock := [:c :m :s | |
653
c89148d005d5
fixed calls to literalsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents:
648
diff
changeset
|
985 |
(m literalsDetect:[:aLiteral| |
c89148d005d5
fixed calls to literalsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents:
648
diff
changeset
|
986 |
(sym == aLiteral) |
c89148d005d5
fixed calls to literalsDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents:
648
diff
changeset
|
987 |
] ifNone:nil) notNil |
375 | 988 |
]. |
203 | 989 |
]. |
215
244f3a9b2a60
check for existing class in rename; avoid warnbox if no refs are found after rename
Claus Gittinger <cg@exept.de>
parents:
204
diff
changeset
|
990 |
doWarn ifFalse:[ |
375 | 991 |
WarningSignal ignoreIn:[ |
992 |
browser := self browseMethodsWhere:searchBlock title:title. |
|
993 |
] |
|
215
244f3a9b2a60
check for existing class in rename; avoid warnbox if no refs are found after rename
Claus Gittinger <cg@exept.de>
parents:
204
diff
changeset
|
994 |
] ifTrue:[ |
375 | 995 |
browser := self browseMethodsWhere:searchBlock title:title. |
215
244f3a9b2a60
check for existing class in rename; avoid warnbox if no refs are found after rename
Claus Gittinger <cg@exept.de>
parents:
204
diff
changeset
|
996 |
]. |
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
997 |
|
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
998 |
(browser notNil |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
999 |
and:[searchString notNil]) ifTrue:[ |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1000 |
browser autoSearch:searchString |
203 | 1001 |
]. |
1002 |
^ browser |
|
375 | 1003 |
|
648
6ec086b7972c
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
634
diff
changeset
|
1004 |
"Modified: 24.6.1996 / 14:39:07 / stefan" |
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1005 |
"Created: 31.10.1996 / 14:45:08 / cg" |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1006 |
"Modified: 31.10.1996 / 14:46:07 / cg" |
203 | 1007 |
! |
1008 |
||
52 | 1009 |
browseImplementorsOf:aSelectorString |
1010 |
"launch a browser for all implementors of aSelector" |
|
1011 |
||
666 | 1012 |
^ self browseImplementorsOf:aSelectorString in:(Smalltalk allClasses) |
52 | 1013 |
|
1014 |
" |
|
1015 |
SystemBrowser browseImplementorsOf:#+ |
|
1016 |
" |
|
256 | 1017 |
|
1018 |
"Created: 9.12.1995 / 18:01:18 / cg" |
|
666 | 1019 |
"Modified: 10.7.1996 / 10:21:26 / cg" |
1020 |
! |
|
1021 |
||
1022 |
browseImplementorsOf:aSelectorString in:aSetOfClasses |
|
1023 |
"launch a browser for all implementors of aSelector" |
|
1024 |
||
1025 |
^ self browseImplementorsOf:aSelectorString |
|
1026 |
in:aSetOfClasses |
|
1027 |
title:(self classResources string:'implementors of: %1' with:aSelectorString) |
|
1028 |
||
1029 |
" |
|
1030 |
SystemBrowser browseImplementorsOf:#+ in:(Number withAllSubclasses) |
|
1031 |
" |
|
1032 |
||
1033 |
"Created: 10.7.1996 / 10:20:59 / cg" |
|
1034 |
"Modified: 10.7.1996 / 10:21:49 / cg" |
|
52 | 1035 |
! |
1036 |
||
36 | 1037 |
browseImplementorsOf:aSelectorString in:aCollectionOfClasses title:title |
1038 |
"launch a browser for all implementors of aSelector in |
|
1039 |
the classes contained in aCollectionOfClasses and its metaclasses" |
|
1040 |
||
1041 |
|list sel| |
|
1042 |
||
270 | 1043 |
list := Set new. |
36 | 1044 |
|
1045 |
((aSelectorString ~= '*') and:[aSelectorString includesMatchCharacters]) ifTrue:[ |
|
270 | 1046 |
"a matchString" |
1047 |
||
1048 |
aCollectionOfClasses do:[:aClass | |
|
1049 |
|nm| |
|
45 | 1050 |
|
1035
a9a02fffddbf
ignore obsolete classes when searching for implementors
ca
parents:
1031
diff
changeset
|
1051 |
aClass isObsolete ifFalse:[ |
a9a02fffddbf
ignore obsolete classes when searching for implementors
ca
parents:
1031
diff
changeset
|
1052 |
nm := aClass name. |
a9a02fffddbf
ignore obsolete classes when searching for implementors
ca
parents:
1031
diff
changeset
|
1053 |
aClass methodDictionary keysAndValuesDo:[:aSelector :aMethod | |
270 | 1054 |
(aSelectorString match:aSelector) ifTrue:[ |
1035
a9a02fffddbf
ignore obsolete classes when searching for implementors
ca
parents:
1031
diff
changeset
|
1055 |
list add:aMethod "/ (nm , ' ' , (aMethod printStringForBrowserWithSelector:aSelector)) |
a9a02fffddbf
ignore obsolete classes when searching for implementors
ca
parents:
1031
diff
changeset
|
1056 |
] |
a9a02fffddbf
ignore obsolete classes when searching for implementors
ca
parents:
1031
diff
changeset
|
1057 |
]. |
a9a02fffddbf
ignore obsolete classes when searching for implementors
ca
parents:
1031
diff
changeset
|
1058 |
aClass isMeta ifFalse:[ |
a9a02fffddbf
ignore obsolete classes when searching for implementors
ca
parents:
1031
diff
changeset
|
1059 |
aClass class methodDictionary keysAndValuesDo:[:aSelector :aMethod | |
a9a02fffddbf
ignore obsolete classes when searching for implementors
ca
parents:
1031
diff
changeset
|
1060 |
(aSelectorString match:aSelector) ifTrue:[ |
a9a02fffddbf
ignore obsolete classes when searching for implementors
ca
parents:
1031
diff
changeset
|
1061 |
list add:aMethod "/ (nm , ' class ' , (aMethod printStringForBrowserWithSelector:aSelector)) |
a9a02fffddbf
ignore obsolete classes when searching for implementors
ca
parents:
1031
diff
changeset
|
1062 |
] |
270 | 1063 |
] |
1064 |
] |
|
1065 |
] |
|
1066 |
] |
|
36 | 1067 |
] ifFalse:[ |
270 | 1068 |
"can do a faster search" |
45 | 1069 |
|
270 | 1070 |
sel := aSelectorString asSymbolIfInterned. |
1071 |
sel isNil ifTrue:[ |
|
1072 |
self showNoneFound:title. |
|
1073 |
^ nil |
|
1074 |
]. |
|
1075 |
||
1076 |
aCollectionOfClasses do:[:aClass | |
|
675
57cc7dc74d67
show privacy in senders/implementors list;
Claus Gittinger <cg@exept.de>
parents:
666
diff
changeset
|
1077 |
|nm mthd| |
45 | 1078 |
|
1035
a9a02fffddbf
ignore obsolete classes when searching for implementors
ca
parents:
1031
diff
changeset
|
1079 |
aClass isObsolete ifFalse:[ |
a9a02fffddbf
ignore obsolete classes when searching for implementors
ca
parents:
1031
diff
changeset
|
1080 |
nm := aClass name. |
a9a02fffddbf
ignore obsolete classes when searching for implementors
ca
parents:
1031
diff
changeset
|
1081 |
(aClass implements:sel) ifTrue:[ |
a9a02fffddbf
ignore obsolete classes when searching for implementors
ca
parents:
1031
diff
changeset
|
1082 |
mthd := aClass compiledMethodAt:sel. |
a9a02fffddbf
ignore obsolete classes when searching for implementors
ca
parents:
1031
diff
changeset
|
1083 |
list add:mthd "/ (nm , ' ' , (mthd printStringForBrowserWithSelector:sel)) |
a9a02fffddbf
ignore obsolete classes when searching for implementors
ca
parents:
1031
diff
changeset
|
1084 |
]. |
a9a02fffddbf
ignore obsolete classes when searching for implementors
ca
parents:
1031
diff
changeset
|
1085 |
aClass isMeta ifFalse:[ |
a9a02fffddbf
ignore obsolete classes when searching for implementors
ca
parents:
1031
diff
changeset
|
1086 |
(aClass class implements:sel) ifTrue:[ |
a9a02fffddbf
ignore obsolete classes when searching for implementors
ca
parents:
1031
diff
changeset
|
1087 |
mthd := aClass class compiledMethodAt:sel. |
a9a02fffddbf
ignore obsolete classes when searching for implementors
ca
parents:
1031
diff
changeset
|
1088 |
list add:mthd "/ (nm , ' class ' , (mthd printStringForBrowserWithSelector:sel)) |
a9a02fffddbf
ignore obsolete classes when searching for implementors
ca
parents:
1031
diff
changeset
|
1089 |
] |
270 | 1090 |
] |
1091 |
] |
|
1092 |
] |
|
36 | 1093 |
]. |
270 | 1094 |
^ self browseMethods:list asOrderedCollection title:title |
36 | 1095 |
|
1096 |
" |
|
1097 |
SystemBrowser browseImplementorsOf:#+ |
|
270 | 1098 |
in:(Array with:Number |
1099 |
with:Float |
|
1100 |
with:SmallInteger) |
|
1101 |
title:'some implementors of +' |
|
36 | 1102 |
" |
132 | 1103 |
|
1104 |
"Modified: 4.9.1995 / 17:33:39 / claus" |
|
634
24a678f81829
Change the name of a classes Metaclass from e.g. "SmallIntegerclass" to
Stefan Vogel <sv@exept.de>
parents:
620
diff
changeset
|
1105 |
"Modified: 19.6.1996 / 14:19:02 / stefan" |
675
57cc7dc74d67
show privacy in senders/implementors list;
Claus Gittinger <cg@exept.de>
parents:
666
diff
changeset
|
1106 |
"Modified: 15.7.1996 / 11:49:35 / cg" |
36 | 1107 |
! |
1108 |
||
52 | 1109 |
browseImplementorsOf:aSelectorString under:aClass |
1110 |
"launch a browser for all implementors of aSelector in aClass |
|
1111 |
and its subclasses" |
|
1112 |
||
1113 |
^ self browseImplementorsOf:aSelectorString |
|
256 | 1114 |
in:(aClass withAllSubclasses) |
1115 |
title:(self classResources string:'implementors of: %1 (in and below %2)' |
|
1116 |
with:aSelectorString |
|
1117 |
with:aClass name) |
|
52 | 1118 |
|
1119 |
" |
|
1120 |
SystemBrowser browseImplementorsOf:#+ under:Integer |
|
1121 |
" |
|
256 | 1122 |
|
1123 |
"Created: 9.12.1995 / 18:06:09 / cg" |
|
1124 |
"Modified: 9.12.1995 / 18:11:38 / cg" |
|
52 | 1125 |
! |
1126 |
||
203 | 1127 |
browseInstRefsTo:aString in:aCollectionOfClasses modificationsOnly:modsOnly |
1128 |
"launch a browser for all methods in aClass where the instVar named |
|
1129 |
aString is referenced; if modsOnly is true, browse only methods where the |
|
1130 |
instvar is modified" |
|
45 | 1131 |
|
203 | 1132 |
^ self browseRefsTo:aString classVars:false in:aCollectionOfClasses modificationsOnly:modsOnly |
36 | 1133 |
! |
1134 |
||
203 | 1135 |
browseInstRefsTo:varName in:aCollectionOfClasses modificationsOnly:modsOnly title:title |
1136 |
"launch a browser for all methods in aClass where the instVar named |
|
1137 |
varName is referenced; if modsOnly is true, browse only methods where the |
|
1138 |
instvar is modified" |
|
52 | 1139 |
|
203 | 1140 |
^ self browseRefsTo:varName classVars:false in:aCollectionOfClasses modificationsOnly:modsOnly title:title |
52 | 1141 |
! |
1142 |
||
203 | 1143 |
browseInstRefsTo:aString under:aClass modificationsOnly:modsOnly |
1144 |
"launch a browser for all methods in aClass and subclasses |
|
1145 |
where the instVar named aString is referenced; |
|
1146 |
if modsOnly is true, browse only methods where the instvar is modified" |
|
36 | 1147 |
|
203 | 1148 |
^ self browseInstRefsTo:aString in:(aClass withAllSubclasses) modificationsOnly:modsOnly |
36 | 1149 |
! |
1150 |
||
1151 |
browseReferendsOf:aGlobalName |
|
1152 |
"launch a browser for all methods referencing a global |
|
1367 | 1153 |
named aGlobalName. The argument may be a symbol, a string or |
1154 |
a matchPattern. |
|
36 | 1155 |
" |
1156 |
||
1157 |
^ self browseReferendsOf:aGlobalName warnIfNone:true |
|
1158 |
||
1159 |
" |
|
1160 |
Browser browseReferendsOf:#Transcript |
|
1367 | 1161 |
Browser browseReferendsOf:'Tr*' |
36 | 1162 |
" |
75 | 1163 |
|
1367 | 1164 |
"Modified: / 30.10.1997 / 23:45:52 / cg" |
36 | 1165 |
! |
1166 |
||
666 | 1167 |
browseReferendsOf:aGlobalName in:aSetOfClasses |
1168 |
"launch a browser for all methods referencing a global |
|
1169 |
named aGlobalName. |
|
1170 |
" |
|
1171 |
||
1172 |
^ self browseReferendsOf:aGlobalName in:aSetOfClasses warnIfNone:true |
|
1173 |
||
1174 |
" |
|
1175 |
Browser browseReferendsOf:#Transcript |
|
1176 |
" |
|
1177 |
||
1178 |
"Created: 10.7.1996 / 10:37:30 / cg" |
|
1179 |
! |
|
1180 |
||
1181 |
browseReferendsOf:aGlobalName in:aSetOfClasses warnIfNone:doWarn |
|
1182 |
"launch a browser for all methods referencing a global |
|
1183 |
named aGlobalName. |
|
1184 |
" |
|
1185 |
||
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1186 |
|globalsPlainName idx| |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1187 |
|
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1188 |
globalsPlainName := aGlobalName. |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1189 |
(idx := globalsPlainName lastIndexOf:$:) ~~ 0 ifTrue:[ |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1190 |
globalsPlainName := globalsPlainName copyFrom:idx+1 |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1191 |
]. |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1192 |
|
666 | 1193 |
^ self browseForSymbol:aGlobalName |
1194 |
in:aSetOfClasses |
|
1195 |
title:(self classResources string:'users of: %1' with:aGlobalName) |
|
1196 |
warnIfNone:doWarn |
|
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1197 |
searchFor:globalsPlainName |
666 | 1198 |
|
1199 |
"Created: 10.7.1996 / 10:37:02 / cg" |
|
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1200 |
"Modified: 31.10.1996 / 14:56:38 / cg" |
666 | 1201 |
! |
1202 |
||
1367 | 1203 |
browseReferendsOf:aGlobalName title:title warnIfNone:doWarn |
203 | 1204 |
"launch a browser for all methods referencing a global |
1205 |
named aGlobalName. |
|
1206 |
" |
|
1207 |
||
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1208 |
|globalsPlainName idx| |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1209 |
|
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1210 |
globalsPlainName := aGlobalName. |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1211 |
(idx := globalsPlainName lastIndexOf:$:) ~~ 0 ifTrue:[ |
1367 | 1212 |
globalsPlainName := globalsPlainName copyFrom:idx+1. |
1213 |
(globalsPlainName size == 0 |
|
1214 |
or:[globalsPlainName = '*']) ifTrue:[ |
|
1215 |
globalsPlainName := aGlobalName |
|
1216 |
] |
|
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1217 |
]. |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1218 |
|
666 | 1219 |
^ self browseForSymbol:aGlobalName |
1367 | 1220 |
title:title |
666 | 1221 |
warnIfNone:doWarn |
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1222 |
searchFor:globalsPlainName |
203 | 1223 |
|
1367 | 1224 |
"Modified: / 31.10.1996 / 14:47:48 / cg" |
1225 |
"Created: / 31.10.1997 / 15:41:28 / cg" |
|
1226 |
! |
|
1227 |
||
1228 |
browseReferendsOf:aGlobalName warnIfNone:doWarn |
|
1229 |
"launch a browser for all methods referencing a global |
|
1230 |
named aGlobalName. |
|
1231 |
" |
|
1232 |
||
1233 |
^ self |
|
1234 |
browseReferendsOf:aGlobalName |
|
1235 |
title:(self classResources string:'users of: %1' with:aGlobalName) |
|
1236 |
warnIfNone:doWarn |
|
1237 |
||
1238 |
"Modified: / 31.10.1997 / 15:42:05 / cg" |
|
203 | 1239 |
! |
1240 |
||
1241 |
browseRefsTo:aString classVars:classVars in:aCollectionOfClasses modificationsOnly:modsOnly |
|
1242 |
"launch a browser for all methods in aClass where the instVar/classVar named |
|
1243 |
aString is referenced; if modsOnly is true, browse only methods where the |
|
1244 |
instvar is modified" |
|
1245 |
||
1246 |
|title| |
|
1247 |
||
1248 |
modsOnly ifTrue:[ |
|
256 | 1249 |
title := 'modifications of: %1' |
203 | 1250 |
] ifFalse:[ |
256 | 1251 |
title := 'references to: %1 ' |
203 | 1252 |
]. |
1253 |
^ self |
|
256 | 1254 |
browseRefsTo:aString |
1255 |
classVars:classVars |
|
1256 |
in:aCollectionOfClasses |
|
1257 |
modificationsOnly:modsOnly |
|
1258 |
title:(self classResources string:title with:aString) |
|
1259 |
||
1260 |
"Created: 9.12.1995 / 18:07:05 / cg" |
|
1261 |
"Modified: 9.12.1995 / 18:11:49 / cg" |
|
203 | 1262 |
! |
1263 |
||
1264 |
browseRefsTo:varName classVars:classVars in:aCollectionOfClasses modificationsOnly:modsOnly title:title |
|
1265 |
"launch a browser for all methods in aClass where the instVar/classVar named |
|
1266 |
varName is referenced; if modsOnly is true, browse only methods where the |
|
1267 |
instvar is modified" |
|
1268 |
||
1269 |
|filter browser pattern| |
|
1270 |
||
1271 |
filter := self filterToSearchRefsTo:varName classVars:classVars modificationsOnly:modsOnly. |
|
1272 |
browser := self browseMethodsIn:aCollectionOfClasses |
|
1273 |
inst:true class:classVars where:filter title:title. |
|
1274 |
||
1275 |
browser notNil ifTrue:[ |
|
1276 |
modsOnly ifTrue:[ |
|
1277 |
pattern := varName , ' :=' |
|
1278 |
] ifFalse:[ |
|
1279 |
pattern := varName |
|
1280 |
]. |
|
1281 |
browser autoSearch:pattern |
|
1282 |
]. |
|
1283 |
^ browser |
|
1284 |
! |
|
1285 |
||
256 | 1286 |
browseSuperCallsIn:aCollectionOfClasses title:title |
1287 |
"launch a browser for all super sends in aCollectionOfClasses" |
|
1288 |
||
742
2ef5e22d8983
code cleanup (unused vars eliminated)
Claus Gittinger <cg@exept.de>
parents:
675
diff
changeset
|
1289 |
|browser searchBlock| |
256 | 1290 |
|
1291 |
searchBlock := [:class :method :s | |
|
504 | 1292 |
|src parser| |
256 | 1293 |
|
504 | 1294 |
src := method source. |
1295 |
(src findString:'super') ~~ 0 ifTrue:[ |
|
1296 |
parser := Parser |
|
1297 |
parseMethod:method source |
|
1298 |
in:class |
|
1299 |
ignoreErrors:true |
|
1300 |
ignoreWarnings:true. |
|
1301 |
||
1302 |
parser notNil and:[parser usesSuper] |
|
1303 |
] ifFalse:[ |
|
1304 |
false |
|
1305 |
] |
|
256 | 1306 |
]. |
1307 |
||
1308 |
browser := self browseMethodsIn:aCollectionOfClasses |
|
504 | 1309 |
where:searchBlock |
1310 |
title:title. |
|
256 | 1311 |
|
1312 |
browser notNil ifTrue:[ |
|
504 | 1313 |
browser autoSearch:'super' |
256 | 1314 |
]. |
1315 |
^ browser |
|
1316 |
||
504 | 1317 |
" |
1318 |
SystemBrowser |
|
1319 |
browseSuperCallsIn:(Array with:SortedCollection) |
|
1320 |
title:'superSends in SortedCollection' |
|
1321 |
" |
|
1322 |
||
256 | 1323 |
"Created: 23.11.1995 / 14:08:55 / cg" |
504 | 1324 |
"Modified: 24.4.1996 / 13:25:31 / cg" |
256 | 1325 |
! |
1326 |
||
1327 |
browseSuperCallsUnder:aClass |
|
1328 |
"launch a browser for all supersends in aClass and subclasses" |
|
1329 |
||
1330 |
^ self browseSuperCallsIn:(aClass withAllSubclasses) |
|
1331 |
title:(self classResources string:'supersends (in and below %1)' with:aClass name) |
|
1332 |
||
1333 |
" |
|
1334 |
SystemBrowser browseSuperCallsUnder:Number |
|
1335 |
" |
|
1336 |
||
1337 |
"Created: 23.11.1995 / 12:06:06 / cg" |
|
1338 |
"Modified: 9.12.1995 / 18:11:59 / cg" |
|
1339 |
! |
|
1340 |
||
52 | 1341 |
browseUsesOf:aClass |
1342 |
|dict owners offsets |
|
1343 |
sz "{ Class: SmallInteger }" |
|
1344 |
n "{ Class: SmallInteger }" |
|
1345 |
removeSet newDict| |
|
1346 |
||
1347 |
owners := ObjectMemory whoReferencesInstancesOf:aClass. |
|
1348 |
||
1349 |
" |
|
1350 |
collect set of offsets in dict; key is class |
|
1351 |
" |
|
1352 |
dict := IdentityDictionary new. |
|
1353 |
owners do:[:someObject | |
|
1354 |
|cls create| |
|
1355 |
||
1356 |
someObject isContext ifFalse:[ |
|
1357 |
" |
|
1358 |
someObject refers to an instance of aClass; |
|
1359 |
find out, which instVar(s) |
|
1360 |
" |
|
1361 |
cls := someObject class. |
|
1362 |
cls ~~ Array ifTrue:[ |
|
1363 |
n := cls instSize. |
|
1364 |
create := [|s| s := Set new. dict at:cls put:s. s]. |
|
1365 |
||
1366 |
1 to:n do:[:i | |
|
1367 |
|ref| |
|
1368 |
||
1369 |
ref := someObject instVarAt:i. |
|
1370 |
(ref isMemberOf:aClass) ifTrue:[ |
|
1371 |
offsets := dict at:cls ifAbsent:create. |
|
1372 |
offsets add:i. |
|
1373 |
] |
|
1374 |
]. |
|
1375 |
cls isVariable ifTrue:[ |
|
1376 |
cls isPointers ifTrue:[ |
|
1377 |
| idx "{ Class: SmallInteger }" | |
|
1378 |
||
1379 |
sz := someObject basicSize. |
|
1380 |
idx := 1. |
|
1381 |
[idx <= sz] whileTrue:[ |
|
1382 |
|ref| |
|
1383 |
||
1384 |
ref := someObject basicAt:idx. |
|
1385 |
(ref isMemberOf:aClass) ifTrue:[ |
|
1386 |
offsets := dict at:cls ifAbsent:create. |
|
1387 |
offsets add:0. |
|
1388 |
idx := sz |
|
1389 |
]. |
|
1390 |
idx := idx + 1 |
|
1391 |
] |
|
1392 |
] |
|
1393 |
] |
|
1394 |
] |
|
1395 |
] |
|
1396 |
]. |
|
1397 |
||
1398 |
" |
|
1399 |
merge with superclass refs |
|
1400 |
" |
|
1401 |
dict keysAndValuesDo:[:cls :set | |
|
1402 |
cls allSuperclasses do:[:aSuperclass | |
|
1403 |
|superSet| |
|
1404 |
||
1405 |
superSet := dict at:aSuperclass ifAbsent:[]. |
|
1406 |
superSet notNil ifTrue:[ |
|
1407 |
|removeSet| |
|
1408 |
||
1409 |
superSet := dict at:aSuperclass. |
|
1410 |
removeSet := Set new. |
|
1411 |
set do:[:offset | |
|
1412 |
(superSet includes:offset) ifTrue:[ |
|
1413 |
removeSet add:offset |
|
1414 |
] |
|
1415 |
]. |
|
1416 |
set removeAll:removeSet |
|
1417 |
] |
|
1418 |
] |
|
1419 |
]. |
|
1420 |
||
1421 |
" |
|
1422 |
remove empty ones |
|
1423 |
" |
|
1424 |
removeSet := Set new. |
|
1425 |
dict keysAndValuesDo:[:cls :set | |
|
1426 |
set isEmpty ifTrue:[ |
|
1427 |
removeSet add:cls |
|
1428 |
] |
|
1429 |
]. |
|
1430 |
removeSet do:[:cls | |
|
1431 |
dict removeKey:cls |
|
1432 |
]. |
|
1433 |
||
1434 |
" |
|
1435 |
replace the indices by real names |
|
1436 |
" |
|
1437 |
newDict := IdentityDictionary new. |
|
1438 |
dict keysAndValuesDo:[:cls :set | |
|
1439 |
|newSet names| |
|
1440 |
||
1441 |
names := cls allInstVarNames. |
|
1442 |
newSet := set collect:[:index | |
|
1443 |
index == 0 ifTrue:['*indexed*'] ifFalse:[names at:index]. |
|
1444 |
]. |
|
1445 |
newDict at:cls put:newSet |
|
1446 |
]. |
|
1447 |
||
1448 |
newDict inspect |
|
1449 |
||
75 | 1450 |
|
52 | 1451 |
! |
1452 |
||
203 | 1453 |
filterToSearchRefsTo:varName classVars:classVars modificationsOnly:modsOnly |
1454 |
"return a searchblock for variable references" |
|
1455 |
||
1456 |
|searchBlock| |
|
53 | 1457 |
|
203 | 1458 |
searchBlock := [:c :m :s | |
504 | 1459 |
|src result parser vars needMatch| |
1460 |
||
1461 |
needMatch := varName includesMatchCharacters. |
|
36 | 1462 |
|
504 | 1463 |
src := m source. |
1464 |
src isNil ifTrue:[ |
|
1465 |
result := false |
|
1466 |
] ifFalse:[ |
|
1467 |
needMatch ifFalse:[ |
|
1468 |
" |
|
1469 |
before doing a slow parse, quickly scan the |
|
1470 |
methods source for the variables name ... |
|
1471 |
" |
|
1472 |
result := (src findString:varName) ~~ 0. |
|
1473 |
] ifTrue:[ |
|
1474 |
result := true. |
|
1475 |
]. |
|
1476 |
result ifTrue:[ |
|
1477 |
result := false. |
|
1478 |
parser := Parser |
|
1479 |
parseMethod:src |
|
1480 |
in:c |
|
1481 |
ignoreErrors:true |
|
1482 |
ignoreWarnings:true. |
|
36 | 1483 |
|
504 | 1484 |
(parser notNil and:[parser ~~ #Error]) ifTrue:[ |
1485 |
classVars ifFalse:[ |
|
1486 |
modsOnly ifTrue:[ |
|
1487 |
vars := parser modifiedInstVars |
|
1488 |
] ifFalse:[ |
|
1489 |
vars := parser usedInstVars |
|
1490 |
]. |
|
1491 |
] ifTrue:[ |
|
1492 |
modsOnly ifTrue:[ |
|
1493 |
vars := parser modifiedClassVars |
|
1494 |
] ifFalse:[ |
|
1495 |
vars := parser usedClassVars |
|
1496 |
]. |
|
1497 |
]. |
|
1190 | 1498 |
vars size > 0 ifTrue:[ |
504 | 1499 |
needMatch ifTrue:[ |
1500 |
vars do:[:cv | |
|
1501 |
(varName match:cv) ifTrue:[result := true] |
|
1502 |
] |
|
1503 |
] ifFalse:[ |
|
1504 |
result := vars includes:varName |
|
1505 |
] |
|
1506 |
] |
|
1507 |
]. |
|
1508 |
]. |
|
1509 |
]. |
|
1510 |
Processor yield. |
|
1511 |
result |
|
36 | 1512 |
]. |
203 | 1513 |
^ searchBlock |
504 | 1514 |
|
1190 | 1515 |
"Modified: 19.6.1997 / 18:27:57 / cg" |
203 | 1516 |
! ! |
1517 |
||
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1518 |
!SystemBrowser class methodsFor:'startup'! |
36 | 1519 |
|
203 | 1520 |
browseAllSelect:aBlock |
1521 |
"launch a browser for all methods where aBlock returns true. |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1522 |
The block is called with 3 arguments, class, method and selector." |
203 | 1523 |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1524 |
^ self |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1525 |
browseMethodsWhere:aBlock |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1526 |
title:'selected messages' |
36 | 1527 |
|
53 | 1528 |
" |
203 | 1529 |
SystemBrowser browseAllSelect:[:aClass :aMethod :selector | selector numArgs == 3] |
53 | 1530 |
" |
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1531 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1532 |
"Modified: 24.1.1997 / 19:45:05 / cg" |
203 | 1533 |
! |
75 | 1534 |
|
203 | 1535 |
browseClass:aClass |
1536 |
"launch a browser for aClass" |
|
1537 |
||
1538 |
^ self |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1539 |
newWithLabel:aClass name |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1540 |
setupSelector:#setupForClass: |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1541 |
arg:aClass |
203 | 1542 |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1543 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1544 |
SystemBrowser browseClass:Object |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1545 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1546 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1547 |
"Modified: 24.1.1997 / 19:45:16 / cg" |
203 | 1548 |
! |
1549 |
||
1550 |
browseClass:aClass methodCategory:aCategory |
|
1551 |
"launch a browser for all methods under aCategory in aClass" |
|
1552 |
||
1553 |
^ self newWithLabel:(aClass name , ' ' , aCategory) |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1554 |
setupBlock:[:browser | browser setupForClass:aClass methodCategory:aCategory] |
203 | 1555 |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1556 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1557 |
SystemBrowser browseClass:String methodCategory:'copying' |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1558 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1559 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1560 |
"Modified: 24.1.1997 / 19:45:23 / cg" |
203 | 1561 |
! |
1562 |
||
1563 |
browseClass:aClass selector:selector |
|
1564 |
"launch a browser for the method at selector in aClass" |
|
1565 |
||
1566 |
^ self |
|
1567 |
newWithLabel:(aClass name , ' ' , selector , ' ' , selector) |
|
1568 |
setupBlock:[:newBrowser | newBrowser setupForClass:aClass selector:selector] |
|
1569 |
||
1570 |
" |
|
1571 |
SystemBrowser browseClass:Object selector:#printString |
|
1572 |
" |
|
36 | 1573 |
! |
1574 |
||
203 | 1575 |
browseClassCategory:aClassCategory |
1576 |
"launch a browser for all classes under aCategory" |
|
1577 |
||
1578 |
^ self |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1579 |
newWithLabel:aClassCategory |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1580 |
setupSelector:#setupForClassCategory: |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1581 |
arg:aClassCategory |
203 | 1582 |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1583 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1584 |
SystemBrowser browseClassCategory:'Kernel-Objects' |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1585 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1586 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1587 |
"Modified: 24.1.1997 / 19:45:32 / cg" |
203 | 1588 |
! |
1589 |
||
1590 |
browseClassHierarchy:aClass |
|
1591 |
"launch a browser for aClass and all its superclasses. |
|
1592 |
this is different from the fullProtocol browser." |
|
36 | 1593 |
|
203 | 1594 |
^ self |
1595 |
newWithLabel:(aClass name , '-' , 'hierarchy') |
|
1596 |
setupSelector:#setupForClassHierarchy: |
|
1597 |
arg:aClass |
|
1598 |
||
1599 |
" |
|
1600 |
SystemBrowser browseClassHierarchy:Number |
|
1601 |
" |
|
1602 |
! |
|
1603 |
||
1604 |
browseClasses:aList title:title |
|
1605 |
"launch a browser for all classes in aList" |
|
1606 |
||
1607 |
^ self |
|
576
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
1608 |
newWithLabel:title |
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
1609 |
setupBlock:[:b | b setupForClassList:aList sort:true] |
203 | 1610 |
|
1611 |
" |
|
1612 |
SystemBrowser browseClasses:(Array with:Object |
|
576
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
1613 |
with:Float) |
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
1614 |
title:'two classes' |
203 | 1615 |
" |
576
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
1616 |
|
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
1617 |
"Modified: 28.5.1996 / 13:52:25 / cg" |
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
1618 |
! |
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
1619 |
|
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
1620 |
browseClasses:aList title:title sort:doSort |
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
1621 |
"launch a browser for all classes in aList" |
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
1622 |
|
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
1623 |
^ self |
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
1624 |
newWithLabel:title |
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
1625 |
setupBlock:[:b | b setupForClassList:aList sort:doSort] |
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
1626 |
|
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
1627 |
" |
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
1628 |
SystemBrowser browseClasses:(Array with:Object |
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
1629 |
with:Float) |
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
1630 |
title:'two classes' |
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
1631 |
" |
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
1632 |
|
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
1633 |
"Created: 28.5.1996 / 13:52:09 / cg" |
52 | 1634 |
! |
1635 |
||
203 | 1636 |
browseFullClassProtocol:aClass |
1637 |
"launch a browser for aClasses full protocol. |
|
1638 |
This is different from hierarchy browsing." |
|
1639 |
||
1640 |
^ self |
|
1641 |
newWithLabel:(aClass name , '-' , 'full protocol') |
|
1642 |
setupSelector:#setupForFullClassProtocol: |
|
1643 |
arg:aClass |
|
1644 |
||
1645 |
" |
|
1646 |
SystemBrowser browseFullClassProtocol:Number |
|
1647 |
" |
|
1648 |
! |
|
36 | 1649 |
|
203 | 1650 |
browseFullClasses |
1651 |
"launch a browser showing all methods at once" |
|
1652 |
||
1653 |
^ self |
|
1654 |
newWithLabel:'Full Class Browser' |
|
1655 |
setupBlock:[:newBrowser | newBrowser setupForFullClass] |
|
36 | 1656 |
|
203 | 1657 |
"SystemBrowser browseFullClasses" |
1658 |
! |
|
1659 |
||
1660 |
browseInstMethodsFrom:aClass where:aBlock title:title |
|
1661 |
"launch a browser for all instance methods in aClass and all subclasses |
|
1662 |
where aBlock evaluates to true" |
|
36 | 1663 |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1664 |
^ self |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1665 |
browseMethodsIn:(aClass withAllSubclasses) |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1666 |
inst:true |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1667 |
class:false |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1668 |
where:aBlock |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1669 |
title:title |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1670 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1671 |
"Modified: 24.1.1997 / 19:44:45 / cg" |
203 | 1672 |
! |
1673 |
||
1674 |
browseInstMethodsIn:aCollectionOfClasses where:aBlock title:title |
|
1675 |
"launch a browser for all instance methods of all classes in |
|
1676 |
aCollectionOfClasses where aBlock evaluates to true" |
|
1677 |
||
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1678 |
^ self |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1679 |
browseMethodsIn:aCollectionOfClasses |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1680 |
inst:true class:false |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1681 |
where:aBlock title:title |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1682 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1683 |
"Modified: 24.1.1997 / 19:43:41 / cg" |
203 | 1684 |
! |
36 | 1685 |
|
203 | 1686 |
browseInstMethodsOf:aClass where:aBlock title:title |
1687 |
"launch a browser for all instance methods in aClass |
|
1688 |
where aBlock evaluates to true" |
|
1689 |
||
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1690 |
^ self |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1691 |
browseMethodsIn:(Array with:aClass) |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1692 |
inst:true |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1693 |
class:false |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1694 |
where:aBlock title:title |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1695 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1696 |
"Modified: 24.1.1997 / 19:43:50 / cg" |
203 | 1697 |
! |
1698 |
||
1699 |
browseMethodCategory:aCategory |
|
1700 |
"launch a browser for all methods where category = aCategory" |
|
1701 |
||
1702 |
|searchBlock| |
|
1703 |
||
1704 |
aCategory includesMatchCharacters ifTrue:[ |
|
1705 |
searchBlock := [:c :m :s | aCategory match:m category]. |
|
53 | 1706 |
] ifFalse:[ |
203 | 1707 |
searchBlock := [:c :m :s | m category = aCategory] |
53 | 1708 |
]. |
1709 |
||
203 | 1710 |
self browseMethodsWhere:searchBlock title:('all methods with category of ' , aCategory) |
1711 |
||
1712 |
" |
|
1713 |
SystemBrowser browseMethodCategory:'printing & storing' |
|
1714 |
SystemBrowser browseMethodCategory:'print*' |
|
1715 |
" |
|
1716 |
! |
|
1717 |
||
1718 |
browseMethods:aList title:aString |
|
1719 |
"launch a browser for an explicit list of class/selectors. |
|
279
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1720 |
Each entry in the list can be either a method, or a string |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1721 |
consisting of the classes name and the selector, separated by spaces. |
634
24a678f81829
Change the name of a classes Metaclass from e.g. "SmallIntegerclass" to
Stefan Vogel <sv@exept.de>
parents:
620
diff
changeset
|
1722 |
For class methods, the string ' class' must be appended to the classname." |
279
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1723 |
|
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1724 |
|l| |
203 | 1725 |
|
1726 |
(aList size == 0) ifTrue:[ |
|
279
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1727 |
self showNoneFound:aString. |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1728 |
^ nil |
203 | 1729 |
]. |
279
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1730 |
l := aList asOrderedCollection. |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1731 |
l := l collect:[:entry | |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1732 |
|who| |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1733 |
|
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1734 |
entry isString ifTrue:[ |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1735 |
entry |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1736 |
] ifFalse:[ |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1737 |
who := entry who. |
1031 | 1738 |
who isNil ifTrue:[ |
1739 |
'??? unbound' |
|
1740 |
] ifFalse:[ |
|
1741 |
(who methodClass) name |
|
1742 |
, ' ' |
|
1743 |
, (entry printStringForBrowserWithSelector:(who methodSelector)) |
|
1744 |
] |
|
279
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1745 |
] |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1746 |
]. |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1747 |
|
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1748 |
l sort. |
203 | 1749 |
^ self |
279
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1750 |
newWithLabel:aString |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1751 |
setupSelector:#setupForList: |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1752 |
arg:l |
53 | 1753 |
|
203 | 1754 |
" |
1755 |
SystemBrowser |
|
279
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1756 |
browseMethods:#('Object printOn:' 'Collection add:') |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1757 |
title:'some methods' |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1758 |
|
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1759 |
SystemBrowser |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1760 |
browseMethods:#('Behavior new:' 'Setclass new:') |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1761 |
title:'some new: methods' |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1762 |
|
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1763 |
SystemBrowser |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1764 |
browseMethods:(Array with:(Object compiledMethodAt:#printOn:) |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1765 |
with:(Collection compiledMethodAt:#add:) |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1766 |
with:(Object class compiledMethodAt:#initialize)) |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1767 |
title:'some methods' |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1768 |
|
203 | 1769 |
" |
279
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
1770 |
|
634
24a678f81829
Change the name of a classes Metaclass from e.g. "SmallIntegerclass" to
Stefan Vogel <sv@exept.de>
parents:
620
diff
changeset
|
1771 |
"Modified: 17.6.1996 / 17:07:46 / stefan" |
825
42afde0ee738
use new Method>>who interface
Claus Gittinger <cg@exept.de>
parents:
820
diff
changeset
|
1772 |
"Modified: 1.11.1996 / 16:30:17 / cg" |
203 | 1773 |
! |
53 | 1774 |
|
203 | 1775 |
browseMethodsFrom:aClass where:aBlock title:title |
1776 |
"launch a browser for all instance- and classmethods in aClass |
|
1777 |
and all its subclasses where aBlock evaluates to true. |
|
1778 |
The block is called with 3 arguments, class, method and seelctor." |
|
1779 |
||
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1780 |
^ self |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1781 |
browseMethodsIn:(aClass withAllSubclasses) |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1782 |
where:aBlock |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1783 |
title:title |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1784 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1785 |
"Modified: 24.1.1997 / 19:44:00 / cg" |
203 | 1786 |
! |
1787 |
||
1788 |
browseMethodsIn:aCollectionOfClasses inst:wantInst class:wantClass where:aBlock title:title |
|
1789 |
"launch a browser for all instance- (if wantInst is true) and/or |
|
1790 |
classmethods (if wantClass is true) from classes in aCollectionOfClasses, |
|
1791 |
where aBlock evaluates to true. |
|
270 | 1792 |
The block is called with 3 arguments, class, method and selector." |
203 | 1793 |
|
1794 |
|list| |
|
53 | 1795 |
|
1796 |
" |
|
203 | 1797 |
since this may take a long time, lower my priority ... |
53 | 1798 |
" |
203 | 1799 |
Processor activeProcess withLowerPriorityDo:[ |
270 | 1800 |
|checkedClasses checkBlock| |
75 | 1801 |
|
270 | 1802 |
checkedClasses := IdentitySet new. |
1803 |
list := OrderedCollection new. |
|
203 | 1804 |
|
270 | 1805 |
checkBlock := [:cls | |
1806 |
(checkedClasses includes:cls) ifFalse:[ |
|
435 | 1807 |
cls isObsolete ifTrue:[ |
550 | 1808 |
Transcript showCR:'skipping obsolete class: ' , cls displayString |
435 | 1809 |
] ifFalse:[ |
620
3ce270dbff3b
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
588
diff
changeset
|
1810 |
cls methodDictionary keysAndValuesDo:[:sel :method | |
436 | 1811 |
(aBlock value:cls value:method value:sel) ifTrue:[ |
675
57cc7dc74d67
show privacy in senders/implementors list;
Claus Gittinger <cg@exept.de>
parents:
666
diff
changeset
|
1812 |
list add:method "/ (cls name , ' ' , sel) |
435 | 1813 |
] |
1814 |
]. |
|
1815 |
checkedClasses add:cls. |
|
1816 |
] |
|
270 | 1817 |
] |
1818 |
]. |
|
203 | 1819 |
|
270 | 1820 |
aCollectionOfClasses do:[:aClass | |
1036 | 1821 |
aClass isObsolete ifFalse:[ |
1822 |
" |
|
1823 |
output disabled - it slows down things too much (when searching for |
|
1824 |
implementors or senders) |
|
1825 |
" |
|
1826 |
wantInst ifTrue:[ |
|
550 | 1827 |
"/ Transcript show:'searching '; show:aClass name; showCR:' ...'; endEntry. |
1036 | 1828 |
checkBlock value:aClass |
1829 |
]. |
|
1830 |
wantClass ifTrue:[ |
|
550 | 1831 |
"/ Transcript show:'searching '; show:aClass class name; showCR:' ...'; endEntry. |
1036 | 1832 |
checkBlock value:(aClass class) |
1833 |
]. |
|
1834 |
Processor yield |
|
1835 |
] |
|
270 | 1836 |
] |
203 | 1837 |
]. |
1838 |
^ self browseMethods:list title:title |
|
270 | 1839 |
|
1840 |
"Created: 10.12.1995 / 15:34:57 / cg" |
|
620
3ce270dbff3b
Use methodDictionary instead of selector/method arrays.
Stefan Vogel <sv@exept.de>
parents:
588
diff
changeset
|
1841 |
"Modified: 7.6.1996 / 08:47:54 / stefan" |
675
57cc7dc74d67
show privacy in senders/implementors list;
Claus Gittinger <cg@exept.de>
parents:
666
diff
changeset
|
1842 |
"Modified: 15.7.1996 / 11:48:10 / cg" |
53 | 1843 |
! |
1844 |
||
203 | 1845 |
browseMethodsIn:aCollectionOfClasses where:aBlock title:title |
1846 |
"launch a browser for all instance- and classmethods from |
|
1847 |
all classes in aCollectionOfClasses where aBlock evaluates to true. |
|
1848 |
The block is called with 3 arguments, class, method and seelctor." |
|
53 | 1849 |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1850 |
^ self |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1851 |
browseMethodsIn:aCollectionOfClasses |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1852 |
inst:true |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1853 |
class:true |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1854 |
where:aBlock |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1855 |
title:title |
75 | 1856 |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1857 |
"Modified: 24.1.1997 / 19:44:17 / cg" |
36 | 1858 |
! |
1859 |
||
203 | 1860 |
browseMethodsOf:aClass where:aBlock title:title |
1861 |
"launch a browser for all instance- and classmethods in aClass |
|
1862 |
where aBlock evaluates to true. |
|
1863 |
The block is called with 3 arguments, class, method and seelctor." |
|
93 | 1864 |
|
203 | 1865 |
^ self browseMethodsIn:(Array with:aClass) where:aBlock title:title |
93 | 1866 |
! |
1867 |
||
203 | 1868 |
browseMethodsWhere:aBlock title:title |
1869 |
"launch a browser for all methods where aBlock returns true. |
|
1870 |
The block is called with 3 arguments, class, method and seelctor." |
|
1871 |
||
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1872 |
^ self |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1873 |
browseMethodsIn:(Smalltalk allClasses) |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1874 |
where:aBlock |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1875 |
title:title |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1876 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1877 |
"Modified: 24.1.1997 / 19:44:30 / cg" |
203 | 1878 |
! ! |
93 | 1879 |
|
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1880 |
!SystemBrowser class methodsFor:'startup with query'! |
203 | 1881 |
|
1882 |
askThenBrowseClass |
|
1883 |
self getClassThenPerform:#browseClass: |
|
1884 |
||
1885 |
" |
|
1886 |
SystemBrowser askThenBrowseClass |
|
1887 |
" |
|
93 | 1888 |
! |
1889 |
||
203 | 1890 |
askThenBrowseClassHierarchy |
1891 |
self getClassThenPerform:#browseClassHierarchy: |
|
36 | 1892 |
|
203 | 1893 |
" |
1894 |
SystemBrowser askThenBrowseClassHierarchy |
|
1895 |
" |
|
36 | 1896 |
! |
1897 |
||
203 | 1898 |
askThenBrowseFullClassProtocol |
1899 |
self getClassThenPerform:#browseFullClassProtocol: |
|
36 | 1900 |
|
203 | 1901 |
" |
1902 |
SystemBrowser askThenBrowseFullClassProtocol |
|
1903 |
" |
|
52 | 1904 |
! |
1905 |
||
203 | 1906 |
getClassThenPerform:aSelector |
1907 |
|enterBox| |
|
52 | 1908 |
|
203 | 1909 |
enterBox := EnterBox title:(self classResources at:'Browse which class:') withCRs. |
254 | 1910 |
enterBox okText:(ClassResources at:'browse'). |
203 | 1911 |
enterBox entryCompletionBlock:[:contents | |
1912 |
|s what m| |
|
52 | 1913 |
|
203 | 1914 |
s := contents withoutSpaces. |
1915 |
what := Smalltalk classnameCompletion:s. |
|
1916 |
enterBox contents:what first. |
|
1917 |
]. |
|
1918 |
enterBox action:[:className | |
|
1919 |
|cls| |
|
52 | 1920 |
|
203 | 1921 |
cls := Smalltalk classNamed:className. |
1922 |
cls isNil ifTrue:[ |
|
254 | 1923 |
self warn:(ClassResources at:'no such class'). |
203 | 1924 |
] ifFalse:[ |
1925 |
self perform:aSelector with:cls |
|
1926 |
] |
|
1927 |
]. |
|
1928 |
enterBox showAtPointer |
|
75 | 1929 |
|
203 | 1930 |
" |
1931 |
SystemBrowser getClassThenPerform:#browseClass: |
|
1932 |
" |
|
36 | 1933 |
! ! |
1934 |
||
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1935 |
!SystemBrowser class methodsFor:'documentation'! |
93 | 1936 |
|
203 | 1937 |
version |
1367 | 1938 |
^ '$Header: /cvs/stx/stx/libtool/SystemBrowser.st,v 1.82 1997-11-02 18:29:16 cg Exp $' |
36 | 1939 |
! ! |
203 | 1940 |
SystemBrowser initialize! |