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