author | Claus Gittinger <cg@exept.de> |
Tue, 22 Aug 2000 13:27:40 +0200 | |
changeset 2729 | 9af04074a4bb |
parent 2728 | 5ba2a9de7472 |
child 2736 | 5b585170e14a |
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 |
||
2655
9e90bbd1eb18
apropos search is now: selectors containing
Claus Gittinger <cg@exept.de>
parents:
2642
diff
changeset
|
13 |
"{ Package: 'stx:libtool' }" |
9e90bbd1eb18
apropos search is now: selectors containing
Claus Gittinger <cg@exept.de>
parents:
2642
diff
changeset
|
14 |
|
85 | 15 |
ApplicationModel subclass:#SystemBrowser |
2631 | 16 |
instanceVariableNames:'' |
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 |
||
2631 | 94 |
self == SystemBrowser ifFalse:[ |
95 |
^ super open |
|
96 |
]. |
|
97 |
||
105 | 98 |
^ self openOnDevice:(Screen current) |
75 | 99 |
|
93 | 100 |
" |
101 |
SystemBrowser open |
|
102 |
" |
|
194 | 103 |
! |
104 |
||
523 | 105 |
openInClass:aClass |
106 |
"launch a standard browser which immediately switches |
|
107 |
to aClass" |
|
108 |
||
109 |
^ self openInClass:aClass selector:nil |
|
110 |
||
111 |
" |
|
112 |
SystemBrowser openInClass:Object |
|
113 |
" |
|
114 |
||
115 |
"Created: 30.4.1996 / 14:43:45 / cg" |
|
116 |
! |
|
117 |
||
194 | 118 |
openInClass:aClass selector:aSelector |
119 |
"launch a standard browser which immediately switches |
|
120 |
to aClass>>aSelector." |
|
121 |
||
122 |
|brwsr cls| |
|
123 |
||
124 |
brwsr := self openOnDevice:(Screen current). |
|
125 |
brwsr waitUntilVisible. |
|
1561 | 126 |
|
194 | 127 |
cls := aClass. |
128 |
cls notNil ifTrue:[ |
|
1561 | 129 |
cls isMeta ifTrue:[ |
130 |
cls := aClass soleInstance |
|
131 |
]. |
|
132 |
aClass isMeta ifTrue:[ |
|
133 |
brwsr instanceProtocol:false |
|
134 |
]. |
|
1931
03de5c5f4402
care for javaClass in #openInClass:selector:
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
135 |
aClass isJavaClass ifTrue:[ |
03de5c5f4402
care for javaClass in #openInClass:selector:
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
136 |
brwsr switchToClassNamed:aClass fullName. |
03de5c5f4402
care for javaClass in #openInClass:selector:
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
137 |
] ifFalse:[ |
03de5c5f4402
care for javaClass in #openInClass:selector:
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
138 |
brwsr switchToClassNamed:aClass name. |
03de5c5f4402
care for javaClass in #openInClass:selector:
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
139 |
]. |
1561 | 140 |
"/ brwsr updateClassCategoryList. |
1681 | 141 |
|
1561 | 142 |
"/ brwsr updateMethodCategoryList. |
1681 | 143 |
"/ brwsr updateVariableList. |
144 |
brwsr classSelectionChanged. |
|
1561 | 145 |
aSelector notNil ifTrue:[ |
146 |
brwsr switchToMethodNamed:aSelector. |
|
147 |
] |
|
194 | 148 |
]. |
149 |
^ brwsr |
|
150 |
||
151 |
" |
|
152 |
SystemBrowser openInClass:Object selector:#at:put: |
|
153 |
SystemBrowser openInClass:Object selector:nil |
|
154 |
SystemBrowser openInClass:nil selector:nil |
|
155 |
" |
|
156 |
||
1561 | 157 |
"Created: / 22.11.1995 / 21:04:50 / cg" |
1931
03de5c5f4402
care for javaClass in #openInClass:selector:
Claus Gittinger <cg@exept.de>
parents:
1919
diff
changeset
|
158 |
"Modified: / 14.10.1998 / 15:31:52 / cg" |
203 | 159 |
! |
160 |
||
161 |
openOnDevice:aDisplay |
|
162 |
"launch a standard browser on another display." |
|
163 |
||
2631 | 164 |
self == SystemBrowser ifFalse:[ |
165 |
^ super openOnDevice:aDisplay |
|
166 |
]. |
|
167 |
||
203 | 168 |
^ self newWithLabel:(self classResources string:'System Browser') |
2631 | 169 |
setupBlock:[:browser | browser setupForAll] |
170 |
onDevice:aDisplay |
|
203 | 171 |
|
172 |
"|d| |
|
173 |
||
174 |
d := XWorkstation new initializeFor:'porty:0'. |
|
175 |
d startDispatch. |
|
176 |
SystemBrowser openOnDevice:d |
|
177 |
" |
|
36 | 178 |
! ! |
179 |
||
2551 | 180 |
!SystemBrowser class methodsFor:'Compatibility - ST80'! |
1356 | 181 |
|
182 |
newOnClass:aClass |
|
183 |
^ self browseClass:aClass |
|
184 |
||
185 |
"Created: / 27.10.1997 / 20:10:39 / cg" |
|
186 |
! ! |
|
187 |
||
2692 | 188 |
!SystemBrowser class methodsFor:'image specs'! |
189 |
||
190 |
defaultIcon |
|
191 |
"This resource specification was automatically generated |
|
192 |
by the ImageEditor of ST/X." |
|
193 |
||
194 |
"Do not manually edit this!! If it is corrupted, |
|
195 |
the ImageEditor may not be able to read the specification." |
|
196 |
||
197 |
" |
|
198 |
self defaultIcon inspect |
|
199 |
ImageEditor openOnClass:self andSelector:#defaultIcon |
|
200 |
" |
|
201 |
||
202 |
<resource: #image> |
|
203 |
||
204 |
^Icon |
|
205 |
constantNamed:#'SystemBrowserIcon' |
|
206 |
ifAbsentPut:[(Depth4Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@ADQDQDQG0@@@@@@@@@@D"H"H"H.@@@@@@@@@@@RH"H"H"8@@@@@@@@@@O;.;.;.; @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@8@@@@@@@@@@@@@@@@@C @@@@@@@@@@@@@@@@@N@@@@@@@@@@@@@@@@@@@@@@@@DQDQDQG0@@@@@P;.;.@SL3L3L>@@@@@@@@@@@O;.;.;.8@@@@@8@@@@@@@@@@@@@@@@@C @@@@@@@@@@@@@@@@@N@@@@@@@@@@@@@@@@@@@@@@@@DQDQDQG0@@@@@P;.;.@VY&Y&Y.@@@@@@@@@@@O;.;.;.8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@8@@@@N@NC @@8@@@C @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@8@@@@@@@@@8@C @@@@8b') ; colorMapFromArray:#[0 0 0 255 255 255 255 0 0 0 255 0 0 0 255 0 255 255 255 255 0 255 0 255 127 0 0 0 127 0 0 0 127 0 127 127 127 127 0 127 0 127 127 127 127 170 170 170]; mask:((Depth1Image new) width: 28; height: 28; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??0@@O?<@@C??@@@??0@@O?<@@C??@@@@ @@@@H@@@@B@?? A0O?8@_??>@G@?? @ O?8@H@@@@B@?? A0O?8@_??>@G@?? @@O?8@@@@@@@@@@@9O\7\IRTQDBD%DQ@!!OH''HHRQEABT$QPP99]7\@@a') ; yourself); yourself] |
|
207 |
! ! |
|
208 |
||
1203 | 209 |
!SystemBrowser class methodsFor:'interface specs'! |
210 |
||
1367 | 211 |
metaSpec |
212 |
"UIPainter new openOnClass: self andSelector: #metaSpec" |
|
213 |
||
214 |
<resource: #canvas> |
|
215 |
^#(#FullSpec |
|
216 |
#window: |
|
217 |
#(#WindowSpec |
|
218 |
#label: 'Unlabeled Canvas' |
|
219 |
#bounds: #(#Rectangle 27 249 325 334 ) ) |
|
220 |
#component: |
|
221 |
#(#SpecCollection |
|
222 |
#collection: #( |
|
223 |
#(#RadioButtonSpec |
|
224 |
#layout: #(#LayoutFrame 0 0 4 0 -1 0.575 20 0 ) |
|
225 |
#name: #instanceSwitch |
|
226 |
#model: #metaHolder |
|
227 |
#callbacksSpec: |
|
228 |
#(#UIEventCallbackSubSpec |
|
229 |
#requestValueChangeSelector: #changeRequest ) |
|
230 |
#label: 'instance' |
|
231 |
#select: false ) |
|
232 |
#(#RadioButtonSpec |
|
233 |
#layout: #(#LayoutFrame 1 0.575 4 0 -1 1 20 0 ) |
|
234 |
#name: #classSwitch |
|
235 |
#model: #metaHolder |
|
236 |
#callbacksSpec: |
|
237 |
#(#UIEventCallbackSubSpec |
|
238 |
#requestValueChangeSelector: #changeRequest ) |
|
239 |
#label: 'class' |
|
240 |
#select: true ) ) ) ) |
|
241 |
||
242 |
"Created: / 30.10.1997 / 19:07:29 / cg" |
|
243 |
! |
|
244 |
||
1203 | 245 |
methodMoveDialogSpec |
246 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
247 |
||
248 |
"do not manually edit this - the painter/builder may not be able to |
|
249 |
handle the specification if its corrupted." |
|
250 |
||
251 |
" |
|
252 |
UIPainter new openOnClass:SystemBrowser andSelector:#methodMoveDialogSpec |
|
253 |
SystemBrowser new openDialogInterface:#methodMoveDialogSpec |
|
254 |
" |
|
255 |
||
256 |
<resource: #canvas> |
|
257 |
||
258 |
^ |
|
259 |
||
260 |
#(#FullSpec |
|
261 |
#'window:' |
|
262 |
#(#WindowSpec |
|
263 |
#'name:' 'uIPainterView' |
|
264 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
265 |
#'label:' 'move method' |
|
266 |
#'bounds:' #(#Rectangle 0 0 279 118) |
|
267 |
) |
|
268 |
#'component:' |
|
269 |
#(#SpecCollection |
|
270 |
#'collection:' |
|
271 |
#( |
|
272 |
#(#HorizontalPanelViewSpec |
|
273 |
#'name:' 'horizontalPanelView' |
|
274 |
#'layout:' #(#LayoutFrame 0 0.0 -35 1.0 0 1.0 -2 1.0) |
|
275 |
#'component:' |
|
276 |
#(#SpecCollection |
|
277 |
#'collection:' |
|
278 |
#( |
|
279 |
#(#ActionButtonSpec |
|
280 |
#'name:' 'actionButton2' |
|
281 |
#'label:' 'cancel' |
|
282 |
#'tabable:' true |
|
283 |
#'model:' #cancel |
|
284 |
#'extent:' #(#Point 133 27) |
|
285 |
) |
|
286 |
#(#ActionButtonSpec |
|
287 |
#'name:' 'actionButton1' |
|
288 |
#'label:' 'move' |
|
289 |
#'tabable:' true |
|
290 |
#'isDefault:' true |
|
291 |
#'model:' #accept |
|
292 |
#'extent:' #(#Point 134 27) |
|
293 |
) |
|
294 |
) |
|
295 |
) |
|
296 |
#'level:' 0 |
|
297 |
#'horizontalLayout:' #fitSpace |
|
298 |
#'verticalLayout:' #center |
|
299 |
#'horizontalSpace:' 4 |
|
300 |
#'verticalSpace:' 4 |
|
301 |
) |
|
302 |
#(#LabelSpec |
|
303 |
#'name:' 'label' |
|
304 |
#'layout:' #(#LayoutFrame 2 0 2 0 -2 1.0 25 0) |
|
305 |
#'label:' 'move current method to which class:' |
|
306 |
#'style:' |
|
307 |
#(#Font |
|
308 |
'helvetica' 'medium' |
|
309 |
'roman' 12 |
|
310 |
) |
|
311 |
#'foregroundColor:' #(#Color 0.0 0.0 0.0) |
|
312 |
#'backgroundColor:' #(#Color 66.9993 66.9993 66.9993) |
|
313 |
#'adjust:' #left |
|
314 |
) |
|
315 |
#(#ComboBoxSpec |
|
316 |
#'name:' 'comboBox1' |
|
317 |
#'layout:' #(#LayoutFrame 2 0 29 0 -2 1.0 51 0) |
|
318 |
#'tabable:' true |
|
319 |
#'model:' #className |
|
320 |
#'comboList:' #classList |
|
321 |
) |
|
322 |
) |
|
323 |
) |
|
324 |
) |
|
325 |
||
326 |
"Created: 25.6.1997 / 13:45:20 / cg" |
|
327 |
"Modified: 25.6.1997 / 13:46:44 / cg" |
|
328 |
! ! |
|
329 |
||
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
330 |
!SystemBrowser class methodsFor:'private helpers'! |
36 | 331 |
|
203 | 332 |
showNoneFound |
1620 | 333 |
super warn:(self classResources string:'None found.'). |
203 | 334 |
! |
36 | 335 |
|
203 | 336 |
showNoneFound:what |
1620 | 337 |
|rs| |
338 |
||
339 |
rs := self classResources. |
|
2398 | 340 |
super information:((rs string:what) , (rs string:'...\\... none found.')) withCRs. |
203 | 341 |
! ! |
36 | 342 |
|
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
343 |
!SystemBrowser class methodsFor:'private instance creation'! |
203 | 344 |
|
345 |
newWithLabel:aString setupBlock:aBlock |
|
346 |
"common helper method for all creation methods" |
|
347 |
||
348 |
^ self newWithLabel:aString setupBlock:aBlock onDevice:Screen current |
|
36 | 349 |
! |
350 |
||
203 | 351 |
newWithLabel:aString setupBlock:aBlock onDevice:aWorkstation |
352 |
"common helper method for all creation methods" |
|
36 | 353 |
|
203 | 354 |
|newBrowser| |
45 | 355 |
|
203 | 356 |
newBrowser := BrowserView onDevice:aWorkstation. |
357 |
newBrowser title:aString. |
|
358 |
aBlock value:newBrowser. |
|
45 | 359 |
|
203 | 360 |
newBrowser open. |
361 |
^ newBrowser |
|
362 |
! |
|
45 | 363 |
|
203 | 364 |
newWithLabel:aString setupSelector:aSymbol arg:arg |
365 |
"common helper method for all creation methods" |
|
36 | 366 |
|
203 | 367 |
^ self newWithLabel:aString setupSelector:aSymbol arg:arg onDevice:Screen current |
36 | 368 |
! |
369 |
||
203 | 370 |
newWithLabel:aString setupSelector:aSymbol arg:arg onDevice:aWorkstation |
371 |
"common helper method for all creation methods" |
|
372 |
||
373 |
|newBrowser| |
|
52 | 374 |
|
203 | 375 |
newBrowser := BrowserView onDevice:aWorkstation. |
376 |
newBrowser title:aString. |
|
377 |
newBrowser perform:aSymbol with:arg. |
|
378 |
newBrowser open. |
|
379 |
^ newBrowser |
|
380 |
! ! |
|
381 |
||
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
382 |
!SystemBrowser class methodsFor:'special search startup'! |
203 | 383 |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
384 |
allCallsOn:aSelectorString |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
385 |
"return a collection of methods which send aSelector." |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
386 |
|
2623
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
387 |
^ self |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
388 |
allCallsOn:aSelectorString |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
389 |
in:(Smalltalk allClasses) |
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
390 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
391 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
392 |
SystemBrowser allCallsOn:#at:put: |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
393 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
394 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
395 |
"Created: 24.1.1997 / 19:42:57 / cg" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
396 |
! |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
397 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
398 |
allCallsOn:aSelectorString in:aCollectionOfClasses |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
399 |
"return a collection of methods which send aSelector. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
400 |
Methods from classes in aCollectionOfClasses are searched only." |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
401 |
|
2623
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
402 |
^ self |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
403 |
allCallsOn:aSelectorString |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
404 |
in:aCollectionOfClasses |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
405 |
ignoreCase:false |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
406 |
|
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
407 |
! |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
408 |
|
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
409 |
allCallsOn:aSelectorString in:aCollectionOfClasses ignoreCase:ignoreCase |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
410 |
"return a collection of methods which send aSelector. |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
411 |
Methods from classes in aCollectionOfClasses are searched only." |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
412 |
|
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
413 |
|sel searchBlock lcString| |
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 |
((aSelectorString ~= '*') |
2623
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
416 |
and:[(aSelectorString includesMatchCharacters or:[ignoreCase])]) ifTrue:[ |
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
417 |
"/ a matchString - need string matching procedure |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
418 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
419 |
searchBlock := [:class :method :s | |
2208
e077aa992f7a
check for nil source in #allCallsOn: (for methods where src in not available)
Claus Gittinger <cg@exept.de>
parents:
1937
diff
changeset
|
420 |
|src| |
e077aa992f7a
check for nil source in #allCallsOn: (for methods where src in not available)
Claus Gittinger <cg@exept.de>
parents:
1937
diff
changeset
|
421 |
|
2623
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
422 |
ignoreCase ifTrue:[ |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
423 |
lcString := aSelectorString asLowercase. |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
424 |
] ifFalse:[ |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
425 |
lcString := aSelectorString. |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
426 |
]. |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
427 |
|
1059
918deae4d1c7
care for lazy methods when searching senders
Claus Gittinger <cg@exept.de>
parents:
1036
diff
changeset
|
428 |
method isLazyMethod ifTrue:[ |
2208
e077aa992f7a
check for nil source in #allCallsOn: (for methods where src in not available)
Claus Gittinger <cg@exept.de>
parents:
1937
diff
changeset
|
429 |
src := method source. |
e077aa992f7a
check for nil source in #allCallsOn: (for methods where src in not available)
Claus Gittinger <cg@exept.de>
parents:
1937
diff
changeset
|
430 |
(src notNil and:[src includesMatchString:aSelectorString]) ifTrue:[ |
1143
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
431 |
method makeRealMethod. |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
432 |
(method literalsDetect:[:aLiteral| |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
433 |
(aLiteral isMemberOf:Symbol) |
2623
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
434 |
and:[(ignoreCase and:[lcString match:aLiteral asLowercase]) |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
435 |
or:[ignoreCase not and:[lcString match:aLiteral]]] |
1143
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
436 |
] ifNone:nil) notNil |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
437 |
] ifFalse:[ |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
438 |
false |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
439 |
] |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
440 |
] ifFalse:[ |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
441 |
(method literalsDetect:[:aLiteral| |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
442 |
(aLiteral isMemberOf:Symbol) |
2623
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
443 |
and:[(ignoreCase and:[lcString match:aLiteral asLowercase]) |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
444 |
or:[ignoreCase not and:[lcString match:aLiteral]]] |
1143
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
445 |
] ifNone:nil) notNil |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
446 |
] |
996
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 |
] ifFalse:[ |
1018 | 449 |
(aSelectorString = '*') ifTrue:[ |
450 |
searchBlock := [:class :method :s | true]. |
|
451 |
] ifFalse:[ |
|
452 |
"/ no matchString - can do it much faster |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
453 |
|
1018 | 454 |
sel := aSelectorString asSymbolIfInterned. |
455 |
sel isNil ifTrue:[ |
|
456 |
^ nil "/ none |
|
457 |
]. |
|
2208
e077aa992f7a
check for nil source in #allCallsOn: (for methods where src in not available)
Claus Gittinger <cg@exept.de>
parents:
1937
diff
changeset
|
458 |
searchBlock := [:class :method :s | |
e077aa992f7a
check for nil source in #allCallsOn: (for methods where src in not available)
Claus Gittinger <cg@exept.de>
parents:
1937
diff
changeset
|
459 |
|src| |
e077aa992f7a
check for nil source in #allCallsOn: (for methods where src in not available)
Claus Gittinger <cg@exept.de>
parents:
1937
diff
changeset
|
460 |
|
1059
918deae4d1c7
care for lazy methods when searching senders
Claus Gittinger <cg@exept.de>
parents:
1036
diff
changeset
|
461 |
method isLazyMethod ifTrue:[ |
2208
e077aa992f7a
check for nil source in #allCallsOn: (for methods where src in not available)
Claus Gittinger <cg@exept.de>
parents:
1937
diff
changeset
|
462 |
src := method source. |
e077aa992f7a
check for nil source in #allCallsOn: (for methods where src in not available)
Claus Gittinger <cg@exept.de>
parents:
1937
diff
changeset
|
463 |
(src notNil and:[src includesString:sel]) ifTrue:[ |
1143
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
464 |
method makeRealMethod. |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
465 |
method sends:sel. |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
466 |
] ifFalse:[ |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
467 |
false |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
468 |
] |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
469 |
] ifFalse:[ |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
470 |
method sends:sel |
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
471 |
] |
1059
918deae4d1c7
care for lazy methods when searching senders
Claus Gittinger <cg@exept.de>
parents:
1036
diff
changeset
|
472 |
]. |
1018 | 473 |
] |
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
474 |
]. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
475 |
^ self allMethodsIn:aCollectionOfClasses where:searchBlock |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
476 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
477 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
478 |
SystemBrowser allCallsOn:#at:put: in:(Smalltalk allClasses) |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
479 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
480 |
|
1143
0707461e582a
avoid compilation of lazy methods when searching for senders
Claus Gittinger <cg@exept.de>
parents:
1059
diff
changeset
|
481 |
"Modified: 18.4.1997 / 10:32:50 / cg" |
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
482 |
! |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
483 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
484 |
allMethodsIn:aCollectionOfClasses inst:wantInst class:wantClass where:aBlock |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
485 |
"return a collection of methods which pass the given test. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
486 |
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
|
487 |
considered. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
488 |
Only classes in aCollectionOfClasses are inspected in the search" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
489 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
490 |
|list| |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
491 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
492 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
493 |
since this may take a long time, lower my priority ... |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
494 |
" |
2295
4e05198e7dd8
execute BG tasks at a prio range, to ensure progress.
Claus Gittinger <cg@exept.de>
parents:
2208
diff
changeset
|
495 |
Processor activeProcess |
4e05198e7dd8
execute BG tasks at a prio range, to ensure progress.
Claus Gittinger <cg@exept.de>
parents:
2208
diff
changeset
|
496 |
withPriority:Processor activePriority-1 to:Processor activePriority |
4e05198e7dd8
execute BG tasks at a prio range, to ensure progress.
Claus Gittinger <cg@exept.de>
parents:
2208
diff
changeset
|
497 |
do:[ |
2484
afd8d8dbd9e2
care vor methods being found in multiple classes
Claus Gittinger <cg@exept.de>
parents:
2439
diff
changeset
|
498 |
|checkedClasses checkBlock detectedMethods| |
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
499 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
500 |
checkedClasses := IdentitySet new. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
501 |
list := OrderedCollection new. |
2484
afd8d8dbd9e2
care vor methods being found in multiple classes
Claus Gittinger <cg@exept.de>
parents:
2439
diff
changeset
|
502 |
detectedMethods := IdentitySet new. |
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
503 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
504 |
checkBlock := [:cls | |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
505 |
(checkedClasses includes:cls) ifFalse:[ |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
506 |
cls isObsolete ifTrue:[ |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
507 |
Transcript showCR:'skipping obsolete class: ' , cls displayString |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
508 |
] ifFalse:[ |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
509 |
cls methodDictionary keysAndValuesDo:[:sel :method | |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
510 |
(aBlock value:cls value:method value:sel) ifTrue:[ |
2484
afd8d8dbd9e2
care vor methods being found in multiple classes
Claus Gittinger <cg@exept.de>
parents:
2439
diff
changeset
|
511 |
"/ care for methods being in multiple classes (should not happen) |
afd8d8dbd9e2
care vor methods being found in multiple classes
Claus Gittinger <cg@exept.de>
parents:
2439
diff
changeset
|
512 |
(detectedMethods includes:method) ifFalse:[ |
afd8d8dbd9e2
care vor methods being found in multiple classes
Claus Gittinger <cg@exept.de>
parents:
2439
diff
changeset
|
513 |
list add:method. |
afd8d8dbd9e2
care vor methods being found in multiple classes
Claus Gittinger <cg@exept.de>
parents:
2439
diff
changeset
|
514 |
detectedMethods add:method |
afd8d8dbd9e2
care vor methods being found in multiple classes
Claus Gittinger <cg@exept.de>
parents:
2439
diff
changeset
|
515 |
] |
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
516 |
] |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
517 |
]. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
518 |
checkedClasses add:cls. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
519 |
] |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
520 |
] |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
521 |
]. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
522 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
523 |
aCollectionOfClasses do:[:aClass | |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
524 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
525 |
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
|
526 |
implementors or senders) |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
527 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
528 |
wantInst ifTrue:[ |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
529 |
"/ Transcript show:'searching '; show:aClass name; showCR:' ...'; endEntry. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
530 |
checkBlock value:aClass |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
531 |
]. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
532 |
wantClass ifTrue:[ |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
533 |
"/ Transcript show:'searching '; show:aClass class name; showCR:' ...'; endEntry. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
534 |
checkBlock value:(aClass class) |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
535 |
]. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
536 |
Processor yield |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
537 |
] |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
538 |
]. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
539 |
^ list |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
540 |
|
2484
afd8d8dbd9e2
care vor methods being found in multiple classes
Claus Gittinger <cg@exept.de>
parents:
2439
diff
changeset
|
541 |
"Created: / 24.1.1997 / 19:41:12 / cg" |
afd8d8dbd9e2
care vor methods being found in multiple classes
Claus Gittinger <cg@exept.de>
parents:
2439
diff
changeset
|
542 |
"Modified: / 14.12.1999 / 14:59:02 / cg" |
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
543 |
! |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
544 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
545 |
allMethodsIn:aCollectionOfClasses where:aBlock |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
546 |
"return a collection of methods which pass the given test. |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
547 |
Only classes in aCollectionOfClasses are inspected in the search" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
548 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
549 |
^ self |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
550 |
allMethodsIn:aCollectionOfClasses |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
551 |
inst:true |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
552 |
class:true |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
553 |
where:aBlock |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
554 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
555 |
"Created: 24.1.1997 / 19:41:49 / cg" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
556 |
! |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
557 |
|
203 | 558 |
aproposSearch:aString |
2655
9e90bbd1eb18
apropos search is now: selectors containing
Claus Gittinger <cg@exept.de>
parents:
2642
diff
changeset
|
559 |
"browse all methods, which have aString in their selector." |
203 | 560 |
|
561 |
^ self aproposSearch:aString in:(Smalltalk allClasses) |
|
75 | 562 |
|
52 | 563 |
! |
564 |
||
203 | 565 |
aproposSearch:aString in:aCollectionOfClasses |
2655
9e90bbd1eb18
apropos search is now: selectors containing
Claus Gittinger <cg@exept.de>
parents:
2642
diff
changeset
|
566 |
"browse all methods, which have aString. |
203 | 567 |
This is relatively slow, since all source must be processed." |
52 | 568 |
|
203 | 569 |
|matchString list s searchBlock browser| |
52 | 570 |
|
203 | 571 |
matchString := '*' , aString , '*'. |
52 | 572 |
|
203 | 573 |
list := OrderedCollection new. |
52 | 574 |
|
203 | 575 |
(aString includesMatchCharacters) ifTrue:[ |
2655
9e90bbd1eb18
apropos search is now: selectors containing
Claus Gittinger <cg@exept.de>
parents:
2642
diff
changeset
|
576 |
s := '*' , aString asLowercase , '*'. |
256 | 577 |
"a matchString" |
578 |
searchBlock := [:text | (text asCollectionOfLinesfindFirst:[:line | s match:line]) ~~ 0]. |
|
203 | 579 |
] ifFalse:[ |
2655
9e90bbd1eb18
apropos search is now: selectors containing
Claus Gittinger <cg@exept.de>
parents:
2642
diff
changeset
|
580 |
searchBlock := [:source | (source findString:aString asLowercase) ~~ 0] |
203 | 581 |
]. |
52 | 582 |
|
203 | 583 |
browser := self browseMethodsIn:aCollectionOfClasses |
256 | 584 |
where:[:class :method :sel | |
585 |
|comment| |
|
52 | 586 |
|
2655
9e90bbd1eb18
apropos search is now: selectors containing
Claus Gittinger <cg@exept.de>
parents:
2642
diff
changeset
|
587 |
(searchBlock value:sel asLowercase) |
256 | 588 |
] |
2729
9af04074a4bb
no direct access to super-class-instvars
Claus Gittinger <cg@exept.de>
parents:
2728
diff
changeset
|
589 |
title:(self classResources string:'selectors containing: %1' with:aString). |
52 | 590 |
|
203 | 591 |
browser notNil ifTrue:[ |
256 | 592 |
browser autoSearch:aString |
203 | 593 |
]. |
594 |
^ browser |
|
52 | 595 |
|
596 |
" |
|
203 | 597 |
SystemBrowser aproposSearch:'append' in:(Collection withAllSubclasses) |
598 |
SystemBrowser aproposSearch:'add' in:(Collection withAllSubclasses) |
|
599 |
SystemBrowser aproposSearch:'sort' in:(Collection withAllSubclasses) |
|
600 |
SystemBrowser aproposSearch:'[Aa]bsent' in:(Collection withAllSubclasses) |
|
52 | 601 |
" |
203 | 602 |
|
256 | 603 |
"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
|
604 |
! |
6f4460d5a09d
added supersend searches; offer comparing the current version with the
Claus Gittinger <cg@exept.de>
parents:
203
diff
changeset
|
605 |
|
203 | 606 |
browseAllCallsOn:aSelectorString |
607 |
"launch a browser for all senders of aSelector" |
|
52 | 608 |
|
2623
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
609 |
^ self |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
610 |
browseAllCallsOn:aSelectorString |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
611 |
in:(Smalltalk allClasses) |
52 | 612 |
|
613 |
" |
|
203 | 614 |
SystemBrowser browseAllCallsOn:#+ |
52 | 615 |
" |
256 | 616 |
|
617 |
"Created: 9.12.1995 / 18:00:41 / cg" |
|
666 | 618 |
"Modified: 10.7.1996 / 10:26:15 / cg" |
619 |
! |
|
620 |
||
621 |
browseAllCallsOn:aSelectorString in:aSetOfClasses |
|
622 |
"launch a browser for all senders of aSelector" |
|
623 |
||
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
624 |
^ self |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
625 |
browseAllCallsOn:aSelectorString |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
626 |
in:aSetOfClasses |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
627 |
title:(self classResources string:'senders of: %1' with:aSelectorString) |
666 | 628 |
|
629 |
" |
|
630 |
SystemBrowser browseAllCallsOn:#+ in:(Number withAllSubclasses) |
|
631 |
" |
|
632 |
||
633 |
"Created: 10.7.1996 / 10:25:49 / cg" |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
634 |
"Modified: 24.1.1997 / 19:49:34 / cg" |
52 | 635 |
! |
636 |
||
2623
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
637 |
browseAllCallsOn:aSelectorString in:aSetOfClasses ignoreCase:ignoreCase |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
638 |
"launch a browser for all senders of aSelector" |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
639 |
|
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
640 |
^ self |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
641 |
browseAllCallsOn:aSelectorString |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
642 |
in:aSetOfClasses |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
643 |
ignoreCase:ignoreCase |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
644 |
title:(self classResources string:'senders of: %1' with:aSelectorString) |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
645 |
|
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
646 |
" |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
647 |
SystemBrowser browseAllCallsOn:#+ in:(Number withAllSubclasses) |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
648 |
" |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
649 |
|
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
650 |
"Created: 10.7.1996 / 10:25:49 / cg" |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
651 |
"Modified: 24.1.1997 / 19:49:34 / cg" |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
652 |
! |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
653 |
|
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
654 |
browseAllCallsOn:aSelectorString in:aCollectionOfClasses ignoreCase:ignoreCase title:title |
52 | 655 |
"launch a browser for all senders of aSelector in aCollectionOfClasses" |
656 |
||
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
657 |
|browser| |
52 | 658 |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
659 |
browser := self |
2623
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
660 |
browseMethods:(self allCallsOn:aSelectorString in:aCollectionOfClasses ignoreCase:ignoreCase) |
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
661 |
title:title. |
52 | 662 |
|
663 |
browser notNil ifTrue:[ |
|
648
6ec086b7972c
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
634
diff
changeset
|
664 |
|s| |
52 | 665 |
|
648
6ec086b7972c
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
634
diff
changeset
|
666 |
" |
6ec086b7972c
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
634
diff
changeset
|
667 |
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
|
668 |
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
|
669 |
" |
6ec086b7972c
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
634
diff
changeset
|
670 |
s := aSelectorString. |
6ec086b7972c
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
634
diff
changeset
|
671 |
(s includes:$:) ifTrue:[ |
6ec086b7972c
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
634
diff
changeset
|
672 |
s := s copyTo:(s indexOf:$:) |
6ec086b7972c
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
634
diff
changeset
|
673 |
]. |
6ec086b7972c
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
634
diff
changeset
|
674 |
browser autoSearch:s |
52 | 675 |
]. |
676 |
^ browser |
|
648
6ec086b7972c
Move method's literals form literalArray to indexed instvars.
Stefan Vogel <sv@exept.de>
parents:
634
diff
changeset
|
677 |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
678 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
679 |
SystemBrowser |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
680 |
browseAllCallsOn:#+ |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
681 |
in:(Number withAllSubclasses) |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
682 |
title:'just a test' |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
683 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
684 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
685 |
"Modified: 24.1.1997 / 19:48:54 / cg" |
52 | 686 |
! |
687 |
||
2623
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
688 |
browseAllCallsOn:aSelectorString in:aCollectionOfClasses title:title |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
689 |
"launch a browser for all senders of aSelector in aCollectionOfClasses" |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
690 |
|
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
691 |
^ self |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
692 |
browseAllCallsOn:aSelectorString |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
693 |
in:aCollectionOfClasses |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
694 |
ignoreCase:false |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
695 |
title:title |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
696 |
|
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
697 |
" |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
698 |
SystemBrowser |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
699 |
browseAllCallsOn:#+ |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
700 |
in:(Number withAllSubclasses) |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
701 |
title:'just a test' |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
702 |
" |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
703 |
|
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
704 |
"Modified: 24.1.1997 / 19:48:54 / cg" |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
705 |
! |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
706 |
|
203 | 707 |
browseCallsOn:aSelectorString under:aClass |
708 |
"launch a browser for all senders of aSelector in aClass and subclasses" |
|
709 |
||
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
710 |
^ self |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
711 |
browseAllCallsOn:aSelectorString |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
712 |
in:(aClass withAllSubclasses) |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
713 |
title:(self classResources |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
714 |
string:'senders of: %1 (in and below %2)' |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
715 |
with:aSelectorString |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
716 |
with:aClass name) |
203 | 717 |
|
718 |
" |
|
256 | 719 |
SystemBrowser browseCallsOn:#+ under:Number |
203 | 720 |
" |
256 | 721 |
|
722 |
"Created: 9.12.1995 / 17:59:57 / cg" |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
723 |
"Modified: 24.1.1997 / 19:50:33 / cg" |
203 | 724 |
! |
725 |
||
726 |
browseClassRefsTo:aString in:aCollectionOfClasses modificationsOnly:modsOnly |
|
727 |
"launch a browser for all methods in aClass where the classVar named |
|
728 |
aString is referenced; if modsOnly is true, browse only methods where the |
|
729 |
classvar is modified" |
|
730 |
||
731 |
^ self browseRefsTo:aString classVars:true in:aCollectionOfClasses modificationsOnly:modsOnly |
|
732 |
! |
|
733 |
||
734 |
browseClassRefsTo:varName in:aCollectionOfClasses modificationsOnly:modsOnly title:title |
|
735 |
"launch a browser for all methods in aCollectionOfClasses, |
|
736 |
where the classVar named aString is referenced; |
|
737 |
if modsOnly is true, browse only methods where the classvar is modified" |
|
738 |
||
739 |
^ self browseRefsTo:varName classVars:true in:aCollectionOfClasses modificationsOnly:modsOnly title:title |
|
740 |
! |
|
741 |
||
742 |
browseClassRefsTo:aString under:aClass modificationsOnly:modsOnly |
|
743 |
"launch a browser for all methods in aClass and subclasses |
|
744 |
where the classVar named aString is referenced; |
|
745 |
if modsOnly is true, browse only methods where the classvar is modified" |
|
746 |
||
747 |
^ self browseClassRefsTo:aString in:(aClass withAllSubclasses) modificationsOnly:modsOnly |
|
748 |
||
749 |
! |
|
750 |
||
929
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
751 |
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
|
752 |
"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
|
753 |
resource in aCollectionOfClasses. |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
754 |
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
|
755 |
are parsed. |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
756 |
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
|
757 |
browseForResource:#style containing:nil in:... title:... |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
758 |
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
|
759 |
browseForResource:#style containing:'arrowButtonDownForm' in:... title:..." |
573
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
760 |
|
742
2ef5e22d8983
code cleanup (unused vars eliminated)
Claus Gittinger <cg@exept.de>
parents:
675
diff
changeset
|
761 |
|browser searchBlock| |
573
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
762 |
|
1356 | 763 |
"/ search for any resource can be done without looking |
764 |
"/ at the source ... |
|
765 |
(aResourceSymbol isNil and:[item isNil]) ifTrue:[ |
|
766 |
searchBlock := [:class :method :s | method hasResource] |
|
767 |
] ifFalse:[ |
|
768 |
searchBlock := [:class :method :s | |
|
1573
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
769 |
|rsrc val found| |
929
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
770 |
|
1356 | 771 |
found := false. |
772 |
method hasResource ifTrue:[ |
|
1573
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
773 |
rsrc := method resources. |
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
774 |
rsrc notNil ifTrue:[ |
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
775 |
aResourceSymbol isNil ifTrue:[ |
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
776 |
item isNil ifTrue:[ |
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
777 |
found := true |
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
778 |
] ifFalse:[ |
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
779 |
rsrc isCollection ifTrue:[ |
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
780 |
rsrc keysAndValuesDo:[:rsrc :val | |
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
781 |
val isCollection ifTrue:[ |
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
782 |
val do:[:v | |
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
783 |
found := item match:v printString |
929
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
784 |
] |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
785 |
] ifFalse:[ |
1573
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
786 |
found := item match:val printString |
929
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
787 |
] |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
788 |
] |
1356 | 789 |
] ifFalse:[ |
1573
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
790 |
found := item match:rsrc printString |
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
791 |
] |
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
792 |
] |
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
793 |
] ifFalse:[ |
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
794 |
(rsrc includesKey:aResourceSymbol) ifTrue:[ |
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
795 |
item isNil ifTrue:[ |
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
796 |
found := true |
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
797 |
] ifFalse:[ |
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
798 |
rsrc isCollection ifTrue:[ |
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
799 |
val := rsrc at:aResourceSymbol. |
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
800 |
val isCollection ifTrue:[ |
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
801 |
val do:[:v | |
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
802 |
found := item match:v printString |
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
803 |
] |
1356 | 804 |
] ifFalse:[ |
1573
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
805 |
found := item match:val printString |
1356 | 806 |
] |
1573
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
807 |
] ifFalse:[ |
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
808 |
found := item match:rsrc printString |
1356 | 809 |
] |
929
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
810 |
] |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
811 |
] |
573
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
812 |
] |
1356 | 813 |
]. |
929
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
814 |
]. |
1356 | 815 |
found |
816 |
]. |
|
817 |
]. |
|
573
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
818 |
|
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
819 |
browser := self browseMethodsIn:aCollectionOfClasses |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
820 |
where:searchBlock |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
821 |
title:title. |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
822 |
browser notNil ifTrue:[ |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
823 |
browser autoSearch:'resource:' |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
824 |
]. |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
825 |
^ browser |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
826 |
|
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
827 |
" |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
828 |
SystemBrowser |
929
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
829 |
browseForResource:nil |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
830 |
in:Smalltalk allClasses |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
831 |
title:'methods with a resource' |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
832 |
" |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
833 |
" |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
834 |
SystemBrowser |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
835 |
browseForResource:#style |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
836 |
containing:nil |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
837 |
in:Smalltalk allClasses |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
838 |
title:'methods with a #style resource' |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
839 |
" |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
840 |
" |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
841 |
SystemBrowser |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
842 |
browseForResource:#style |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
843 |
containing:'arrowButton*' |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
844 |
in:Smalltalk allClasses |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
845 |
title:'methods with a #style resource' |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
846 |
" |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
847 |
|
1573
4b6ce12dff2b
dont duplicate the code in method>>resources
Claus Gittinger <cg@exept.de>
parents:
1561
diff
changeset
|
848 |
"Modified: / 22.4.1998 / 10:29:20 / cg" |
929
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
849 |
! |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
850 |
|
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
851 |
browseForResource:aResourceSymbol in:aCollectionOfClasses title:title |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
852 |
"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
|
853 |
resource in aCollectionOfClasses" |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
854 |
|
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
855 |
^ self |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
856 |
browseForResource:aResourceSymbol |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
857 |
containing:nil |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
858 |
in:aCollectionOfClasses |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
859 |
title:title |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
860 |
|
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
861 |
" |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
862 |
SystemBrowser |
573
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
863 |
browseForResource:#style |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
864 |
in:Smalltalk allClasses |
929
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
865 |
title:'methods accessing styleSheet values' |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
866 |
" |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
867 |
" |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
868 |
SystemBrowser |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
869 |
browseForResource:#keyboard |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
870 |
in:Smalltalk allClasses |
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
871 |
title:'methods handling keyboard events' |
573
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
872 |
" |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
873 |
" |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
874 |
SystemBrowser |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
875 |
browseForResource:nil |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
876 |
in:Smalltalk allClasses |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
877 |
title:'methods with a resource' |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
878 |
" |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
879 |
|
929
a2275f1b4c94
enhanced resource search, to search for a particular
Claus Gittinger <cg@exept.de>
parents:
825
diff
changeset
|
880 |
"Modified: 9.1.1997 / 12:44:38 / cg" |
573
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
881 |
! |
e32bd3e46a72
added startup for searching resourceSpecs
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
882 |
|
203 | 883 |
browseForString:aString |
884 |
"launch a browser for all methods containing a string in their source. |
|
885 |
This may be slow, since source-code has to be scanned." |
|
886 |
||
1703
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
887 |
^ self browseForString:aString in:(Smalltalk allClasses) ignoreCase:false |
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
888 |
|
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
889 |
"Modified: / 18.6.1998 / 16:42:39 / cg" |
203 | 890 |
! |
891 |
||
892 |
browseForString:aString in:aCollectionOfClasses |
|
893 |
"launch a browser for all methods in aCollectionOfClasses |
|
894 |
containing a string in their source. |
|
895 |
This may be slow, since source-code has to be scanned." |
|
896 |
||
1703
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
897 |
^ self |
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
898 |
browseForString:aString |
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
899 |
in:aCollectionOfClasses |
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
900 |
ignoreCase:false |
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
901 |
|
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
902 |
" |
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
903 |
SystemBrowser browseForString:'all' in:(Array with:Object) |
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
904 |
SystemBrowser browseForString:'should' in:(Array with:Object) |
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
905 |
SystemBrowser browseForString:'[eE]rror' in:(Array with:Object) |
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
906 |
" |
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
907 |
|
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
908 |
"Created: / 9.12.1995 / 18:03:12 / cg" |
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
909 |
"Modified: / 18.6.1998 / 16:43:27 / cg" |
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
910 |
! |
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
911 |
|
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
912 |
browseForString:aString in:aCollectionOfClasses ignoreCase:ignoreCase |
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
913 |
"launch a browser for all methods in aCollectionOfClasses |
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
914 |
containing a string in their source. |
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
915 |
This may be slow, since source-code has to be scanned." |
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
916 |
|
203 | 917 |
|browser searchBlock title s| |
918 |
||
256 | 919 |
title := self classResources string:'methods containing: %1' with:aString displayString. |
203 | 920 |
|
1703
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
921 |
(aString includesMatchCharacters |
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
922 |
or:[ignoreCase]) ifTrue:[ |
256 | 923 |
s := '*' , aString , '*'. |
924 |
"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
|
925 |
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
|
926 |
|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
|
927 |
src := m source. |
1703
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
928 |
src isNil ifTrue:[ |
2208
e077aa992f7a
check for nil source in #allCallsOn: (for methods where src in not available)
Claus Gittinger <cg@exept.de>
parents:
1937
diff
changeset
|
929 |
('Browser [info]: no source for ' , m printString) infoPrintCR. |
1703
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
930 |
false |
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
931 |
] ifFalse:[ |
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
932 |
s match:src ignoreCase:ignoreCase |
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
933 |
] |
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
|
934 |
] |
203 | 935 |
] 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
|
936 |
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
|
937 |
|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
|
938 |
|
b14b3ab39af6
dont crash if searching a string in a method which has no accessable source
Claus Gittinger <cg@exept.de>
parents:
436
diff
changeset
|
939 |
src := m source. |
1703
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
940 |
src isNil ifTrue:[ |
2208
e077aa992f7a
check for nil source in #allCallsOn: (for methods where src in not available)
Claus Gittinger <cg@exept.de>
parents:
1937
diff
changeset
|
941 |
('Browser [info]: no source for ' , m printString) infoPrintCR. |
1703
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
942 |
false |
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
943 |
] ifFalse:[ |
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
944 |
(src findString:aString) ~~ 0 |
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
945 |
] |
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
|
946 |
] |
203 | 947 |
]. |
948 |
browser := self browseMethodsIn:aCollectionOfClasses where:searchBlock title:title. |
|
949 |
||
950 |
browser notNil ifTrue:[ |
|
1703
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
951 |
browser autoSearch:aString ignoreCase:ignoreCase |
203 | 952 |
]. |
953 |
^ browser |
|
954 |
||
955 |
" |
|
1703
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
956 |
SystemBrowser browseForString:'all' in:(Array with:Object) |
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
957 |
SystemBrowser browseForString:'should' in:(Array with:Object) |
203 | 958 |
SystemBrowser browseForString:'[eE]rror' in:(Array with:Object) |
959 |
" |
|
960 |
||
1703
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
961 |
"Created: / 18.6.1998 / 16:42:50 / cg" |
ea66390f879b
added ignoreCase option to string-search.
Claus Gittinger <cg@exept.de>
parents:
1681
diff
changeset
|
962 |
"Modified: / 18.6.1998 / 16:51:25 / cg" |
203 | 963 |
! |
964 |
||
965 |
browseForSymbol:aSymbol |
|
966 |
"launch a browser for all methods referencing aSymbol" |
|
967 |
||
666 | 968 |
^ self |
969 |
browseForSymbol:aSymbol |
|
970 |
title:(self classResources string:'users of: %1' with:aSymbol) |
|
971 |
warnIfNone:true |
|
256 | 972 |
|
973 |
"Created: 9.12.1995 / 18:04:34 / cg" |
|
666 | 974 |
"Modified: 10.7.1996 / 10:35:34 / cg" |
975 |
! |
|
976 |
||
977 |
browseForSymbol:aSymbol in:aSetOfClasses title:title warnIfNone:doWarn |
|
978 |
"launch a browser for all methods referencing aSymbol" |
|
979 |
||
980 |
|browser searchBlock sym| |
|
981 |
||
982 |
(aSymbol includesMatchCharacters) ifTrue:[ |
|
983 |
"a matchString" |
|
984 |
searchBlock := [:c :m :s | |
|
985 |
(m literalsDetect:[:aLiteral| |
|
986 |
(aLiteral isMemberOf:Symbol) |
|
987 |
and:[aSymbol match:aLiteral] |
|
988 |
] ifNone:nil) notNil |
|
989 |
]. |
|
990 |
] ifFalse:[ |
|
991 |
" |
|
992 |
can do a faster search |
|
993 |
" |
|
994 |
sym := aSymbol asSymbolIfInterned. |
|
995 |
sym isNil ifTrue:[ |
|
996 |
self showNoneFound:title. |
|
997 |
^ nil |
|
998 |
]. |
|
999 |
||
1000 |
searchBlock := [:c :m :s | |
|
1001 |
(m literalsDetect:[:aLiteral| |
|
1002 |
(sym == aLiteral) |
|
1003 |
] ifNone:nil) notNil |
|
1004 |
]. |
|
1005 |
]. |
|
1006 |
doWarn ifFalse:[ |
|
1007 |
WarningSignal ignoreIn:[ |
|
1008 |
browser := self browseMethodsIn:aSetOfClasses where:searchBlock title:title. |
|
1009 |
] |
|
1010 |
] ifTrue:[ |
|
1011 |
browser := self browseMethodsIn:aSetOfClasses where:searchBlock title:title. |
|
1012 |
]. |
|
1013 |
browser notNil ifTrue:[ |
|
1014 |
browser autoSearch:aSymbol |
|
1015 |
]. |
|
1016 |
^ browser |
|
1017 |
||
1018 |
"Modified: 24.6.1996 / 14:39:07 / stefan" |
|
1019 |
"Modified: 30.6.1996 / 16:45:25 / cg" |
|
1020 |
"Created: 10.7.1996 / 10:36:36 / cg" |
|
203 | 1021 |
! |
1022 |
||
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1023 |
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
|
1024 |
"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
|
1025 |
|
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1026 |
|browser searchBlock sym| |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1027 |
|
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1028 |
(aSymbol includesMatchCharacters) ifTrue:[ |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1029 |
"a matchString" |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1030 |
searchBlock := [:c :m :s | |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1031 |
(m literalsDetect:[:aLiteral| |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1032 |
(aLiteral isMemberOf:Symbol) |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1033 |
and:[aSymbol match:aLiteral] |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1034 |
] ifNone:nil) notNil |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1035 |
]. |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1036 |
] ifFalse:[ |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1037 |
" |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1038 |
can do a faster search |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1039 |
" |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1040 |
sym := aSymbol asSymbolIfInterned. |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1041 |
sym isNil ifTrue:[ |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1042 |
self showNoneFound:title. |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1043 |
^ nil |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1044 |
]. |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1045 |
|
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1046 |
searchBlock := [:c :m :s | |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1047 |
(m literalsDetect:[:aLiteral| |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1048 |
(sym == aLiteral) |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1049 |
] ifNone:nil) notNil |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1050 |
]. |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1051 |
]. |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1052 |
doWarn ifFalse:[ |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1053 |
WarningSignal ignoreIn:[ |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1054 |
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
|
1055 |
] |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1056 |
] ifTrue:[ |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1057 |
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
|
1058 |
]. |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1059 |
|
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1060 |
(browser notNil |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1061 |
and:[searchString notNil]) ifTrue:[ |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1062 |
browser autoSearch:searchString |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1063 |
]. |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1064 |
^ browser |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1065 |
|
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1066 |
"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
|
1067 |
"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
|
1068 |
"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
|
1069 |
! |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1070 |
|
2409 | 1071 |
browseForSymbol:aSymbol title:title ifNone:actionIfNoneFound searchFor:searchString |
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1072 |
"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
|
1073 |
|
203 | 1074 |
|browser searchBlock sym| |
1075 |
||
1076 |
(aSymbol includesMatchCharacters) ifTrue:[ |
|
375 | 1077 |
"a matchString" |
1078 |
searchBlock := [:c :m :s | |
|
2439 | 1079 |
m referencesGlobalMatching:aSymbol |
1080 |
"/ (m literalsDetect:[:aLiteral| |
|
1081 |
"/ (aLiteral isMemberOf:Symbol) |
|
1082 |
"/ and:[aSymbol match:aLiteral] |
|
1083 |
"/ ] ifNone:nil) notNil |
|
375 | 1084 |
]. |
203 | 1085 |
] ifFalse:[ |
375 | 1086 |
" |
1087 |
can do a faster search |
|
1088 |
" |
|
1089 |
sym := aSymbol asSymbolIfInterned. |
|
1090 |
sym isNil ifTrue:[ |
|
2409 | 1091 |
actionIfNoneFound value. |
375 | 1092 |
^ nil |
1093 |
]. |
|
203 | 1094 |
|
375 | 1095 |
searchBlock := [:c :m :s | |
2439 | 1096 |
m referencesGlobal:sym |
1097 |
"/ (m literalsDetect:[:aLiteral| |
|
1098 |
"/ (sym == aLiteral) |
|
1099 |
"/ ] ifNone:nil) notNil |
|
375 | 1100 |
]. |
203 | 1101 |
]. |
2409 | 1102 |
|
1103 |
WarningSignal ignoreIn:[ |
|
1104 |
InformationSignal ignoreIn:[ |
|
375 | 1105 |
browser := self browseMethodsWhere:searchBlock title:title. |
1106 |
] |
|
2409 | 1107 |
]. |
1108 |
browser isNil ifTrue:[ |
|
1109 |
actionIfNoneFound value |
|
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
|
1110 |
]. |
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1111 |
|
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1112 |
(browser notNil |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1113 |
and:[searchString notNil]) ifTrue:[ |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1114 |
browser autoSearch:searchString |
203 | 1115 |
]. |
1116 |
^ browser |
|
375 | 1117 |
|
2439 | 1118 |
"Modified: / 24.6.1996 / 14:39:07 / stefan" |
1119 |
"Created: / 31.10.1996 / 14:45:08 / cg" |
|
1120 |
"Modified: / 9.11.1999 / 17:04:30 / cg" |
|
203 | 1121 |
! |
1122 |
||
2409 | 1123 |
browseForSymbol:aSymbol title:title warnIfNone:doWarn |
1124 |
"launch a browser for all methods referencing aSymbol" |
|
1125 |
||
1126 |
^ self |
|
1127 |
browseForSymbol:aSymbol |
|
1128 |
title:title |
|
1129 |
warnIfNone:doWarn |
|
1130 |
searchFor:aSymbol |
|
1131 |
||
1132 |
"Modified: 31.10.1996 / 14:45:38 / cg" |
|
1133 |
! |
|
1134 |
||
1135 |
browseForSymbol:aSymbol title:title warnIfNone:doWarn searchFor:searchString |
|
1136 |
"launch a browser for all methods referencing aSymbol" |
|
1137 |
||
2414 | 1138 |
|b| |
1139 |
||
1140 |
doWarn ifTrue: [ |
|
1141 |
b := [self showNoneFound:title] |
|
1142 |
]. |
|
2409 | 1143 |
^ self |
1144 |
browseForSymbol:aSymbol |
|
1145 |
title:title |
|
2414 | 1146 |
ifNone:b |
2409 | 1147 |
searchFor:searchString |
1148 |
! |
|
1149 |
||
52 | 1150 |
browseImplementorsOf:aSelectorString |
1151 |
"launch a browser for all implementors of aSelector" |
|
1152 |
||
2623
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1153 |
^ self |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1154 |
browseImplementorsOf:aSelectorString |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1155 |
in:(Smalltalk allClasses) |
52 | 1156 |
|
1157 |
" |
|
1158 |
SystemBrowser browseImplementorsOf:#+ |
|
1159 |
" |
|
256 | 1160 |
|
1161 |
"Created: 9.12.1995 / 18:01:18 / cg" |
|
666 | 1162 |
"Modified: 10.7.1996 / 10:21:26 / cg" |
1163 |
! |
|
1164 |
||
1165 |
browseImplementorsOf:aSelectorString in:aSetOfClasses |
|
1166 |
"launch a browser for all implementors of aSelector" |
|
1167 |
||
2623
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1168 |
^ self |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1169 |
browseImplementorsOf:aSelectorString |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1170 |
in:aSetOfClasses |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1171 |
title:(self classResources string:'implementors of: %1' with:aSelectorString) |
666 | 1172 |
|
1173 |
" |
|
1174 |
SystemBrowser browseImplementorsOf:#+ in:(Number withAllSubclasses) |
|
1175 |
" |
|
1176 |
||
1177 |
"Created: 10.7.1996 / 10:20:59 / cg" |
|
1178 |
"Modified: 10.7.1996 / 10:21:49 / cg" |
|
52 | 1179 |
! |
1180 |
||
2623
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1181 |
browseImplementorsOf:aSelectorString in:aSetOfClasses ignoreCase:ignoreCase |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1182 |
"launch a browser for all implementors of aSelector" |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1183 |
|
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1184 |
^ self |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1185 |
browseImplementorsOf:aSelectorString |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1186 |
in:aSetOfClasses |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1187 |
ignoreCase:ignoreCase |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1188 |
title:(self classResources string:'implementors of: %1' with:aSelectorString) |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1189 |
|
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1190 |
" |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1191 |
SystemBrowser browseImplementorsOf:#+ in:(Number withAllSubclasses) |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1192 |
" |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1193 |
|
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1194 |
"Created: 10.7.1996 / 10:20:59 / cg" |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1195 |
"Modified: 10.7.1996 / 10:21:49 / cg" |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1196 |
|
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1197 |
|
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1198 |
! |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1199 |
|
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1200 |
browseImplementorsOf:aSelectorString in:aCollectionOfClasses ignoreCase:ignoreCase title:title |
36 | 1201 |
"launch a browser for all implementors of aSelector in |
1202 |
the classes contained in aCollectionOfClasses and its metaclasses" |
|
1203 |
||
2642 | 1204 |
|list| |
270 | 1205 |
|
2642 | 1206 |
list := self |
1207 |
findImplementorsOf:aSelectorString |
|
1208 |
in:aCollectionOfClasses |
|
1209 |
ignoreCase:ignoreCase. |
|
45 | 1210 |
|
2642 | 1211 |
list size == 0 ifTrue:[ |
1212 |
self showNoneFound:title. |
|
1213 |
^ nil |
|
36 | 1214 |
]. |
2623
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1215 |
|
270 | 1216 |
^ self browseMethods:list asOrderedCollection title:title |
36 | 1217 |
|
1218 |
" |
|
1219 |
SystemBrowser browseImplementorsOf:#+ |
|
270 | 1220 |
in:(Array with:Number |
1221 |
with:Float |
|
1222 |
with:SmallInteger) |
|
1223 |
title:'some implementors of +' |
|
36 | 1224 |
" |
132 | 1225 |
|
1937
fc541342f2db
more support for java code (implementors)
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
1226 |
"Modified: / 4.9.1995 / 17:33:39 / claus" |
fc541342f2db
more support for java code (implementors)
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
1227 |
"Modified: / 19.6.1996 / 14:19:02 / stefan" |
fc541342f2db
more support for java code (implementors)
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
1228 |
"Modified: / 16.10.1998 / 13:16:29 / cg" |
36 | 1229 |
! |
1230 |
||
2623
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1231 |
browseImplementorsOf:aSelectorString in:aCollectionOfClasses title:title |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1232 |
"launch a browser for all implementors of aSelector in |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1233 |
the classes contained in aCollectionOfClasses and its metaclasses" |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1234 |
|
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1235 |
^ self |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1236 |
browseImplementorsOf:aSelectorString |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1237 |
in:aCollectionOfClasses |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1238 |
ignoreCase:false |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1239 |
title:title |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1240 |
|
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1241 |
! |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1242 |
|
52 | 1243 |
browseImplementorsOf:aSelectorString under:aClass |
1244 |
"launch a browser for all implementors of aSelector in aClass |
|
1245 |
and its subclasses" |
|
1246 |
||
2623
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1247 |
^ self |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1248 |
browseImplementorsOf:aSelectorString |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1249 |
in:(aClass withAllSubclasses) |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1250 |
title:(self classResources |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1251 |
string:'implementors of: %1 (in and below %2)' |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1252 |
with:aSelectorString |
9e488daf53da
allow for senders/implementors to be searched with caseIgnore
Claus Gittinger <cg@exept.de>
parents:
2551
diff
changeset
|
1253 |
with:aClass name) |
52 | 1254 |
|
1255 |
" |
|
1256 |
SystemBrowser browseImplementorsOf:#+ under:Integer |
|
1257 |
" |
|
256 | 1258 |
|
1259 |
"Created: 9.12.1995 / 18:06:09 / cg" |
|
1260 |
"Modified: 9.12.1995 / 18:11:38 / cg" |
|
52 | 1261 |
! |
1262 |
||
203 | 1263 |
browseInstRefsTo:aString in:aCollectionOfClasses modificationsOnly:modsOnly |
1264 |
"launch a browser for all methods in aClass where the instVar named |
|
1265 |
aString is referenced; if modsOnly is true, browse only methods where the |
|
1266 |
instvar is modified" |
|
45 | 1267 |
|
203 | 1268 |
^ self browseRefsTo:aString classVars:false in:aCollectionOfClasses modificationsOnly:modsOnly |
36 | 1269 |
! |
1270 |
||
203 | 1271 |
browseInstRefsTo:varName in:aCollectionOfClasses modificationsOnly:modsOnly title:title |
1272 |
"launch a browser for all methods in aClass where the instVar named |
|
1273 |
varName is referenced; if modsOnly is true, browse only methods where the |
|
1274 |
instvar is modified" |
|
52 | 1275 |
|
203 | 1276 |
^ self browseRefsTo:varName classVars:false in:aCollectionOfClasses modificationsOnly:modsOnly title:title |
52 | 1277 |
! |
1278 |
||
203 | 1279 |
browseInstRefsTo:aString under:aClass modificationsOnly:modsOnly |
1280 |
"launch a browser for all methods in aClass and subclasses |
|
1281 |
where the instVar named aString is referenced; |
|
1282 |
if modsOnly is true, browse only methods where the instvar is modified" |
|
36 | 1283 |
|
203 | 1284 |
^ self browseInstRefsTo:aString in:(aClass withAllSubclasses) modificationsOnly:modsOnly |
36 | 1285 |
! |
1286 |
||
1287 |
browseReferendsOf:aGlobalName |
|
1288 |
"launch a browser for all methods referencing a global |
|
1367 | 1289 |
named aGlobalName. The argument may be a symbol, a string or |
1290 |
a matchPattern. |
|
36 | 1291 |
" |
1292 |
||
1293 |
^ self browseReferendsOf:aGlobalName warnIfNone:true |
|
1294 |
||
1295 |
" |
|
1296 |
Browser browseReferendsOf:#Transcript |
|
1367 | 1297 |
Browser browseReferendsOf:'Tr*' |
36 | 1298 |
" |
75 | 1299 |
|
1367 | 1300 |
"Modified: / 30.10.1997 / 23:45:52 / cg" |
36 | 1301 |
! |
1302 |
||
2409 | 1303 |
browseReferendsOf:aGlobalName ifNone:actionIfNone |
1304 |
"launch a browser for all methods referencing a global |
|
1305 |
named aGlobalName. |
|
1306 |
" |
|
1307 |
||
1308 |
^ self |
|
1309 |
browseReferendsOf:aGlobalName |
|
1310 |
title:(self classResources string:'users of: %1' with:aGlobalName) |
|
1311 |
ifNone:actionIfNone |
|
1312 |
||
1313 |
"Modified: / 31.10.1997 / 15:42:05 / cg" |
|
1314 |
||
1315 |
||
1316 |
! |
|
1317 |
||
666 | 1318 |
browseReferendsOf:aGlobalName in:aSetOfClasses |
1319 |
"launch a browser for all methods referencing a global |
|
1320 |
named aGlobalName. |
|
1321 |
" |
|
1322 |
||
1323 |
^ self browseReferendsOf:aGlobalName in:aSetOfClasses warnIfNone:true |
|
1324 |
||
1325 |
" |
|
1326 |
Browser browseReferendsOf:#Transcript |
|
1327 |
" |
|
1328 |
||
1329 |
"Created: 10.7.1996 / 10:37:30 / cg" |
|
1330 |
! |
|
1331 |
||
1332 |
browseReferendsOf:aGlobalName in:aSetOfClasses warnIfNone:doWarn |
|
1333 |
"launch a browser for all methods referencing a global |
|
1334 |
named aGlobalName. |
|
1335 |
" |
|
1336 |
||
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1337 |
|globalsPlainName idx| |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1338 |
|
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1339 |
globalsPlainName := aGlobalName. |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1340 |
(idx := globalsPlainName lastIndexOf:$:) ~~ 0 ifTrue:[ |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1341 |
globalsPlainName := globalsPlainName copyFrom:idx+1 |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1342 |
]. |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1343 |
|
666 | 1344 |
^ self browseForSymbol:aGlobalName |
1345 |
in:aSetOfClasses |
|
1346 |
title:(self classResources string:'users of: %1' with:aGlobalName) |
|
1347 |
warnIfNone:doWarn |
|
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1348 |
searchFor:globalsPlainName |
666 | 1349 |
|
1350 |
"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
|
1351 |
"Modified: 31.10.1996 / 14:56:38 / cg" |
666 | 1352 |
! |
1353 |
||
2409 | 1354 |
browseReferendsOf:aGlobalName title:title ifNone:actionIfNone |
203 | 1355 |
"launch a browser for all methods referencing a global |
1356 |
named aGlobalName. |
|
1357 |
" |
|
1358 |
||
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1359 |
|globalsPlainName idx| |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1360 |
|
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1361 |
globalsPlainName := aGlobalName. |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1362 |
(idx := globalsPlainName lastIndexOf:$:) ~~ 0 ifTrue:[ |
1367 | 1363 |
globalsPlainName := globalsPlainName copyFrom:idx+1. |
1364 |
(globalsPlainName size == 0 |
|
1365 |
or:[globalsPlainName = '*']) ifTrue:[ |
|
1366 |
globalsPlainName := aGlobalName |
|
1367 |
] |
|
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1368 |
]. |
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1369 |
|
666 | 1370 |
^ self browseForSymbol:aGlobalName |
1367 | 1371 |
title:title |
2409 | 1372 |
ifNone:actionIfNone |
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1373 |
searchFor:globalsPlainName |
203 | 1374 |
|
1367 | 1375 |
"Modified: / 31.10.1996 / 14:47:48 / cg" |
1376 |
"Created: / 31.10.1997 / 15:41:28 / cg" |
|
2409 | 1377 |
|
1378 |
||
1379 |
! |
|
1380 |
||
1381 |
browseReferendsOf:aGlobalName title:title warnIfNone:doWarn |
|
1382 |
"launch a browser for all methods referencing a global |
|
1383 |
named aGlobalName. |
|
1384 |
" |
|
1385 |
||
2414 | 1386 |
|b| |
1387 |
||
1388 |
doWarn ifTrue: [ |
|
1389 |
b := [self showNoneFound:title] |
|
1390 |
]. |
|
1391 |
||
2409 | 1392 |
^ self |
1393 |
browseReferendsOf:aGlobalName |
|
1394 |
title:title |
|
2414 | 1395 |
ifNone:b |
2409 | 1396 |
|
1367 | 1397 |
! |
1398 |
||
1399 |
browseReferendsOf:aGlobalName warnIfNone:doWarn |
|
1400 |
"launch a browser for all methods referencing a global |
|
1401 |
named aGlobalName. |
|
1402 |
" |
|
1403 |
||
1404 |
^ self |
|
1405 |
browseReferendsOf:aGlobalName |
|
1406 |
title:(self classResources string:'users of: %1' with:aGlobalName) |
|
1407 |
warnIfNone:doWarn |
|
1408 |
||
1409 |
"Modified: / 31.10.1997 / 15:42:05 / cg" |
|
203 | 1410 |
! |
1411 |
||
1412 |
browseRefsTo:aString classVars:classVars in:aCollectionOfClasses modificationsOnly:modsOnly |
|
1413 |
"launch a browser for all methods in aClass where the instVar/classVar named |
|
1414 |
aString is referenced; if modsOnly is true, browse only methods where the |
|
1415 |
instvar is modified" |
|
1416 |
||
1417 |
|title| |
|
1418 |
||
1419 |
modsOnly ifTrue:[ |
|
256 | 1420 |
title := 'modifications of: %1' |
203 | 1421 |
] ifFalse:[ |
256 | 1422 |
title := 'references to: %1 ' |
203 | 1423 |
]. |
1424 |
^ self |
|
256 | 1425 |
browseRefsTo:aString |
1426 |
classVars:classVars |
|
1427 |
in:aCollectionOfClasses |
|
1428 |
modificationsOnly:modsOnly |
|
1429 |
title:(self classResources string:title with:aString) |
|
1430 |
||
1431 |
"Created: 9.12.1995 / 18:07:05 / cg" |
|
1432 |
"Modified: 9.12.1995 / 18:11:49 / cg" |
|
203 | 1433 |
! |
1434 |
||
1435 |
browseRefsTo:varName classVars:classVars in:aCollectionOfClasses modificationsOnly:modsOnly title:title |
|
1436 |
"launch a browser for all methods in aClass where the instVar/classVar named |
|
1437 |
varName is referenced; if modsOnly is true, browse only methods where the |
|
1438 |
instvar is modified" |
|
1439 |
||
1440 |
|filter browser pattern| |
|
1441 |
||
1442 |
filter := self filterToSearchRefsTo:varName classVars:classVars modificationsOnly:modsOnly. |
|
2677 | 1443 |
browser := self browseMethodsIn:aCollectionOfClasses inst:true class:classVars where:filter title:title. |
203 | 1444 |
|
1445 |
browser notNil ifTrue:[ |
|
2677 | 1446 |
modsOnly ifTrue:[ |
1447 |
pattern := varName , ' :=' |
|
1448 |
] ifFalse:[ |
|
1449 |
pattern := varName |
|
1450 |
]. |
|
1451 |
browser autoSearch:pattern |
|
203 | 1452 |
]. |
1453 |
^ browser |
|
1454 |
! |
|
1455 |
||
256 | 1456 |
browseSuperCallsIn:aCollectionOfClasses title:title |
1457 |
"launch a browser for all super sends in aCollectionOfClasses" |
|
1458 |
||
742
2ef5e22d8983
code cleanup (unused vars eliminated)
Claus Gittinger <cg@exept.de>
parents:
675
diff
changeset
|
1459 |
|browser searchBlock| |
256 | 1460 |
|
1461 |
searchBlock := [:class :method :s | |
|
504 | 1462 |
|src parser| |
256 | 1463 |
|
504 | 1464 |
src := method source. |
2208
e077aa992f7a
check for nil source in #allCallsOn: (for methods where src in not available)
Claus Gittinger <cg@exept.de>
parents:
1937
diff
changeset
|
1465 |
(src notNil and:[src findString:'super']) ~~ 0 ifTrue:[ |
504 | 1466 |
parser := Parser |
2208
e077aa992f7a
check for nil source in #allCallsOn: (for methods where src in not available)
Claus Gittinger <cg@exept.de>
parents:
1937
diff
changeset
|
1467 |
parseMethod:src |
504 | 1468 |
in:class |
1469 |
ignoreErrors:true |
|
1470 |
ignoreWarnings:true. |
|
1471 |
||
1472 |
parser notNil and:[parser usesSuper] |
|
1473 |
] ifFalse:[ |
|
1474 |
false |
|
1475 |
] |
|
256 | 1476 |
]. |
1477 |
||
1478 |
browser := self browseMethodsIn:aCollectionOfClasses |
|
504 | 1479 |
where:searchBlock |
1480 |
title:title. |
|
256 | 1481 |
|
1482 |
browser notNil ifTrue:[ |
|
504 | 1483 |
browser autoSearch:'super' |
256 | 1484 |
]. |
1485 |
^ browser |
|
1486 |
||
504 | 1487 |
" |
1488 |
SystemBrowser |
|
1489 |
browseSuperCallsIn:(Array with:SortedCollection) |
|
1490 |
title:'superSends in SortedCollection' |
|
1491 |
" |
|
1492 |
||
256 | 1493 |
"Created: 23.11.1995 / 14:08:55 / cg" |
504 | 1494 |
"Modified: 24.4.1996 / 13:25:31 / cg" |
256 | 1495 |
! |
1496 |
||
1497 |
browseSuperCallsUnder:aClass |
|
1498 |
"launch a browser for all supersends in aClass and subclasses" |
|
1499 |
||
1500 |
^ self browseSuperCallsIn:(aClass withAllSubclasses) |
|
1501 |
title:(self classResources string:'supersends (in and below %1)' with:aClass name) |
|
1502 |
||
1503 |
" |
|
1504 |
SystemBrowser browseSuperCallsUnder:Number |
|
1505 |
" |
|
1506 |
||
1507 |
"Created: 23.11.1995 / 12:06:06 / cg" |
|
1508 |
"Modified: 9.12.1995 / 18:11:59 / cg" |
|
1509 |
! |
|
1510 |
||
52 | 1511 |
browseUsesOf:aClass |
1512 |
|dict owners offsets |
|
1513 |
sz "{ Class: SmallInteger }" |
|
1514 |
n "{ Class: SmallInteger }" |
|
1515 |
removeSet newDict| |
|
1516 |
||
1517 |
owners := ObjectMemory whoReferencesInstancesOf:aClass. |
|
1518 |
||
1519 |
" |
|
1520 |
collect set of offsets in dict; key is class |
|
1521 |
" |
|
1522 |
dict := IdentityDictionary new. |
|
1523 |
owners do:[:someObject | |
|
1524 |
|cls create| |
|
1525 |
||
1526 |
someObject isContext ifFalse:[ |
|
1527 |
" |
|
1528 |
someObject refers to an instance of aClass; |
|
1529 |
find out, which instVar(s) |
|
1530 |
" |
|
1531 |
cls := someObject class. |
|
1532 |
cls ~~ Array ifTrue:[ |
|
1533 |
n := cls instSize. |
|
1534 |
create := [|s| s := Set new. dict at:cls put:s. s]. |
|
1535 |
||
1536 |
1 to:n do:[:i | |
|
1537 |
|ref| |
|
1538 |
||
1539 |
ref := someObject instVarAt:i. |
|
1540 |
(ref isMemberOf:aClass) ifTrue:[ |
|
1541 |
offsets := dict at:cls ifAbsent:create. |
|
1542 |
offsets add:i. |
|
1543 |
] |
|
1544 |
]. |
|
1545 |
cls isVariable ifTrue:[ |
|
1546 |
cls isPointers ifTrue:[ |
|
1547 |
| idx "{ Class: SmallInteger }" | |
|
1548 |
||
1549 |
sz := someObject basicSize. |
|
1550 |
idx := 1. |
|
1551 |
[idx <= sz] whileTrue:[ |
|
1552 |
|ref| |
|
1553 |
||
1554 |
ref := someObject basicAt:idx. |
|
1555 |
(ref isMemberOf:aClass) ifTrue:[ |
|
1556 |
offsets := dict at:cls ifAbsent:create. |
|
1557 |
offsets add:0. |
|
1558 |
idx := sz |
|
1559 |
]. |
|
1560 |
idx := idx + 1 |
|
1561 |
] |
|
1562 |
] |
|
1563 |
] |
|
1564 |
] |
|
1565 |
] |
|
1566 |
]. |
|
1567 |
||
1568 |
" |
|
1569 |
merge with superclass refs |
|
1570 |
" |
|
1571 |
dict keysAndValuesDo:[:cls :set | |
|
1572 |
cls allSuperclasses do:[:aSuperclass | |
|
1573 |
|superSet| |
|
1574 |
||
1575 |
superSet := dict at:aSuperclass ifAbsent:[]. |
|
1576 |
superSet notNil ifTrue:[ |
|
1577 |
|removeSet| |
|
1578 |
||
1579 |
superSet := dict at:aSuperclass. |
|
1580 |
removeSet := Set new. |
|
1581 |
set do:[:offset | |
|
1582 |
(superSet includes:offset) ifTrue:[ |
|
1583 |
removeSet add:offset |
|
1584 |
] |
|
1585 |
]. |
|
1586 |
set removeAll:removeSet |
|
1587 |
] |
|
1588 |
] |
|
1589 |
]. |
|
1590 |
||
1591 |
" |
|
1592 |
remove empty ones |
|
1593 |
" |
|
1594 |
removeSet := Set new. |
|
1595 |
dict keysAndValuesDo:[:cls :set | |
|
1596 |
set isEmpty ifTrue:[ |
|
1597 |
removeSet add:cls |
|
1598 |
] |
|
1599 |
]. |
|
1600 |
removeSet do:[:cls | |
|
1601 |
dict removeKey:cls |
|
1602 |
]. |
|
1603 |
||
1604 |
" |
|
1605 |
replace the indices by real names |
|
1606 |
" |
|
1607 |
newDict := IdentityDictionary new. |
|
1608 |
dict keysAndValuesDo:[:cls :set | |
|
1609 |
|newSet names| |
|
1610 |
||
1611 |
names := cls allInstVarNames. |
|
1612 |
newSet := set collect:[:index | |
|
1613 |
index == 0 ifTrue:['*indexed*'] ifFalse:[names at:index]. |
|
1614 |
]. |
|
1615 |
newDict at:cls put:newSet |
|
1616 |
]. |
|
1617 |
||
1618 |
newDict inspect |
|
1619 |
||
75 | 1620 |
|
52 | 1621 |
! |
1622 |
||
203 | 1623 |
filterToSearchRefsTo:varName classVars:classVars modificationsOnly:modsOnly |
1624 |
"return a searchblock for variable references" |
|
1625 |
||
1626 |
|searchBlock| |
|
53 | 1627 |
|
203 | 1628 |
searchBlock := [:c :m :s | |
504 | 1629 |
|src result parser vars needMatch| |
1630 |
||
1631 |
needMatch := varName includesMatchCharacters. |
|
36 | 1632 |
|
504 | 1633 |
src := m source. |
1634 |
src isNil ifTrue:[ |
|
1635 |
result := false |
|
1636 |
] ifFalse:[ |
|
1637 |
needMatch ifFalse:[ |
|
1638 |
" |
|
1639 |
before doing a slow parse, quickly scan the |
|
1640 |
methods source for the variables name ... |
|
1641 |
" |
|
1642 |
result := (src findString:varName) ~~ 0. |
|
1643 |
] ifTrue:[ |
|
1644 |
result := true. |
|
1645 |
]. |
|
1646 |
result ifTrue:[ |
|
1647 |
result := false. |
|
1648 |
parser := Parser |
|
1649 |
parseMethod:src |
|
1650 |
in:c |
|
1651 |
ignoreErrors:true |
|
1652 |
ignoreWarnings:true. |
|
36 | 1653 |
|
504 | 1654 |
(parser notNil and:[parser ~~ #Error]) ifTrue:[ |
1655 |
classVars ifFalse:[ |
|
1656 |
modsOnly ifTrue:[ |
|
1657 |
vars := parser modifiedInstVars |
|
1658 |
] ifFalse:[ |
|
1659 |
vars := parser usedInstVars |
|
1660 |
]. |
|
1661 |
] ifTrue:[ |
|
1662 |
modsOnly ifTrue:[ |
|
1663 |
vars := parser modifiedClassVars |
|
1664 |
] ifFalse:[ |
|
1665 |
vars := parser usedClassVars |
|
1666 |
]. |
|
1667 |
]. |
|
1190 | 1668 |
vars size > 0 ifTrue:[ |
504 | 1669 |
needMatch ifTrue:[ |
1670 |
vars do:[:cv | |
|
1671 |
(varName match:cv) ifTrue:[result := true] |
|
1672 |
] |
|
1673 |
] ifFalse:[ |
|
1674 |
result := vars includes:varName |
|
1675 |
] |
|
1676 |
] |
|
1677 |
]. |
|
1678 |
]. |
|
1679 |
]. |
|
1680 |
Processor yield. |
|
1681 |
result |
|
36 | 1682 |
]. |
203 | 1683 |
^ searchBlock |
504 | 1684 |
|
1190 | 1685 |
"Modified: 19.6.1997 / 18:27:57 / cg" |
2642 | 1686 |
! |
1687 |
||
2677 | 1688 |
findClassRefsTo:aString in:aCollectionOfClasses modificationsOnly:modsOnly |
2728 | 1689 |
"return all methods in aCollectionOfClasses where the classVar named |
2677 | 1690 |
aString is referenced; |
1691 |
if modsOnly is true, browse only methods where the classvar is modified" |
|
1692 |
||
1693 |
^ self findRefsTo:aString classVars:true in:aCollectionOfClasses modificationsOnly:modsOnly |
|
1694 |
! |
|
1695 |
||
2728 | 1696 |
findClassRefsTo:aString inClass:aClass modificationsOnly:modsOnly |
1697 |
"return all methods in aClass where the classVar named |
|
1698 |
aString is referenced; |
|
1699 |
if modsOnly is true, browse only methods where the classvar is modified" |
|
1700 |
||
1701 |
^ self findRefsTo:aString classVars:true in:(Array with:aClass) modificationsOnly:modsOnly |
|
1702 |
! |
|
1703 |
||
2677 | 1704 |
findClassRefsTo:aString under:aClass modificationsOnly:modsOnly |
1705 |
"return all methods in aClass and subclasses |
|
1706 |
where the classVar named aString is referenced; |
|
1707 |
if modsOnly is true, browse only methods where the classvar is modified" |
|
1708 |
||
1709 |
^ self findClassRefsTo:aString in:(aClass withAllSubclasses) modificationsOnly:modsOnly |
|
1710 |
||
1711 |
! |
|
1712 |
||
2642 | 1713 |
findImplementorsOf:aSelectorString in:aCollectionOfClasses ignoreCase:ignoreCase |
1714 |
"search for all implementors of aSelector in |
|
1715 |
the classes contained in aCollectionOfClasses and its metaclasses. |
|
1716 |
Return a collection of methods" |
|
1717 |
||
1718 |
|list sel srchST srchJava lcSelector| |
|
1719 |
||
1720 |
list := IdentitySet new. |
|
1721 |
||
1722 |
((aSelectorString ~= '*') and:[aSelectorString includesMatchCharacters]) ifTrue:[ |
|
1723 |
"a matchString" |
|
1724 |
||
1725 |
ignoreCase == true ifTrue:[ |
|
1726 |
lcSelector := aSelectorString asLowercase. |
|
1727 |
||
1728 |
srchST := [:aSelector :aMethod | |
|
1729 |
(lcSelector match:aSelector asLowercase) ifTrue:[ |
|
1730 |
list add:aMethod |
|
1731 |
] |
|
1732 |
]. |
|
1733 |
srchJava := [:aSelector :aMethod | |
|
1734 |
(aSelector match:aMethod name asLowercase) ifTrue:[ |
|
1735 |
list add:aMethod |
|
1736 |
] |
|
1737 |
]. |
|
1738 |
] ifFalse:[ |
|
1739 |
srchST := [:aSelector :aMethod | |
|
1740 |
(aSelectorString match:aSelector) ifTrue:[ |
|
1741 |
list add:aMethod |
|
1742 |
] |
|
1743 |
]. |
|
1744 |
srchJava := [:aSelector :aMethod | |
|
1745 |
(aSelectorString match:aMethod name) ifTrue:[ |
|
1746 |
list add:aMethod |
|
1747 |
] |
|
1748 |
]. |
|
1749 |
]. |
|
1750 |
] ifFalse:[ |
|
1751 |
"can do a faster search" |
|
1752 |
||
1753 |
sel := aSelectorString asSymbolIfInterned. |
|
1754 |
sel isNil ifTrue:[ |
|
1755 |
^ nil |
|
1756 |
]. |
|
1757 |
||
1758 |
ignoreCase == true ifTrue:[ |
|
1759 |
lcSelector := sel asLowercase. |
|
1760 |
srchJava := [:aSelector :aMethod | |
|
1761 |
"/ allow search for signature AND |
|
1762 |
"/ search for plain name |
|
1763 |
((aMethod name asLowercase = lcSelector) |
|
1764 |
or:[aSelector asLowercase = lcSelector]) ifTrue:[ |
|
1765 |
list add:aMethod |
|
1766 |
] |
|
1767 |
]. |
|
1768 |
srchST := [:aSelector :aMethod | |
|
1769 |
(aSelector asLowercase = lcSelector) ifTrue:[ |
|
1770 |
list add:aMethod |
|
1771 |
] |
|
1772 |
]. |
|
1773 |
] ifFalse:[ |
|
1774 |
srchJava := [:aSelector :aMethod | |
|
1775 |
"/ allow search for signature AND |
|
1776 |
"/ search for plain name |
|
1777 |
((aMethod name = sel) |
|
1778 |
or:[aSelector == sel]) ifTrue:[ |
|
1779 |
list add:aMethod |
|
1780 |
] |
|
1781 |
]. |
|
1782 |
srchST := [:aSelector :aMethod | |
|
1783 |
(aSelector == sel) ifTrue:[ |
|
1784 |
list add:aMethod |
|
1785 |
] |
|
1786 |
]. |
|
1787 |
]. |
|
1788 |
]. |
|
1789 |
||
1790 |
aCollectionOfClasses do:[:aClass | |
|
1791 |
|srchBlock| |
|
1792 |
||
1793 |
aClass isObsolete ifFalse:[ |
|
1794 |
aClass isJavaClass ifTrue:[ |
|
1795 |
srchBlock := srchJava |
|
1796 |
] ifFalse:[ |
|
1797 |
srchBlock := srchST |
|
1798 |
]. |
|
1799 |
aClass methodDictionary keysAndValuesDo:srchBlock. |
|
1800 |
aClass isMeta ifFalse:[ |
|
1801 |
aClass class methodDictionary keysAndValuesDo:srchBlock |
|
1802 |
] |
|
1803 |
] |
|
1804 |
]. |
|
1805 |
||
1806 |
^ list |
|
1807 |
||
1808 |
" |
|
1809 |
SystemBrowser findImplementorsOf:#+ |
|
1810 |
in:(Array with:Number |
|
1811 |
with:Float |
|
1812 |
with:SmallInteger) |
|
1813 |
" |
|
1814 |
||
1815 |
! |
|
1816 |
||
2677 | 1817 |
findInstRefsTo:aString in:aCollectionOfClasses modificationsOnly:modsOnly |
2728 | 1818 |
"return all methods in aCollectionOfClasses where the instVar named |
2677 | 1819 |
aString is referenced; if modsOnly is true, browse only methods where the |
1820 |
instvar is modified" |
|
1821 |
||
1822 |
^ self findRefsTo:aString classVars:false in:aCollectionOfClasses modificationsOnly:modsOnly |
|
1823 |
! |
|
1824 |
||
2728 | 1825 |
findInstRefsTo:aString inClass:aClass modificationsOnly:modsOnly |
1826 |
"return all methods in aClass where the instVar named |
|
1827 |
aString is referenced; if modsOnly is true, browse only methods where the |
|
1828 |
instvar is modified" |
|
1829 |
||
1830 |
^ self findRefsTo:aString classVars:false in:(Array with:aClass) modificationsOnly:modsOnly |
|
1831 |
! |
|
1832 |
||
2677 | 1833 |
findInstRefsTo:aString under:aClass modificationsOnly:modsOnly |
1834 |
"return all methods in aClass and subclasses |
|
1835 |
where the instVar named aString is referenced; |
|
1836 |
if modsOnly is true, browse only methods where the instvar is modified" |
|
1837 |
||
1838 |
^ self findInstRefsTo:aString in:(aClass withAllSubclasses) modificationsOnly:modsOnly |
|
1839 |
! |
|
1840 |
||
1841 |
findRefsTo:varName classVars:classVars in:aCollectionOfClasses modificationsOnly:modsOnly |
|
1842 |
"return a list of all methods in aCollectionOfClasses where the instVar/classVar named |
|
1843 |
varName is referenced; |
|
1844 |
if modsOnly is true, browse only methods where the instvar is modified" |
|
1845 |
||
1846 |
|filter| |
|
1847 |
||
1848 |
filter := self filterToSearchRefsTo:varName classVars:classVars modificationsOnly:modsOnly. |
|
1849 |
^ self findMethodsIn:aCollectionOfClasses inst:true class:classVars where:filter. |
|
1850 |
||
1851 |
" |
|
1852 |
self |
|
1853 |
findRefsTo:'x' |
|
1854 |
classVars:false |
|
1855 |
in:(Array with:Point) |
|
1856 |
modificationsOnly:true |
|
1857 |
" |
|
1858 |
! |
|
1859 |
||
2692 | 1860 |
findResource:aResourceSymbolOrCollectionOfSymbols in:aCollectionOfClasses |
1861 |
"return a collection of all methods in aCollectionOfClasses |
|
1862 |
containing a resource." |
|
1863 |
||
1864 |
|searchBlock| |
|
1865 |
||
1866 |
aResourceSymbolOrCollectionOfSymbols isSymbol ifTrue:[ |
|
1867 |
searchBlock := [:c :m :sel | |resources| |
|
1868 |
(resources := m resources) size > 0 |
|
1869 |
and:[resources includesKey:aResourceSymbolOrCollectionOfSymbols] |
|
1870 |
]. |
|
1871 |
] ifFalse:[ |
|
1872 |
searchBlock := [:c :m :sel | |resources| |
|
1873 |
(resources := m resources) size > 0 |
|
1874 |
and:[resources keys includesAny:aResourceSymbolOrCollectionOfSymbols] |
|
1875 |
]. |
|
1876 |
]. |
|
1877 |
||
1878 |
^ self findMethodsIn:aCollectionOfClasses where:searchBlock. |
|
1879 |
||
1880 |
" |
|
1881 |
SystemBrowser findResource:#image in:(ApplicationModel withAllSubclasses) |
|
1882 |
SystemBrowser findResource:#menu in:(ApplicationModel withAllSubclasses) |
|
1883 |
SystemBrowser findResource:#(menu programMenu) in:(ApplicationModel withAllSubclasses) |
|
1884 |
" |
|
1885 |
! |
|
1886 |
||
2642 | 1887 |
findSendersOf:aSelectorString in:aCollectionOfClasses ignoreCase:ignoreCase |
1888 |
"search for all senders of aSelector in |
|
1889 |
the classes contained in aCollectionOfClasses and its metaclasses. |
|
1890 |
Return a collection of methods" |
|
1891 |
||
1892 |
^ self allCallsOn:aSelectorString in:aCollectionOfClasses ignoreCase:ignoreCase |
|
1893 |
||
1894 |
" |
|
1895 |
SystemBrowser findSendersOf:#+ |
|
1896 |
in:(Array with:Number |
|
1897 |
with:Float |
|
1898 |
with:SmallInteger) |
|
1899 |
ignoreCase:false |
|
1900 |
" |
|
1901 |
||
2675 | 1902 |
! |
1903 |
||
1904 |
findString:aString in:aCollectionOfClasses ignoreCase:ignoreCase |
|
1905 |
"return a colelction of all methods in aCollectionOfClasses |
|
1906 |
containing a string in their source. |
|
1907 |
This may be slow, since source-code has to be scanned." |
|
1908 |
||
1909 |
|browser searchBlock title s| |
|
1910 |
||
1911 |
(aString includesMatchCharacters |
|
1912 |
or:[ignoreCase]) ifTrue:[ |
|
1913 |
s := '*' , aString , '*'. |
|
1914 |
"a matchString" |
|
1915 |
searchBlock := [:c :m :sel | |
|
1916 |
|src| |
|
1917 |
src := m source. |
|
1918 |
src isNil ifTrue:[ |
|
1919 |
('Browser [info]: no source for ' , m printString) infoPrintCR. |
|
1920 |
false |
|
1921 |
] ifFalse:[ |
|
1922 |
s match:src ignoreCase:ignoreCase |
|
1923 |
] |
|
1924 |
] |
|
1925 |
] ifFalse:[ |
|
1926 |
searchBlock := [:c :m :sel | |
|
1927 |
|src| |
|
1928 |
||
1929 |
src := m source. |
|
1930 |
src isNil ifTrue:[ |
|
1931 |
('Browser [info]: no source for ' , m printString) infoPrintCR. |
|
1932 |
false |
|
1933 |
] ifFalse:[ |
|
1934 |
(src findString:aString) ~~ 0 |
|
1935 |
] |
|
1936 |
] |
|
1937 |
]. |
|
1938 |
^ self findMethodsIn:aCollectionOfClasses where:searchBlock. |
|
1939 |
||
1940 |
" |
|
1941 |
SystemBrowser findString:'should' in:(Array with:Object) ignoreCase:false |
|
1942 |
" |
|
203 | 1943 |
! ! |
1944 |
||
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
1945 |
!SystemBrowser class methodsFor:'startup'! |
36 | 1946 |
|
203 | 1947 |
browseAllSelect:aBlock |
1948 |
"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
|
1949 |
The block is called with 3 arguments, class, method and selector." |
203 | 1950 |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1951 |
^ self |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1952 |
browseMethodsWhere:aBlock |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1953 |
title:'selected messages' |
36 | 1954 |
|
53 | 1955 |
" |
203 | 1956 |
SystemBrowser browseAllSelect:[:aClass :aMethod :selector | selector numArgs == 3] |
53 | 1957 |
" |
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1958 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1959 |
"Modified: 24.1.1997 / 19:45:05 / cg" |
203 | 1960 |
! |
75 | 1961 |
|
203 | 1962 |
browseClass:aClass |
1963 |
"launch a browser for aClass" |
|
1964 |
||
1965 |
^ self |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1966 |
newWithLabel:aClass name |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1967 |
setupSelector:#setupForClass: |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1968 |
arg:aClass |
203 | 1969 |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1970 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1971 |
SystemBrowser browseClass:Object |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1972 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1973 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1974 |
"Modified: 24.1.1997 / 19:45:16 / cg" |
203 | 1975 |
! |
1976 |
||
1977 |
browseClass:aClass methodCategory:aCategory |
|
1978 |
"launch a browser for all methods under aCategory in aClass" |
|
1979 |
||
1980 |
^ self newWithLabel:(aClass name , ' ' , aCategory) |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1981 |
setupBlock:[:browser | browser setupForClass:aClass methodCategory:aCategory] |
203 | 1982 |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1983 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1984 |
SystemBrowser browseClass:String methodCategory:'copying' |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1985 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1986 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
1987 |
"Modified: 24.1.1997 / 19:45:23 / cg" |
203 | 1988 |
! |
1989 |
||
1990 |
browseClass:aClass selector:selector |
|
1991 |
"launch a browser for the method at selector in aClass" |
|
1992 |
||
1993 |
^ self |
|
1994 |
newWithLabel:(aClass name , ' ' , selector , ' ' , selector) |
|
1995 |
setupBlock:[:newBrowser | newBrowser setupForClass:aClass selector:selector] |
|
1996 |
||
1997 |
" |
|
1998 |
SystemBrowser browseClass:Object selector:#printString |
|
1999 |
" |
|
36 | 2000 |
! |
2001 |
||
203 | 2002 |
browseClassCategory:aClassCategory |
2003 |
"launch a browser for all classes under aCategory" |
|
2004 |
||
2005 |
^ self |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2006 |
newWithLabel:aClassCategory |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2007 |
setupSelector:#setupForClassCategory: |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2008 |
arg:aClassCategory |
203 | 2009 |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2010 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2011 |
SystemBrowser browseClassCategory:'Kernel-Objects' |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2012 |
" |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2013 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2014 |
"Modified: 24.1.1997 / 19:45:32 / cg" |
203 | 2015 |
! |
2016 |
||
2017 |
browseClassHierarchy:aClass |
|
2018 |
"launch a browser for aClass and all its superclasses. |
|
2019 |
this is different from the fullProtocol browser." |
|
36 | 2020 |
|
203 | 2021 |
^ self |
2022 |
newWithLabel:(aClass name , '-' , 'hierarchy') |
|
2023 |
setupSelector:#setupForClassHierarchy: |
|
2024 |
arg:aClass |
|
2025 |
||
2026 |
" |
|
2027 |
SystemBrowser browseClassHierarchy:Number |
|
2028 |
" |
|
2029 |
! |
|
2030 |
||
2031 |
browseClasses:aList title:title |
|
2032 |
"launch a browser for all classes in aList" |
|
2033 |
||
2034 |
^ self |
|
576
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
2035 |
newWithLabel:title |
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
2036 |
setupBlock:[:b | b setupForClassList:aList sort:true] |
203 | 2037 |
|
2038 |
" |
|
2039 |
SystemBrowser browseClasses:(Array with:Object |
|
576
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
2040 |
with:Float) |
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
2041 |
title:'two classes' |
203 | 2042 |
" |
576
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
2043 |
|
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
2044 |
"Modified: 28.5.1996 / 13:52:25 / cg" |
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
2045 |
! |
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
2046 |
|
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
2047 |
browseClasses:aList title:title sort:doSort |
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
2048 |
"launch a browser for all classes in aList" |
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
2049 |
|
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
2050 |
^ self |
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
2051 |
newWithLabel:title |
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
2052 |
setupBlock:[:b | b setupForClassList:aList sort:doSort] |
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
2053 |
|
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
2054 |
" |
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
2055 |
SystemBrowser browseClasses:(Array with:Object |
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
2056 |
with:Float) |
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
2057 |
title:'two classes' |
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
2058 |
" |
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
2059 |
|
62dc6c67d71c
show subclasses hierarchical (spawn subclasses)
Claus Gittinger <cg@exept.de>
parents:
573
diff
changeset
|
2060 |
"Created: 28.5.1996 / 13:52:09 / cg" |
52 | 2061 |
! |
2062 |
||
203 | 2063 |
browseFullClassProtocol:aClass |
2064 |
"launch a browser for aClasses full protocol. |
|
2065 |
This is different from hierarchy browsing." |
|
2066 |
||
2067 |
^ self |
|
2068 |
newWithLabel:(aClass name , '-' , 'full protocol') |
|
2069 |
setupSelector:#setupForFullClassProtocol: |
|
2070 |
arg:aClass |
|
2071 |
||
2072 |
" |
|
2073 |
SystemBrowser browseFullClassProtocol:Number |
|
2074 |
" |
|
2075 |
! |
|
36 | 2076 |
|
203 | 2077 |
browseFullClasses |
2078 |
"launch a browser showing all methods at once" |
|
2079 |
||
2080 |
^ self |
|
2081 |
newWithLabel:'Full Class Browser' |
|
2082 |
setupBlock:[:newBrowser | newBrowser setupForFullClass] |
|
36 | 2083 |
|
203 | 2084 |
"SystemBrowser browseFullClasses" |
2085 |
! |
|
2086 |
||
2087 |
browseInstMethodsFrom:aClass where:aBlock title:title |
|
2088 |
"launch a browser for all instance methods in aClass and all subclasses |
|
2089 |
where aBlock evaluates to true" |
|
36 | 2090 |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2091 |
^ self |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2092 |
browseMethodsIn:(aClass withAllSubclasses) |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2093 |
inst:true |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2094 |
class:false |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2095 |
where:aBlock |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2096 |
title:title |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2097 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2098 |
"Modified: 24.1.1997 / 19:44:45 / cg" |
203 | 2099 |
! |
2100 |
||
2101 |
browseInstMethodsIn:aCollectionOfClasses where:aBlock title:title |
|
2102 |
"launch a browser for all instance methods of all classes in |
|
2103 |
aCollectionOfClasses where aBlock evaluates to true" |
|
2104 |
||
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2105 |
^ self |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2106 |
browseMethodsIn:aCollectionOfClasses |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2107 |
inst:true class:false |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2108 |
where:aBlock title:title |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2109 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2110 |
"Modified: 24.1.1997 / 19:43:41 / cg" |
203 | 2111 |
! |
36 | 2112 |
|
203 | 2113 |
browseInstMethodsOf:aClass where:aBlock title:title |
2114 |
"launch a browser for all instance methods in aClass |
|
2115 |
where aBlock evaluates to true" |
|
2116 |
||
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2117 |
^ self |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2118 |
browseMethodsIn:(Array with:aClass) |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2119 |
inst:true |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2120 |
class:false |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2121 |
where:aBlock title:title |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2122 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2123 |
"Modified: 24.1.1997 / 19:43:50 / cg" |
203 | 2124 |
! |
2125 |
||
2126 |
browseMethodCategory:aCategory |
|
2127 |
"launch a browser for all methods where category = aCategory" |
|
2128 |
||
2129 |
|searchBlock| |
|
2130 |
||
2131 |
aCategory includesMatchCharacters ifTrue:[ |
|
2132 |
searchBlock := [:c :m :s | aCategory match:m category]. |
|
53 | 2133 |
] ifFalse:[ |
203 | 2134 |
searchBlock := [:c :m :s | m category = aCategory] |
53 | 2135 |
]. |
2136 |
||
203 | 2137 |
self browseMethodsWhere:searchBlock title:('all methods with category of ' , aCategory) |
2138 |
||
2139 |
" |
|
2140 |
SystemBrowser browseMethodCategory:'printing & storing' |
|
2141 |
SystemBrowser browseMethodCategory:'print*' |
|
2142 |
" |
|
2143 |
! |
|
2144 |
||
2145 |
browseMethods:aList title:aString |
|
2146 |
"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
|
2147 |
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
|
2148 |
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
|
2149 |
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
|
2150 |
|
1919
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2151 |
^ self |
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2152 |
browseMethods:aList |
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2153 |
title:aString |
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2154 |
sort:true |
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2155 |
|
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2156 |
|
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2157 |
" |
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2158 |
SystemBrowser |
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2159 |
browseMethods:#('Object printOn:' 'Collection add:') |
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2160 |
title:'some methods' |
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2161 |
|
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2162 |
SystemBrowser |
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2163 |
browseMethods:#('Behavior new:' 'Setclass new:') |
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2164 |
title:'some new: methods' |
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2165 |
|
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2166 |
SystemBrowser |
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2167 |
browseMethods:(Array with:(Object compiledMethodAt:#printOn:) |
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2168 |
with:(Collection compiledMethodAt:#add:) |
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2169 |
with:(Object class compiledMethodAt:#initialize)) |
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2170 |
title:'some methods' |
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2171 |
|
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2172 |
" |
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2173 |
|
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2174 |
"Modified: 1.11.1996 / 16:30:17 / cg" |
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2175 |
! |
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2176 |
|
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2177 |
browseMethods:aList title:aString sort:doSort |
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2178 |
"launch a browser for an explicit list of class/selectors. |
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2179 |
Each entry in the list can be either a method, or a string |
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2180 |
consisting of the classes name and the selector, separated by spaces. |
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2181 |
For class methods, the string ' class' must be appended to the classname." |
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2182 |
|
279
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
2183 |
|l| |
203 | 2184 |
|
2185 |
(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
|
2186 |
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
|
2187 |
^ nil |
203 | 2188 |
]. |
279
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
2189 |
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
|
2190 |
l := l collect:[:entry | |
1937
fc541342f2db
more support for java code (implementors)
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
2191 |
|who cls clsName| |
279
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
2192 |
|
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
2193 |
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
|
2194 |
entry |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
2195 |
] ifFalse:[ |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
2196 |
who := entry who. |
1031 | 2197 |
who isNil ifTrue:[ |
2198 |
'??? unbound' |
|
2199 |
] ifFalse:[ |
|
1937
fc541342f2db
more support for java code (implementors)
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
2200 |
cls := who methodClass. |
fc541342f2db
more support for java code (implementors)
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
2201 |
cls isNil ifTrue:[ |
fc541342f2db
more support for java code (implementors)
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
2202 |
'??? unbound' |
fc541342f2db
more support for java code (implementors)
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
2203 |
] ifFalse:[ |
fc541342f2db
more support for java code (implementors)
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
2204 |
cls isJavaClass ifTrue:[ |
fc541342f2db
more support for java code (implementors)
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
2205 |
clsName := 'JAVA::' , cls fullName |
fc541342f2db
more support for java code (implementors)
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
2206 |
] ifFalse:[ |
fc541342f2db
more support for java code (implementors)
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
2207 |
clsName := cls name |
fc541342f2db
more support for java code (implementors)
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
2208 |
]. |
fc541342f2db
more support for java code (implementors)
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
2209 |
clsName |
fc541342f2db
more support for java code (implementors)
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
2210 |
, ' ' |
fc541342f2db
more support for java code (implementors)
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
2211 |
, (entry printStringForBrowserWithSelector:(who methodSelector)) |
fc541342f2db
more support for java code (implementors)
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
2212 |
] |
1031 | 2213 |
] |
279
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
2214 |
] |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
2215 |
]. |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
2216 |
|
1919
0652e55065f9
added sort option to #browserMethods:
Claus Gittinger <cg@exept.de>
parents:
1703
diff
changeset
|
2217 |
doSort ifTrue:[l sort]. |
1937
fc541342f2db
more support for java code (implementors)
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
2218 |
|
203 | 2219 |
^ 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
|
2220 |
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
|
2221 |
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
|
2222 |
arg:l |
53 | 2223 |
|
203 | 2224 |
" |
2225 |
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
|
2226 |
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
|
2227 |
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
|
2228 |
|
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
2229 |
SystemBrowser |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
2230 |
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
|
2231 |
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
|
2232 |
|
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
2233 |
SystemBrowser |
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
2234 |
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
|
2235 |
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
|
2236 |
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
|
2237 |
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
|
2238 |
|
203 | 2239 |
" |
279
062022b53f22
allow browseMethods to be passed a collection of methodObjects (in addition to strings)
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
2240 |
|
1937
fc541342f2db
more support for java code (implementors)
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
2241 |
"Modified: / 17.6.1996 / 17:07:46 / stefan" |
fc541342f2db
more support for java code (implementors)
Claus Gittinger <cg@exept.de>
parents:
1931
diff
changeset
|
2242 |
"Modified: / 17.10.1998 / 11:25:53 / cg" |
203 | 2243 |
! |
53 | 2244 |
|
203 | 2245 |
browseMethodsFrom:aClass where:aBlock title:title |
2246 |
"launch a browser for all instance- and classmethods in aClass |
|
2247 |
and all its subclasses where aBlock evaluates to true. |
|
2248 |
The block is called with 3 arguments, class, method and seelctor." |
|
2249 |
||
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2250 |
^ self |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2251 |
browseMethodsIn:(aClass withAllSubclasses) |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2252 |
where:aBlock |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2253 |
title:title |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2254 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2255 |
"Modified: 24.1.1997 / 19:44:00 / cg" |
203 | 2256 |
! |
2257 |
||
2258 |
browseMethodsIn:aCollectionOfClasses inst:wantInst class:wantClass where:aBlock title:title |
|
2259 |
"launch a browser for all instance- (if wantInst is true) and/or |
|
2260 |
classmethods (if wantClass is true) from classes in aCollectionOfClasses, |
|
2261 |
where aBlock evaluates to true. |
|
270 | 2262 |
The block is called with 3 arguments, class, method and selector." |
203 | 2263 |
|
2264 |
|list| |
|
53 | 2265 |
|
2266 |
" |
|
203 | 2267 |
since this may take a long time, lower my priority ... |
53 | 2268 |
" |
2295
4e05198e7dd8
execute BG tasks at a prio range, to ensure progress.
Claus Gittinger <cg@exept.de>
parents:
2208
diff
changeset
|
2269 |
Processor activeProcess |
4e05198e7dd8
execute BG tasks at a prio range, to ensure progress.
Claus Gittinger <cg@exept.de>
parents:
2208
diff
changeset
|
2270 |
withPriority:Processor activePriority-1 to:Processor activePriority |
4e05198e7dd8
execute BG tasks at a prio range, to ensure progress.
Claus Gittinger <cg@exept.de>
parents:
2208
diff
changeset
|
2271 |
do:[ |
2675 | 2272 |
list := self findMethodsIn:aCollectionOfClasses inst:wantInst class:wantClass where:aBlock |
203 | 2273 |
]. |
2274 |
^ self browseMethods:list title:title |
|
53 | 2275 |
! |
2276 |
||
203 | 2277 |
browseMethodsIn:aCollectionOfClasses where:aBlock title:title |
2278 |
"launch a browser for all instance- and classmethods from |
|
2279 |
all classes in aCollectionOfClasses where aBlock evaluates to true. |
|
2280 |
The block is called with 3 arguments, class, method and seelctor." |
|
53 | 2281 |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2282 |
^ self |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2283 |
browseMethodsIn:aCollectionOfClasses |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2284 |
inst:true |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2285 |
class:true |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2286 |
where:aBlock |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2287 |
title:title |
75 | 2288 |
|
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2289 |
"Modified: 24.1.1997 / 19:44:17 / cg" |
36 | 2290 |
! |
2291 |
||
203 | 2292 |
browseMethodsOf:aClass where:aBlock title:title |
2293 |
"launch a browser for all instance- and classmethods in aClass |
|
2294 |
where aBlock evaluates to true. |
|
2295 |
The block is called with 3 arguments, class, method and seelctor." |
|
93 | 2296 |
|
203 | 2297 |
^ self browseMethodsIn:(Array with:aClass) where:aBlock title:title |
93 | 2298 |
! |
2299 |
||
203 | 2300 |
browseMethodsWhere:aBlock title:title |
2301 |
"launch a browser for all methods where aBlock returns true. |
|
2302 |
The block is called with 3 arguments, class, method and seelctor." |
|
2303 |
||
996
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2304 |
^ self |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2305 |
browseMethodsIn:(Smalltalk allClasses) |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2306 |
where:aBlock |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2307 |
title:title |
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2308 |
|
ed470d0b6029
more generic browseAll protocol;
Claus Gittinger <cg@exept.de>
parents:
929
diff
changeset
|
2309 |
"Modified: 24.1.1997 / 19:44:30 / cg" |
2675 | 2310 |
! |
2311 |
||
2312 |
findMethodsIn:aCollectionOfClasses inst:wantInst class:wantClass where:aBlock |
|
2313 |
"return all instance- (if wantInst is true) and/or classmethods (if wantClass is true) |
|
2314 |
from classes in aCollectionOfClasses, where aBlock evaluates to true." |
|
2315 |
||
2316 |
|list checkedClasses checkBlock| |
|
2317 |
||
2318 |
checkedClasses := IdentitySet new. |
|
2319 |
list := OrderedCollection new. |
|
2320 |
||
2321 |
checkBlock := [:cls | |
|
2322 |
(checkedClasses includes:cls) ifFalse:[ |
|
2323 |
cls isObsolete ifTrue:[ |
|
2324 |
Transcript showCR:'skipping obsolete class: ' , cls displayString |
|
2325 |
] ifFalse:[ |
|
2326 |
cls methodDictionary keysAndValuesDo:[:sel :method | |
|
2327 |
(aBlock value:cls value:method value:sel) ifTrue:[ |
|
2328 |
list add:method "/ (cls name , ' ' , sel) |
|
2329 |
] |
|
2330 |
]. |
|
2331 |
checkedClasses add:cls. |
|
2332 |
] |
|
2333 |
] |
|
2334 |
]. |
|
2335 |
||
2336 |
aCollectionOfClasses do:[:aClass | |
|
2337 |
aClass isObsolete ifFalse:[ |
|
2338 |
" |
|
2339 |
output disabled - it slows down things too much (when searching for |
|
2340 |
implementors or senders) |
|
2341 |
" |
|
2342 |
wantInst ifTrue:[ |
|
2343 |
"/ Transcript show:'searching '; show:aClass name; showCR:' ...'; endEntry. |
|
2344 |
checkBlock value:aClass |
|
2345 |
]. |
|
2346 |
wantClass ifTrue:[ |
|
2347 |
"/ Transcript show:'searching '; show:aClass class name; showCR:' ...'; endEntry. |
|
2348 |
checkBlock value:(aClass class) |
|
2349 |
]. |
|
2350 |
Processor yield |
|
2351 |
] |
|
2352 |
]. |
|
2353 |
^ list |
|
2354 |
! |
|
2355 |
||
2356 |
findMethodsIn:aCollectionOfClasses where:aBlock |
|
2357 |
"return all instance- and classmethods |
|
2358 |
from classes in aCollectionOfClasses, where aBlock evaluates to true." |
|
2359 |
||
2360 |
^ self |
|
2361 |
findMethodsIn:aCollectionOfClasses |
|
2362 |
inst:true |
|
2363 |
class:true |
|
2364 |
where:aBlock |
|
203 | 2365 |
! ! |
93 | 2366 |
|
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
2367 |
!SystemBrowser class methodsFor:'startup with query'! |
203 | 2368 |
|
2369 |
askThenBrowseClass |
|
2370 |
self getClassThenPerform:#browseClass: |
|
2371 |
||
2372 |
" |
|
2373 |
SystemBrowser askThenBrowseClass |
|
2374 |
" |
|
93 | 2375 |
! |
2376 |
||
203 | 2377 |
askThenBrowseClassHierarchy |
2378 |
self getClassThenPerform:#browseClassHierarchy: |
|
36 | 2379 |
|
203 | 2380 |
" |
2381 |
SystemBrowser askThenBrowseClassHierarchy |
|
2382 |
" |
|
36 | 2383 |
! |
2384 |
||
203 | 2385 |
askThenBrowseFullClassProtocol |
2386 |
self getClassThenPerform:#browseFullClassProtocol: |
|
36 | 2387 |
|
203 | 2388 |
" |
2389 |
SystemBrowser askThenBrowseFullClassProtocol |
|
2390 |
" |
|
52 | 2391 |
! |
2392 |
||
203 | 2393 |
getClassThenPerform:aSelector |
2729
9af04074a4bb
no direct access to super-class-instvars
Claus Gittinger <cg@exept.de>
parents:
2728
diff
changeset
|
2394 |
|enterBox resources| |
9af04074a4bb
no direct access to super-class-instvars
Claus Gittinger <cg@exept.de>
parents:
2728
diff
changeset
|
2395 |
|
9af04074a4bb
no direct access to super-class-instvars
Claus Gittinger <cg@exept.de>
parents:
2728
diff
changeset
|
2396 |
resources := self classResources. |
52 | 2397 |
|
203 | 2398 |
enterBox := EnterBox title:(self classResources at:'Browse which class:') withCRs. |
2729
9af04074a4bb
no direct access to super-class-instvars
Claus Gittinger <cg@exept.de>
parents:
2728
diff
changeset
|
2399 |
enterBox okText:(resources at:'browse'). |
203 | 2400 |
enterBox entryCompletionBlock:[:contents | |
2729
9af04074a4bb
no direct access to super-class-instvars
Claus Gittinger <cg@exept.de>
parents:
2728
diff
changeset
|
2401 |
|s what m| |
9af04074a4bb
no direct access to super-class-instvars
Claus Gittinger <cg@exept.de>
parents:
2728
diff
changeset
|
2402 |
|
9af04074a4bb
no direct access to super-class-instvars
Claus Gittinger <cg@exept.de>
parents:
2728
diff
changeset
|
2403 |
s := contents withoutSpaces. |
9af04074a4bb
no direct access to super-class-instvars
Claus Gittinger <cg@exept.de>
parents:
2728
diff
changeset
|
2404 |
what := Smalltalk classnameCompletion:s. |
9af04074a4bb
no direct access to super-class-instvars
Claus Gittinger <cg@exept.de>
parents:
2728
diff
changeset
|
2405 |
enterBox contents:what first. |
203 | 2406 |
]. |
2407 |
enterBox action:[:className | |
|
2729
9af04074a4bb
no direct access to super-class-instvars
Claus Gittinger <cg@exept.de>
parents:
2728
diff
changeset
|
2408 |
|cls| |
9af04074a4bb
no direct access to super-class-instvars
Claus Gittinger <cg@exept.de>
parents:
2728
diff
changeset
|
2409 |
|
9af04074a4bb
no direct access to super-class-instvars
Claus Gittinger <cg@exept.de>
parents:
2728
diff
changeset
|
2410 |
cls := Smalltalk classNamed:className. |
9af04074a4bb
no direct access to super-class-instvars
Claus Gittinger <cg@exept.de>
parents:
2728
diff
changeset
|
2411 |
cls isNil ifTrue:[ |
9af04074a4bb
no direct access to super-class-instvars
Claus Gittinger <cg@exept.de>
parents:
2728
diff
changeset
|
2412 |
self warn:(resources at:'no such class'). |
9af04074a4bb
no direct access to super-class-instvars
Claus Gittinger <cg@exept.de>
parents:
2728
diff
changeset
|
2413 |
] ifFalse:[ |
9af04074a4bb
no direct access to super-class-instvars
Claus Gittinger <cg@exept.de>
parents:
2728
diff
changeset
|
2414 |
self perform:aSelector with:cls |
9af04074a4bb
no direct access to super-class-instvars
Claus Gittinger <cg@exept.de>
parents:
2728
diff
changeset
|
2415 |
] |
203 | 2416 |
]. |
2417 |
enterBox showAtPointer |
|
75 | 2418 |
|
203 | 2419 |
" |
2420 |
SystemBrowser getClassThenPerform:#browseClass: |
|
2421 |
" |
|
36 | 2422 |
! ! |
2423 |
||
820
2a412afad51d
fixed autoSearch, when searching for a private-classes name
Claus Gittinger <cg@exept.de>
parents:
742
diff
changeset
|
2424 |
!SystemBrowser class methodsFor:'documentation'! |
93 | 2425 |
|
203 | 2426 |
version |
2729
9af04074a4bb
no direct access to super-class-instvars
Claus Gittinger <cg@exept.de>
parents:
2728
diff
changeset
|
2427 |
^ '$Header: /cvs/stx/stx/libtool/SystemBrowser.st,v 1.109 2000-08-22 11:27:40 cg Exp $' |
36 | 2428 |
! ! |
203 | 2429 |
SystemBrowser initialize! |