author | Stefan Vogel <sv@exept.de> |
Tue, 20 Feb 2018 21:52:40 +0100 | |
changeset 3541 | 23028559b7b2 |
parent 3514 | d3a2e53f3d57 |
child 3544 | 5d127d65ea3e |
permissions | -rw-r--r-- |
3292 | 1 |
" |
2 |
Copyright (C) Original Authors (Kaehler, Scott Wallace and Dan Ingalls) |
|
3 |
Copyright (C) 2001 eXept Software AG |
|
4 |
||
5 |
Permission is hereby granted, free of charge, to any |
|
6 |
person obtaining a copy of this software and associated |
|
7 |
documentation files (the 'Software'), to deal in the |
|
8 |
Software without restriction, including without limitation |
|
9 |
the rights to use, copy, modify, merge, publish, distribute, |
|
10 |
sublicense, and/or sell copies of the Software, and to |
|
11 |
permit persons to whom the Software is furnished to do so, |
|
12 |
subject to the following conditions: |
|
13 |
||
14 |
The above copyright notice and this permission notice shall |
|
15 |
be included in all copies or substantial portions of the Software. |
|
16 |
||
17 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
18 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
19 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
|
20 |
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
|
21 |
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
|
22 |
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
|
23 |
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
24 |
" |
|
1522 | 25 |
"{ Package: 'stx:libtool2' }" |
26 |
||
3193 | 27 |
"{ NameSpace: Smalltalk }" |
28 |
||
1522 | 29 |
ApplicationModel subclass:#MethodFinderWindow |
3292 | 30 |
instanceVariableNames:'resultHolder selectorPatternHolder classOfResultHolder |
31 |
selectedClassOfResultHolder selectedImplementorsHolder |
|
32 |
argumentsEditor messageAnswerEditor receiverEditor receiver |
|
1522 | 33 |
resultSelectors arg2BoxVisible arg1BoxVisible arg4BoxVisible |
34 |
arg3BoxVisible argCountHolder argCountList argument1Editor |
|
35 |
argument2Editor argument3Editor argument4Editor resultSelected |
|
2891 | 36 |
lookAtResultEditor codeHolder searchProcess' |
1522 | 37 |
classVariableNames:'' |
38 |
poolDictionaries:'' |
|
3215 | 39 |
category:'Interface-Tools' |
1522 | 40 |
! |
41 |
||
1530 | 42 |
!MethodFinderWindow class methodsFor:'documentation'! |
43 |
||
3292 | 44 |
copyright |
45 |
" |
|
46 |
Copyright (C) Original Authors (Kaehler, Scott Wallace and Dan Ingalls) |
|
47 |
Copyright (C) 2001 eXept Software AG |
|
48 |
||
49 |
Permission is hereby granted, free of charge, to any |
|
50 |
person obtaining a copy of this software and associated |
|
51 |
documentation files (the 'Software'), to deal in the |
|
52 |
Software without restriction, including without limitation |
|
53 |
the rights to use, copy, modify, merge, publish, distribute, |
|
54 |
sublicense, and/or sell copies of the Software, and to |
|
55 |
permit persons to whom the Software is furnished to do so, |
|
56 |
subject to the following conditions: |
|
57 |
||
58 |
The above copyright notice and this permission notice shall |
|
59 |
be included in all copies or substantial portions of the Software. |
|
60 |
||
61 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
62 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
63 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
|
64 |
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
|
65 |
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
|
66 |
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
|
67 |
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
68 |
" |
|
69 |
! |
|
70 |
||
1530 | 71 |
documentation |
72 |
" |
|
3292 | 73 |
a tool to find implementing methods by example. |
74 |
Give it values for a receiver, optional arguments and a desired result, |
|
75 |
and it will find methods which do that for you. |
|
76 |
Please read the online documentation for details (open via the tool's help menu). |
|
77 |
||
1531 | 78 |
[author:] |
3292 | 79 |
original squeak version by Ted Kaehler, Scott Wallace and Dan Ingalls. |
80 |
ported from Squeak and GUI enhanced 2001 by James Hayes james@exept.de. |
|
81 |
improved by Claus Gittinger. |
|
1530 | 82 |
" |
83 |
! ! |
|
1522 | 84 |
|
1532 | 85 |
!MethodFinderWindow class methodsFor:'constants'! |
86 |
||
2890 | 87 |
defaultIcon |
3109
92920c76aae3
Mark program icons with resource
Stefan Vogel <sv@exept.de>
parents:
3090
diff
changeset
|
88 |
<resource: #programImage> |
92920c76aae3
Mark program icons with resource
Stefan Vogel <sv@exept.de>
parents:
3090
diff
changeset
|
89 |
|
2890 | 90 |
^ ToolbarIconLibrary methodFinder24x24Icon |
91 |
||
92 |
"Created: / 01-06-2012 / 13:05:11 / cg" |
|
93 |
! |
|
94 |
||
1532 | 95 |
markerForImplementingClass |
96 |
^ '=> '. |
|
97 |
^ '*' |
|
98 |
||
99 |
"Created: / 13.11.2001 / 12:09:52 / cg" |
|
100 |
"Modified: / 13.11.2001 / 12:11:57 / cg" |
|
101 |
! ! |
|
102 |
||
3292 | 103 |
!MethodFinderWindow class methodsFor:'help specs'! |
104 |
||
3514 | 105 |
helpSpec |
3292 | 106 |
"This resource specification was automatically generated |
107 |
by the UIHelpTool of ST/X." |
|
108 |
||
109 |
"Do not manually edit this!! If it is corrupted, |
|
110 |
the UIHelpTool may not be able to read the specification." |
|
111 |
||
112 |
" |
|
113 |
UIHelpTool openOnClass:MethodFinderWindow |
|
114 |
" |
|
115 |
||
116 |
<resource: #help> |
|
117 |
||
3514 | 118 |
^ super helpSpec addPairsFrom:#( |
3292 | 119 |
|
120 |
#receiverValue |
|
121 |
'Enter a receiver value here.\Can be a constant (like ''hello'')\or an expression, such as "Rectangle basicNew".' |
|
122 |
||
123 |
#answerValue |
|
124 |
'Enter result value here.\Can be a constant (like ''hello'')\or an expression, such as "Rectangle basicNew".' |
|
125 |
||
126 |
#arg1Value |
|
127 |
'Enter a value for the first argument here.\Can be a constant or an expression.' |
|
128 |
||
129 |
#arg2Value |
|
130 |
'Enter a value for the second argument here.\Can be a constant or an expression.' |
|
131 |
||
132 |
#arg3Value |
|
133 |
'Enter a value for the third argument here.\Can be a constant or an expression.' |
|
134 |
||
135 |
#argumentCount |
|
136 |
'Specify the number of arguments here.' |
|
137 |
||
138 |
#clearButton |
|
139 |
'Clear all sample value fields.' |
|
140 |
||
141 |
#startSearchButton |
|
142 |
'Search for methods which answer the desired value,\given the concrete arguments' |
|
143 |
||
144 |
#selectorPatternSearch |
|
145 |
'Search by name.\You can use match characters '*' as in GLOB patterns (i.e. like filename patterns)' |
|
146 |
||
147 |
) |
|
148 |
! ! |
|
149 |
||
1522 | 150 |
!MethodFinderWindow class methodsFor:'interface specs'! |
151 |
||
152 |
windowSpec |
|
153 |
"This resource specification was automatically generated |
|
154 |
by the UIPainter of ST/X." |
|
155 |
||
156 |
"Do not manually edit this!! If it is corrupted, |
|
157 |
the UIPainter may not be able to read the specification." |
|
158 |
||
159 |
" |
|
160 |
UIPainter new openOnClass:MethodFinderWindow andSelector:#windowSpec |
|
161 |
MethodFinderWindow new openInterface:#windowSpec |
|
162 |
MethodFinderWindow open |
|
163 |
" |
|
164 |
||
165 |
<resource: #canvas> |
|
166 |
||
167 |
^ |
|
3289 | 168 |
#(FullSpec |
169 |
name: windowSpec |
|
170 |
window: |
|
171 |
(WindowSpec |
|
172 |
label: 'MethodFinder' |
|
173 |
name: 'MethodFinder' |
|
3301 | 174 |
bounds: (Rectangle 0 0 816 738) |
175 |
menu: menu |
|
176 |
icon: defaultIcon |
|
177 |
) |
|
178 |
component: |
|
179 |
(SpecCollection |
|
180 |
collection: ( |
|
181 |
(VariableHorizontalPanelSpec |
|
182 |
name: 'VariableHorizontalPanel1' |
|
183 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
184 |
showHandle: true |
|
185 |
snapMode: both |
|
186 |
component: |
|
187 |
(SpecCollection |
|
188 |
collection: ( |
|
189 |
(VariableVerticalPanelSpec |
|
190 |
name: 'LeftBox' |
|
191 |
showHandle: true |
|
192 |
component: |
|
193 |
(SpecCollection |
|
194 |
collection: ( |
|
195 |
(ViewSpec |
|
196 |
name: 'MethodFinderBox' |
|
197 |
component: |
|
198 |
(SpecCollection |
|
199 |
collection: ( |
|
200 |
(ViewSpec |
|
201 |
name: 'ReceiverArgBox' |
|
202 |
layout: (LayoutFrame 0 0 0 0 0 1 -30 1) |
|
203 |
component: |
|
204 |
(SpecCollection |
|
205 |
collection: ( |
|
206 |
(LabelSpec |
|
207 |
label: 'Receiver' |
|
208 |
name: 'ReceiverLabel' |
|
209 |
layout: (LayoutFrame 0 0 0 0 0 0.34000000000000002 28 0) |
|
210 |
translateLabel: true |
|
211 |
) |
|
212 |
(ComboListSpec |
|
213 |
name: 'allowedArgments' |
|
214 |
layout: (LayoutFrame 0 0.34000000000000002 1 0 0 0.64000000000000135 28 0) |
|
215 |
activeHelpKey: argumentCount |
|
216 |
model: argCountHolder |
|
217 |
comboList: argCountList |
|
218 |
useIndex: true |
|
219 |
) |
|
220 |
(LabelSpec |
|
221 |
label: 'Answer' |
|
222 |
name: 'MessageAnswerLabel' |
|
223 |
layout: (LayoutFrame 0 0.64000000000000135 0 0 0 1 28 0) |
|
224 |
activeHelpKey: arg1Value |
|
225 |
translateLabel: true |
|
226 |
) |
|
227 |
(HorizontalPanelViewSpec |
|
228 |
name: 'HorizontalPanel1' |
|
229 |
layout: (LayoutFrame 0 0 30 0 0 1 0 1) |
|
230 |
horizontalLayout: fit |
|
231 |
verticalLayout: fit |
|
232 |
horizontalSpace: 3 |
|
233 |
verticalSpace: 3 |
|
234 |
component: |
|
235 |
(SpecCollection |
|
236 |
collection: ( |
|
237 |
(WorkspaceSpec |
|
238 |
name: 'ReceiverEditor' |
|
239 |
activeHelpKey: receiverValue |
|
240 |
tabable: true |
|
241 |
hasHorizontalScrollBar: true |
|
242 |
hasVerticalScrollBar: true |
|
243 |
miniScrollerHorizontal: true |
|
244 |
miniScrollerVertical: true |
|
245 |
autoHideScrollBars: true |
|
246 |
hasKeyboardFocusInitially: false |
|
247 |
extent: (Point 85 142) |
|
248 |
postBuildCallback: receiverWidgetCreated: |
|
249 |
) |
|
250 |
(VerticalPanelViewSpec |
|
251 |
name: 'VerticalPanel1' |
|
252 |
horizontalLayout: fit |
|
253 |
verticalLayout: fit |
|
254 |
horizontalSpace: 3 |
|
255 |
verticalSpace: 3 |
|
256 |
component: |
|
257 |
(SpecCollection |
|
258 |
collection: ( |
|
259 |
(ViewSpec |
|
260 |
name: 'Box1' |
|
261 |
visibilityChannel: arg1BoxVisible |
|
262 |
component: |
|
263 |
(SpecCollection |
|
264 |
collection: ( |
|
265 |
(WorkspaceSpec |
|
266 |
name: 'Arg1Editor' |
|
267 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
268 |
activeHelpKey: arg1Value |
|
269 |
tabable: true |
|
270 |
hasHorizontalScrollBar: true |
|
271 |
hasVerticalScrollBar: true |
|
272 |
miniScrollerHorizontal: true |
|
273 |
miniScrollerVertical: true |
|
274 |
autoHideScrollBars: true |
|
275 |
hasKeyboardFocusInitially: false |
|
276 |
postBuildCallback: argument1WidgetCreated: |
|
277 |
) |
|
278 |
) |
|
279 |
||
280 |
) |
|
281 |
extent: (Point 86 45) |
|
282 |
) |
|
283 |
(ViewSpec |
|
284 |
name: 'Box2' |
|
285 |
visibilityChannel: arg2BoxVisible |
|
286 |
component: |
|
287 |
(SpecCollection |
|
288 |
collection: ( |
|
289 |
(WorkspaceSpec |
|
290 |
name: 'TextEditor5' |
|
291 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
292 |
activeHelpKey: arg2Value |
|
293 |
tabable: true |
|
294 |
hasHorizontalScrollBar: true |
|
295 |
hasVerticalScrollBar: true |
|
296 |
miniScrollerHorizontal: true |
|
297 |
miniScrollerVertical: true |
|
298 |
autoHideScrollBars: true |
|
299 |
hasKeyboardFocusInitially: false |
|
300 |
postBuildCallback: argument2WidgetCreated: |
|
301 |
) |
|
302 |
) |
|
303 |
||
304 |
) |
|
305 |
extent: (Point 86 46) |
|
306 |
) |
|
307 |
(ViewSpec |
|
308 |
name: 'Box3' |
|
309 |
visibilityChannel: arg3BoxVisible |
|
310 |
component: |
|
311 |
(SpecCollection |
|
312 |
collection: ( |
|
313 |
(WorkspaceSpec |
|
314 |
name: 'TextEditor6' |
|
315 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
316 |
activeHelpKey: arg3Value |
|
317 |
tabable: true |
|
318 |
hasHorizontalScrollBar: true |
|
319 |
hasVerticalScrollBar: true |
|
320 |
miniScrollerHorizontal: true |
|
321 |
miniScrollerVertical: true |
|
322 |
autoHideScrollBars: true |
|
323 |
hasKeyboardFocusInitially: false |
|
324 |
postBuildCallback: argument3WidgetCreated: |
|
325 |
) |
|
326 |
) |
|
327 |
||
328 |
) |
|
329 |
extent: (Point 86 45) |
|
330 |
) |
|
331 |
) |
|
332 |
||
333 |
) |
|
334 |
extent: (Point 86 142) |
|
335 |
) |
|
336 |
(WorkspaceSpec |
|
337 |
name: 'AnswerEditor' |
|
338 |
activeHelpKey: answerValue |
|
339 |
tabable: true |
|
340 |
hasHorizontalScrollBar: true |
|
341 |
hasVerticalScrollBar: true |
|
342 |
miniScrollerHorizontal: true |
|
343 |
miniScrollerVertical: true |
|
344 |
autoHideScrollBars: true |
|
345 |
hasKeyboardFocusInitially: false |
|
346 |
extent: (Point 86 142) |
|
347 |
postBuildCallback: messageAnswerWidgetCreated: |
|
348 |
) |
|
349 |
) |
|
350 |
||
351 |
) |
|
352 |
) |
|
353 |
) |
|
354 |
||
355 |
) |
|
356 |
) |
|
357 |
(ViewSpec |
|
358 |
name: 'ReceiverArgBoxActionBox' |
|
359 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
|
360 |
component: |
|
361 |
(SpecCollection |
|
362 |
collection: ( |
|
363 |
(ActionButtonSpec |
|
364 |
label: 'Clear' |
|
365 |
name: 'Button2' |
|
366 |
layout: (LayoutFrame 5 0 0 0 -5 0.5 0 1) |
|
367 |
activeHelpKey: clearButton |
|
368 |
translateLabel: true |
|
369 |
model: clear |
|
370 |
) |
|
371 |
(ActionButtonSpec |
|
372 |
label: 'Search' |
|
373 |
name: 'Button1' |
|
374 |
layout: (LayoutFrame 5 0.5 0 0 -5 1 0 1) |
|
375 |
activeHelpKey: startSearchButton |
|
376 |
translateLabel: true |
|
377 |
tabable: true |
|
378 |
model: search |
|
379 |
) |
|
380 |
) |
|
381 |
||
382 |
) |
|
383 |
) |
|
384 |
) |
|
385 |
||
386 |
) |
|
387 |
) |
|
388 |
(ViewSpec |
|
389 |
name: 'SelectorFinderBox' |
|
390 |
component: |
|
391 |
(SpecCollection |
|
392 |
collection: ( |
|
393 |
(ViewSpec |
|
394 |
name: 'MatchActionBox' |
|
395 |
layout: (LayoutFrame 0 0 0 0 0 1 90 0) |
|
396 |
component: |
|
397 |
(SpecCollection |
|
398 |
collection: ( |
|
399 |
(LabelSpec |
|
400 |
label: 'Selector Pattern:' |
|
401 |
name: 'Label1' |
|
402 |
layout: (LayoutFrame 0 0 0 0 0 0.5 25 0) |
|
403 |
translateLabel: true |
|
404 |
adjust: left |
|
405 |
) |
|
406 |
(InputFieldSpec |
|
407 |
name: 'EntryField1' |
|
408 |
layout: (LayoutFrame 2 0 -54 1 -2 1 -29 1) |
|
409 |
model: selectorPatternHolder |
|
410 |
immediateAccept: true |
|
411 |
acceptOnReturn: true |
|
412 |
acceptOnTab: true |
|
413 |
acceptOnPointerLeave: true |
|
414 |
) |
|
415 |
(ActionButtonSpec |
|
416 |
label: 'Search' |
|
417 |
name: 'Button4' |
|
418 |
layout: (LayoutFrame 5 0.5 -25 1 -5 1 0 1) |
|
419 |
translateLabel: true |
|
420 |
tabable: true |
|
421 |
model: searchPatternMatchesInBackground |
|
422 |
) |
|
423 |
) |
|
424 |
||
425 |
) |
|
426 |
) |
|
427 |
(SequenceViewSpec |
|
428 |
name: 'ResultList' |
|
429 |
layout: (LayoutFrame 0 0 94 0 0 1 0 1) |
|
430 |
model: selectedImplementorsHolder |
|
431 |
menu: resultListMenu |
|
432 |
hasHorizontalScrollBar: true |
|
433 |
hasVerticalScrollBar: true |
|
434 |
autoHideScrollBars: true |
|
435 |
useIndex: true |
|
436 |
sequenceList: resultHolder |
|
437 |
) |
|
438 |
) |
|
439 |
||
440 |
) |
|
441 |
) |
|
442 |
) |
|
443 |
||
444 |
) |
|
445 |
handles: (Any 0.28000000000000003 1.0) |
|
446 |
) |
|
447 |
(VariableVerticalPanelSpec |
|
448 |
name: 'RightBox' |
|
449 |
component: |
|
450 |
(SpecCollection |
|
451 |
collection: ( |
|
452 |
(SequenceViewSpec |
|
453 |
name: 'List2' |
|
454 |
model: selectedClassOfResultHolder |
|
455 |
menu: implementorListMenu |
|
456 |
hasHorizontalScrollBar: true |
|
457 |
hasVerticalScrollBar: true |
|
458 |
autoHideScrollBars: true |
|
459 |
doubleClickSelector: openBrowserOn: |
|
460 |
valueChangeSelector: selectedClassOfResultHolderChanged |
|
461 |
useIndex: false |
|
462 |
sequenceList: classOfResultHolder |
|
463 |
) |
|
464 |
(CodeViewSpec |
|
465 |
name: 'CodeView' |
|
466 |
model: codeHolder |
|
467 |
hasHorizontalScrollBar: true |
|
468 |
hasVerticalScrollBar: true |
|
469 |
autoHideScrollBars: true |
|
470 |
hasKeyboardFocusInitially: false |
|
471 |
postBuildCallback: sourceCodeWidgetCreated: |
|
472 |
viewClassName: 'codeViewClass' |
|
473 |
) |
|
474 |
) |
|
475 |
||
476 |
) |
|
477 |
handles: (Any 0.23999999999999999 1.0) |
|
478 |
) |
|
479 |
) |
|
480 |
||
481 |
) |
|
482 |
handles: (Any 0.33000000000000002 1.0) |
|
483 |
) |
|
484 |
) |
|
485 |
||
486 |
) |
|
487 |
) |
|
488 |
! |
|
489 |
||
490 |
windowSpec_old |
|
491 |
"This resource specification was automatically generated |
|
492 |
by the UIPainter of ST/X." |
|
493 |
||
494 |
"Do not manually edit this!! If it is corrupted, |
|
495 |
the UIPainter may not be able to read the specification." |
|
496 |
||
497 |
" |
|
498 |
UIPainter new openOnClass:MethodFinderWindow andSelector:#windowSpec |
|
499 |
MethodFinderWindow new openInterface:#windowSpec |
|
500 |
MethodFinderWindow open |
|
501 |
" |
|
502 |
||
503 |
<resource: #canvas> |
|
504 |
||
505 |
^ |
|
506 |
#(FullSpec |
|
507 |
name: windowSpec |
|
508 |
window: |
|
509 |
(WindowSpec |
|
510 |
label: 'MethodFinder' |
|
511 |
name: 'MethodFinder' |
|
3289 | 512 |
bounds: (Rectangle 0 0 920 690) |
513 |
menu: menu |
|
514 |
icon: defaultIcon |
|
515 |
) |
|
516 |
component: |
|
517 |
(SpecCollection |
|
518 |
collection: ( |
|
519 |
(VariableHorizontalPanelSpec |
|
520 |
name: 'VariableHorizontalPanel1' |
|
521 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
522 |
snapMode: both |
|
523 |
component: |
|
524 |
(SpecCollection |
|
525 |
collection: ( |
|
526 |
(ViewSpec |
|
527 |
name: 'LeftBox' |
|
528 |
level: 1 |
|
529 |
component: |
|
530 |
(SpecCollection |
|
531 |
collection: ( |
|
532 |
(ViewSpec |
|
533 |
name: 'ReceiverArgBox' |
|
534 |
layout: (LayoutFrame 0 0 0 0 0 1 -100 0.5) |
|
535 |
component: |
|
536 |
(SpecCollection |
|
537 |
collection: ( |
|
538 |
(LabelSpec |
|
539 |
label: 'Receiver' |
|
540 |
name: 'ReceiverLabel' |
|
541 |
layout: (LayoutFrame 0 0 0 0 0 0.34000000000000002 28 0) |
|
542 |
translateLabel: true |
|
543 |
) |
|
544 |
(ComboListSpec |
|
545 |
name: 'allowedArgments' |
|
3292 | 546 |
layout: (LayoutFrame 0 0.34000000000000002 1 0 0 0.64000000000000046 28 0) |
547 |
activeHelpKey: argumentCount |
|
3289 | 548 |
model: argCountHolder |
549 |
comboList: argCountList |
|
550 |
useIndex: true |
|
551 |
) |
|
552 |
(LabelSpec |
|
553 |
label: 'Answer' |
|
554 |
name: 'MessageAnswerLabel' |
|
3292 | 555 |
layout: (LayoutFrame 0 0.64000000000000046 0 0 0 1 28 0) |
556 |
activeHelpKey: arg1Value |
|
3289 | 557 |
translateLabel: true |
558 |
) |
|
559 |
(HorizontalPanelViewSpec |
|
560 |
name: 'HorizontalPanel1' |
|
561 |
layout: (LayoutFrame 0 0 30 0 0 1 0 1) |
|
562 |
horizontalLayout: fit |
|
563 |
verticalLayout: fit |
|
564 |
horizontalSpace: 3 |
|
565 |
verticalSpace: 3 |
|
566 |
component: |
|
567 |
(SpecCollection |
|
568 |
collection: ( |
|
569 |
(WorkspaceSpec |
|
570 |
name: 'ReceiverEditor' |
|
3292 | 571 |
activeHelpKey: receiverValue |
3289 | 572 |
tabable: true |
573 |
hasHorizontalScrollBar: true |
|
574 |
hasVerticalScrollBar: true |
|
575 |
miniScrollerHorizontal: true |
|
576 |
miniScrollerVertical: true |
|
577 |
autoHideScrollBars: true |
|
578 |
hasKeyboardFocusInitially: false |
|
579 |
extent: (Point 110 214) |
|
580 |
postBuildCallback: receiverWidgetCreated: |
|
581 |
) |
|
582 |
(VerticalPanelViewSpec |
|
583 |
name: 'VerticalPanel1' |
|
584 |
horizontalLayout: fit |
|
585 |
verticalLayout: fit |
|
586 |
horizontalSpace: 3 |
|
587 |
verticalSpace: 3 |
|
588 |
component: |
|
589 |
(SpecCollection |
|
590 |
collection: ( |
|
591 |
(ViewSpec |
|
592 |
name: 'Box1' |
|
593 |
visibilityChannel: arg1BoxVisible |
|
594 |
component: |
|
595 |
(SpecCollection |
|
596 |
collection: ( |
|
597 |
(WorkspaceSpec |
|
598 |
name: 'Arg1Editor' |
|
599 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
3292 | 600 |
activeHelpKey: arg1Value |
3289 | 601 |
tabable: true |
602 |
hasHorizontalScrollBar: true |
|
603 |
hasVerticalScrollBar: true |
|
604 |
miniScrollerHorizontal: true |
|
605 |
miniScrollerVertical: true |
|
606 |
autoHideScrollBars: true |
|
607 |
hasKeyboardFocusInitially: false |
|
608 |
postBuildCallback: argument1WidgetCreated: |
|
1532 | 609 |
) |
3289 | 610 |
) |
611 |
||
612 |
) |
|
613 |
extent: (Point 110 69) |
|
614 |
) |
|
615 |
(ViewSpec |
|
616 |
name: 'Box2' |
|
617 |
visibilityChannel: arg2BoxVisible |
|
618 |
component: |
|
619 |
(SpecCollection |
|
620 |
collection: ( |
|
621 |
(WorkspaceSpec |
|
622 |
name: 'TextEditor5' |
|
623 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
3292 | 624 |
activeHelpKey: arg2Value |
3289 | 625 |
tabable: true |
626 |
hasHorizontalScrollBar: true |
|
627 |
hasVerticalScrollBar: true |
|
628 |
miniScrollerHorizontal: true |
|
629 |
miniScrollerVertical: true |
|
630 |
autoHideScrollBars: true |
|
631 |
hasKeyboardFocusInitially: false |
|
632 |
postBuildCallback: argument2WidgetCreated: |
|
1532 | 633 |
) |
3289 | 634 |
) |
635 |
||
636 |
) |
|
637 |
extent: (Point 110 70) |
|
638 |
) |
|
639 |
(ViewSpec |
|
640 |
name: 'Box3' |
|
641 |
visibilityChannel: arg3BoxVisible |
|
642 |
component: |
|
643 |
(SpecCollection |
|
644 |
collection: ( |
|
645 |
(WorkspaceSpec |
|
646 |
name: 'TextEditor6' |
|
647 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
3292 | 648 |
activeHelpKey: arg3Value |
3289 | 649 |
tabable: true |
650 |
hasHorizontalScrollBar: true |
|
651 |
hasVerticalScrollBar: true |
|
652 |
miniScrollerHorizontal: true |
|
653 |
miniScrollerVertical: true |
|
654 |
autoHideScrollBars: true |
|
655 |
hasKeyboardFocusInitially: false |
|
656 |
postBuildCallback: argument3WidgetCreated: |
|
1532 | 657 |
) |
3289 | 658 |
) |
659 |
||
660 |
) |
|
661 |
extent: (Point 110 69) |
|
1530 | 662 |
) |
3289 | 663 |
) |
664 |
||
665 |
) |
|
666 |
extent: (Point 110 214) |
|
667 |
) |
|
668 |
(WorkspaceSpec |
|
669 |
name: 'AnswerEditor' |
|
3292 | 670 |
activeHelpKey: answerValue |
3289 | 671 |
tabable: true |
672 |
hasHorizontalScrollBar: true |
|
673 |
hasVerticalScrollBar: true |
|
674 |
miniScrollerHorizontal: true |
|
675 |
miniScrollerVertical: true |
|
676 |
autoHideScrollBars: true |
|
677 |
hasKeyboardFocusInitially: false |
|
678 |
extent: (Point 110 214) |
|
679 |
postBuildCallback: messageAnswerWidgetCreated: |
|
1525 | 680 |
) |
3289 | 681 |
) |
682 |
||
683 |
) |
|
684 |
) |
|
685 |
) |
|
686 |
||
687 |
) |
|
688 |
) |
|
689 |
(ViewSpec |
|
690 |
name: 'ReceiverArgBoxActionBox' |
|
691 |
layout: (LayoutFrame 0 0 -98 0.5 0 1 -75 0.5) |
|
692 |
component: |
|
693 |
(SpecCollection |
|
694 |
collection: ( |
|
695 |
(ActionButtonSpec |
|
3292 | 696 |
activeHelpKey: clearButton |
3289 | 697 |
label: 'Clear' |
698 |
name: 'Button2' |
|
699 |
layout: (LayoutFrame 5 0 0 0 -5 0.5 0 1) |
|
700 |
translateLabel: true |
|
701 |
model: clear |
|
1532 | 702 |
) |
3289 | 703 |
(ActionButtonSpec |
3292 | 704 |
activeHelpKey: startSearchButton |
3289 | 705 |
label: 'Search' |
706 |
name: 'Button1' |
|
707 |
layout: (LayoutFrame 5 0.5 0 0 -5 1 0 1) |
|
708 |
translateLabel: true |
|
709 |
tabable: true |
|
710 |
model: search |
|
711 |
) |
|
712 |
) |
|
713 |
||
714 |
) |
|
715 |
) |
|
716 |
(ViewSpec |
|
717 |
name: 'MatchActionBox' |
|
3290 | 718 |
layout: (LayoutFrame 0 0 -70 0.5 0 1 10 0.5) |
3289 | 719 |
component: |
720 |
(SpecCollection |
|
721 |
collection: ( |
|
722 |
(LabelSpec |
|
723 |
label: 'Selector Pattern:' |
|
724 |
name: 'Label1' |
|
725 |
layout: (LayoutFrame 0 0 0 0 0 0.5 25 0) |
|
726 |
translateLabel: true |
|
727 |
adjust: left |
|
1522 | 728 |
) |
3289 | 729 |
(InputFieldSpec |
730 |
name: 'EntryField1' |
|
3290 | 731 |
layout: (LayoutFrame 2 0 -54 1 -2 1 -29 1) |
3292 | 732 |
model: selectorPatternHolder |
3289 | 733 |
immediateAccept: true |
734 |
acceptOnReturn: true |
|
735 |
acceptOnTab: true |
|
736 |
acceptOnPointerLeave: true |
|
737 |
) |
|
738 |
(ActionButtonSpec |
|
739 |
label: 'Search' |
|
740 |
name: 'Button4' |
|
741 |
layout: (LayoutFrame 5 0.5 -25 1 -5 1 0 1) |
|
742 |
translateLabel: true |
|
743 |
tabable: true |
|
744 |
model: searchPatternMatchesInBackground |
|
2886 | 745 |
) |
3289 | 746 |
) |
747 |
||
748 |
) |
|
749 |
) |
|
750 |
(SequenceViewSpec |
|
751 |
name: 'ResultList' |
|
3290 | 752 |
layout: (LayoutFrame 0 0 15 0.5 0 1 0 1) |
3289 | 753 |
model: selectedImplementorsHolder |
754 |
menu: resultListMenu |
|
755 |
hasHorizontalScrollBar: true |
|
756 |
hasVerticalScrollBar: true |
|
757 |
autoHideScrollBars: true |
|
758 |
useIndex: true |
|
759 |
sequenceList: resultHolder |
|
1530 | 760 |
) |
3289 | 761 |
) |
762 |
||
763 |
) |
|
764 |
) |
|
765 |
(VariableVerticalPanelSpec |
|
766 |
name: 'VariableVerticalPanel1' |
|
767 |
component: |
|
768 |
(SpecCollection |
|
769 |
collection: ( |
|
770 |
(SequenceViewSpec |
|
771 |
name: 'List2' |
|
772 |
model: selectedClassOfResultHolder |
|
773 |
menu: implementorListMenu |
|
774 |
hasHorizontalScrollBar: true |
|
775 |
hasVerticalScrollBar: true |
|
776 |
autoHideScrollBars: true |
|
777 |
doubleClickSelector: openBrowserOn: |
|
778 |
valueChangeSelector: selectedClassOfResultHolderChanged |
|
779 |
useIndex: false |
|
780 |
sequenceList: classOfResultHolder |
|
1522 | 781 |
) |
3289 | 782 |
(CodeViewSpec |
783 |
name: 'CodeView' |
|
784 |
model: codeHolder |
|
785 |
hasHorizontalScrollBar: true |
|
786 |
hasVerticalScrollBar: true |
|
787 |
autoHideScrollBars: true |
|
788 |
hasKeyboardFocusInitially: false |
|
789 |
postBuildCallback: sourceCodeWidgetCreated: |
|
3292 | 790 |
viewClassName: 'codeViewClass' |
3289 | 791 |
) |
792 |
) |
|
793 |
||
794 |
) |
|
795 |
handles: (Any 0.5 1.0) |
|
1522 | 796 |
) |
3289 | 797 |
) |
798 |
||
799 |
) |
|
3292 | 800 |
handles: (Any 0.37391304347826104 1.0) |
1522 | 801 |
) |
3289 | 802 |
) |
803 |
||
804 |
) |
|
805 |
) |
|
1522 | 806 |
! ! |
807 |
||
1525 | 808 |
!MethodFinderWindow class methodsFor:'menu specs'! |
809 |
||
1529 | 810 |
implementorListMenu |
811 |
"This resource specification was automatically generated |
|
812 |
by the MenuEditor of ST/X." |
|
813 |
||
814 |
"Do not manually edit this!! If it is corrupted, |
|
815 |
the MenuEditor may not be able to read the specification." |
|
816 |
||
817 |
" |
|
818 |
MenuEditor new openOnClass:MethodFinderWindow andSelector:#implementorListMenu |
|
819 |
(Menu new fromLiteralArrayEncoding:(MethodFinderWindow implementorListMenu)) startUp |
|
820 |
" |
|
821 |
||
822 |
<resource: #menu> |
|
823 |
||
824 |
^ |
|
825 |
#(#Menu |
|
826 |
#( |
|
827 |
#(#MenuItem |
|
828 |
#label: 'Browse' |
|
829 |
#translateLabel: true |
|
830 |
#value: #openBrowserOnSelectedItem |
|
831 |
) |
|
832 |
) |
|
833 |
nil |
|
834 |
nil |
|
835 |
) |
|
836 |
! |
|
837 |
||
1525 | 838 |
menu |
839 |
"This resource specification was automatically generated |
|
840 |
by the MenuEditor of ST/X." |
|
841 |
||
842 |
"Do not manually edit this!! If it is corrupted, |
|
843 |
the MenuEditor may not be able to read the specification." |
|
844 |
||
845 |
" |
|
846 |
MenuEditor new openOnClass:MethodFinderWindow andSelector:#menu |
|
847 |
(Menu new fromLiteralArrayEncoding:(MethodFinderWindow menu)) startUp |
|
848 |
" |
|
849 |
||
850 |
<resource: #menu> |
|
851 |
||
852 |
^ |
|
853 |
#(#Menu |
|
854 |
#( |
|
855 |
#(#MenuItem |
|
856 |
#label: '&File' |
|
857 |
#activeHelpKey: #file |
|
858 |
#submenu: |
|
859 |
#(#Menu |
|
860 |
#( |
|
861 |
#(#MenuItem |
|
862 |
#label: 'Exit' |
|
863 |
#value: #closeRequest |
|
864 |
#activeHelpKey: #fileExit |
|
865 |
) |
|
866 |
) |
|
867 |
nil |
|
868 |
nil |
|
869 |
) |
|
870 |
) |
|
871 |
#(#MenuItem |
|
3193 | 872 |
label: 'MENU_Help' |
873 |
startGroup: conditionalRight |
|
1525 | 874 |
#submenu: |
875 |
#(#Menu |
|
876 |
#( |
|
877 |
#(#MenuItem |
|
878 |
#label: 'Documentation' |
|
879 |
#value: #openHTMLDocumentation |
|
880 |
#activeHelpKey: #helpTutorial |
|
881 |
) |
|
882 |
#(#MenuItem |
|
1532 | 883 |
#label: 'About MethodFinder...' |
1525 | 884 |
#value: #openAboutThisApplication |
885 |
#activeHelpKey: #aboutThisAppliaction |
|
886 |
) |
|
887 |
) |
|
888 |
nil |
|
889 |
nil |
|
890 |
) |
|
891 |
) |
|
892 |
) |
|
893 |
nil |
|
894 |
nil |
|
895 |
) |
|
1532 | 896 |
|
897 |
"Modified: / 13.11.2001 / 12:36:39 / cg" |
|
2927 | 898 |
! |
899 |
||
900 |
resultListMenu |
|
901 |
"This resource specification was automatically generated |
|
902 |
by the MenuEditor of ST/X." |
|
903 |
||
904 |
"Do not manually edit this!! If it is corrupted, |
|
905 |
the MenuEditor may not be able to read the specification." |
|
906 |
||
907 |
" |
|
908 |
MenuEditor new openOnClass:MethodFinderWindow andSelector:#implementorListMenu |
|
909 |
(Menu new fromLiteralArrayEncoding:(MethodFinderWindow implementorListMenu)) startUp |
|
910 |
" |
|
911 |
||
912 |
<resource: #menu> |
|
913 |
||
914 |
^ |
|
915 |
#(#Menu |
|
916 |
#( |
|
917 |
#(#MenuItem |
|
3024 | 918 |
#label: 'Browse Senders' |
919 |
#translateLabel: true |
|
920 |
#value: #openBrowserOnSenderOfSelectedResultItem |
|
921 |
) |
|
922 |
#(#MenuItem |
|
2927 | 923 |
#label: 'Browse Implementors' |
924 |
#translateLabel: true |
|
925 |
#value: #openBrowserOnSelectedResultItem |
|
926 |
) |
|
927 |
) |
|
928 |
nil |
|
929 |
nil |
|
930 |
) |
|
931 |
||
932 |
"Created: / 21-09-2012 / 11:05:15 / cg" |
|
1525 | 933 |
! ! |
934 |
||
3289 | 935 |
!MethodFinderWindow class methodsFor:'startup'! |
936 |
||
937 |
openOnSelectorPattern:selector |
|
938 |
|app| |
|
939 |
||
940 |
app := self new. |
|
941 |
app allButOpen. |
|
3292 | 942 |
app selectorPatternHolder value:selector. |
3289 | 943 |
app openWindow. |
3290 | 944 |
"/ app waitForBackgroundSearchFinished. |
945 |
||
3289 | 946 |
^ app |
947 |
||
948 |
" |
|
949 |
self openOnSelectorPattern:'asLowercase' |
|
950 |
" |
|
951 |
! ! |
|
952 |
||
1522 | 953 |
!MethodFinderWindow methodsFor:'accessing'! |
954 |
||
955 |
receiver |
|
1525 | 956 |
"Return a copy of the value of the instance variable 'receiver' " |
1522 | 957 |
|
958 |
^ receiver copy |
|
959 |
! ! |
|
960 |
||
961 |
!MethodFinderWindow methodsFor:'actions'! |
|
962 |
||
963 |
clear |
|
3292 | 964 |
"Reset the contents of all the outputs." |
1522 | 965 |
|
966 |
receiverEditor contents:nil. |
|
967 |
argument1Editor contents:nil. |
|
968 |
argument2Editor contents:nil. |
|
969 |
argument3Editor contents:nil. |
|
970 |
messageAnswerEditor contents:nil. |
|
971 |
self resultHolder value:nil. |
|
1525 | 972 |
self classOfResultHolder value: nil. |
2730 | 973 |
codeHolder value:nil. |
1522 | 974 |
! |
975 |
||
976 |
messageAnswerEditorContents |
|
3024 | 977 |
"Return a cleaned up version of message answer taken from the messageAnswerEditor |
978 |
as an association. The association has cleanedAnswerString as a key and the |
|
979 |
compiledAnswer as value." |
|
980 |
||
981 |
|aCleanedAnswerString compiledAnswer| |
|
1522 | 982 |
|
3024 | 983 |
aCleanedAnswerString := self cleanInputs:(messageAnswerEditor contents). |
984 |
compiledAnswer := Compiler evaluate:aCleanedAnswerString. |
|
985 |
((self isExpression:aCleanedAnswerString) or:[ compiledAnswer isNil ]) ifTrue:[ |
|
986 |
aCleanedAnswerString := compiledAnswer printString |
|
987 |
]. |
|
988 |
^ aCleanedAnswerString -> compiledAnswer. |
|
1522 | 989 |
! |
990 |
||
991 |
openBrowserOn:anArgument |
|
992 |
"Opens browser on theArgument of a specific class. anArgument being a string with the |
|
1525 | 993 |
Class and the selector upon which the browser is to be opened. Return the receiver." |
1522 | 994 |
|
1532 | 995 |
|classAndSelector| |
1522 | 996 |
|
1532 | 997 |
classAndSelector := self extractClassAndSelectorFrom:anArgument. |
998 |
classAndSelector isNil ifTrue:[ |
|
1525 | 999 |
^ self |
1522 | 1000 |
]. |
3482 | 1001 |
SystemBrowser default |
2459 | 1002 |
openInClass:classAndSelector key |
1003 |
selector:classAndSelector value |
|
1525 | 1004 |
|
1005 |
" |
|
1006 |
MethodFinderWindow new openBrowserOn: '*SmallInteger +' |
|
1007 |
MethodFinderWindow new openBrowserOn: 'String ,' |
|
1008 |
MethodFinderWindow new openBrowserOn: 'Number detentBy:atMultiplesOf:snap:' |
|
1009 |
||
1010 |
||
1011 |
" |
|
1532 | 1012 |
|
3482 | 1013 |
"Modified: / 01-09-2017 / 14:21:18 / cg" |
1522 | 1014 |
! |
1015 |
||
1529 | 1016 |
openBrowserOnSelectedItem |
2927 | 1017 |
"on the selected implementor" |
1018 |
||
1529 | 1019 |
|sel| |
1020 |
||
1021 |
sel := self selectedClassOfResultHolder value. |
|
1022 |
self openBrowserOn:sel |
|
1532 | 1023 |
|
2927 | 1024 |
"Modified: / 13-11-2001 / 12:47:39 / cg" |
1025 |
"Modified (comment): / 21-09-2012 / 11:08:33 / cg" |
|
1026 |
! |
|
1027 |
||
1028 |
openBrowserOnSelectedResultItem |
|
1029 |
"on an item in the lower left list, |
|
1030 |
on all implementors of that message" |
|
1031 |
||
1032 |
|selIndex selector| |
|
1033 |
||
1034 |
selIndex := self selectedImplementorsHolder value. |
|
1035 |
selIndex isNil ifTrue:[^ self]. |
|
1036 |
||
1037 |
selector := resultSelectors at:selIndex. |
|
1038 |
UserPreferences browserClass browseImplementorsOf:selector. |
|
1039 |
||
1040 |
"Created: / 21-09-2012 / 11:05:46 / cg" |
|
1529 | 1041 |
! |
1042 |
||
3024 | 1043 |
openBrowserOnSenderOfSelectedResultItem |
1044 |
"on an item in the lower left list, |
|
1045 |
on all implementors of that message" |
|
1046 |
||
1047 |
|selIndex selector| |
|
1525 | 1048 |
|
3024 | 1049 |
selIndex := self selectedImplementorsHolder value. |
1050 |
selIndex isNil ifTrue:[^ self]. |
|
1051 |
||
1052 |
selector := resultSelectors at:selIndex. |
|
1053 |
UserPreferences browserClass browseSendersOf:selector. |
|
1054 |
! |
|
1522 | 1055 |
|
1056 |
search |
|
3024 | 1057 |
"Do a search based on the input in the various text editors. Return the receiver." |
3322 | 1058 |
|
3024 | 1059 |
|tempReceiver tempAnswer tempArguments anArray resultArray receiverWithArgument mf| |
1522 | 1060 |
|
3024 | 1061 |
self resultHolder value:nil. |
1062 |
self classOfResultHolder value:nil. |
|
1063 |
self codeHolder value:nil. |
|
1064 |
tempArguments := self argumentEditorsContents. |
|
1065 |
tempReceiver := self receiverEditorContents. |
|
1066 |
tempAnswer := self messageAnswerEditorContents. |
|
1067 |
"self cleanInputRec:tempReceiver arg:tempArguments ans:tempAnswer." |
|
1068 |
anArray := Array new:2. |
|
3292 | 1069 |
receiverWithArgument := self mergeReceiver:(tempReceiver value) |
1070 |
withArgument:(tempArguments values). |
|
3024 | 1071 |
anArray |
1072 |
at:1 put:receiverWithArgument; |
|
1073 |
at:2 put:tempAnswer value. |
|
3322 | 1074 |
"an array now holds the following array #(#(receiver argument) answer) or #(#(receiver) answer). which should |
3024 | 1075 |
be suitable input for the method finder." |
1076 |
self withCursor:Cursor execute |
|
1077 |
do:[ |
|
1078 |
mf := MethodFinder new. |
|
1079 |
resultArray := mf |
|
1080 |
load:anArray; |
|
1081 |
findMessage. |
|
1082 |
]. |
|
1083 |
((resultArray at:1) includesSubString:'no single') ifTrue:[ |
|
1084 |
self warn:(resultArray at:1). |
|
1085 |
^ self |
|
1086 |
]. |
|
1087 |
"the following then replaces data1 and data2 created by the method finder to the appropriate arguments" |
|
3322 | 1088 |
resultArray |
1089 |
keysAndValuesDo:[:key :value | |
|
3024 | 1090 |
|newValue| |
1522 | 1091 |
|
3024 | 1092 |
newValue := value replString:'data1' withString:(tempReceiver key). |
1093 |
(tempArguments size) >= 1 ifTrue:[ |
|
1094 |
newValue := newValue replString:'data2' |
|
1095 |
withString:(tempArguments keyAt:1) |
|
1096 |
]. |
|
1097 |
(tempArguments size) > 1 ifTrue:[ |
|
1098 |
newValue := newValue replString:'data3' |
|
1099 |
withString:(tempArguments keyAt:2). |
|
1100 |
]. |
|
1101 |
(tempArguments size) > 2 ifTrue:[ |
|
1102 |
newValue := newValue replString:'data4' |
|
1103 |
withString:(tempArguments keyAt:3). |
|
1104 |
]. |
|
1105 |
(tempArguments size) > 3 ifTrue:[ |
|
1106 |
self halt:'unimplemented'. |
|
1107 |
]. |
|
1108 |
" newValue:= value replString: 'data3' withString:(self messageAnswer key). " |
|
1109 |
newValue := newValue , ' --> ' , (tempAnswer key). |
|
1110 |
newValue replaceAll:Character cr with:Character space. |
|
1111 |
resultArray at:key put:newValue. |
|
1112 |
]. |
|
1113 |
self resultHolder value:resultArray. |
|
1114 |
resultSelectors := mf selectors. |
|
1115 |
receiver := tempReceiver |
|
1532 | 1116 |
|
2859 | 1117 |
"Modified: / 26-09-2011 / 12:42:28 / cg" |
1532 | 1118 |
! |
1119 |
||
3023 | 1120 |
searchPatternMatchesInBackground |
1121 |
"Do a search based on the pattern match as a background task" |
|
2886 | 1122 |
|
3023 | 1123 |
| p pattern| |
2891 | 1124 |
|
1125 |
(p := searchProcess) notNil ifTrue:[ |
|
1126 |
searchProcess := nil. |
|
1127 |
p terminate. |
|
1128 |
]. |
|
1129 |
||
3292 | 1130 |
pattern := self selectorPatternHolder value. |
3023 | 1131 |
pattern isEmptyOrNil ifTrue:[ |
1132 |
self resultHolder value:self resultInfoText. |
|
1133 |
self classOfResultHolder value:nil. |
|
1134 |
self codeHolder value:nil. |
|
1135 |
^ self |
|
1136 |
]. |
|
1137 |
||
2891 | 1138 |
searchProcess := |
1139 |
[ |
|
3290 | 1140 |
|list counts firsts seconds selectors resultList idx match| |
2891 | 1141 |
|
1142 |
self withCursor:Cursor execute do:[ |
|
1143 |
pattern includesMatchCharacters ifFalse:[ |
|
3290 | 1144 |
list := SystemBrowser findImplementorsOf:pattern in:Smalltalk allClasses ignoreCase:true. |
3292 | 1145 |
list isEmptyOrNil ifTrue:[ |
1146 |
match := pattern,'*'. |
|
1147 |
list := SystemBrowser findImplementorsMatching:match in:Smalltalk allClasses ignoreCase:true. |
|
1148 |
]. |
|
3290 | 1149 |
] ifTrue:[ |
3292 | 1150 |
"/ match := '*',pattern,'*'. |
1151 |
match := pattern. |
|
3290 | 1152 |
list := SystemBrowser findImplementorsMatching:match in:Smalltalk allClasses ignoreCase:true. |
2891 | 1153 |
]. |
1154 |
]. |
|
3023 | 1155 |
|
1156 |
counts := IdentityDictionary new. |
|
1157 |
firsts := IdentityDictionary new. |
|
1158 |
seconds := IdentityDictionary new. |
|
1159 |
selectors := IdentitySet new. |
|
1160 |
list do:[:eachMethod | |
|
1161 |
|msel| |
|
1162 |
||
1163 |
msel := eachMethod selector. |
|
1164 |
selectors add:msel. |
|
1165 |
(counts at:msel ifAbsentPut:[ 0 asValue ]) increment. |
|
1166 |
(firsts includesKey:msel) ifTrue:[ |
|
1167 |
(seconds includesKey:msel) ifFalse:[ |
|
1168 |
seconds at:msel ifAbsentPut:[ eachMethod mclass ]. |
|
1169 |
]. |
|
1170 |
] ifFalse:[ |
|
1171 |
firsts at:msel ifAbsentPut:[ eachMethod mclass ]. |
|
1172 |
]. |
|
1173 |
]. |
|
1174 |
resultSelectors := selectors asOrderedCollection sort. |
|
1175 |
resultList := resultSelectors |
|
1176 |
collect:[:sel | |
|
1177 |
|cnt s| |
|
1178 |
||
1179 |
s := sel allBold , ' --> '. |
|
1180 |
cnt := (counts at:sel) value. |
|
1181 |
cnt == 1 ifTrue:[ |
|
1182 |
s , (firsts at:sel) name |
|
1183 |
] ifFalse:[ |
|
1184 |
cnt == 2 ifTrue:[ |
|
1185 |
s , (firsts at:sel) name , ' and ' , (seconds at:sel) name |
|
1186 |
] ifFalse:[ |
|
1187 |
s , cnt printString , ' implementor(s)' |
|
1188 |
] |
|
1189 |
]. |
|
1190 |
]. |
|
3292 | 1191 |
|
3290 | 1192 |
self enqueueDelayedAction:[ self updateListAfterPatternSearch: resultList ]. |
2891 | 1193 |
] fork. |
1194 |
||
1195 |
"Created: / 01-06-2012 / 13:16:54 / cg" |
|
1196 |
! |
|
1197 |
||
1522 | 1198 |
updateImplementorsOf:anInteger |
1525 | 1199 |
"Request the implementors of the selected argument provided by aNumber. |
2892 | 1200 |
Return the receiver." |
1201 |
||
1202 |
|methods classList aNumber| |
|
1525 | 1203 |
|
2892 |