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