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