author | convert-repo |
Mon, 08 Jul 2019 03:26:32 +0000 | |
changeset 3684 | 941d2ff78a3e |
parent 3675 | caafc519b235 |
child 3685 | 854b28268aa6 |
permissions | -rw-r--r-- |
3645 | 1 |
"{ Encoding: utf8 }" |
2 |
||
3292 | 3 |
" |
4 |
Copyright (C) Original Authors (Kaehler, Scott Wallace and Dan Ingalls) |
|
5 |
Copyright (C) 2001 eXept Software AG |
|
6 |
||
7 |
Permission is hereby granted, free of charge, to any |
|
8 |
person obtaining a copy of this software and associated |
|
9 |
documentation files (the 'Software'), to deal in the |
|
10 |
Software without restriction, including without limitation |
|
11 |
the rights to use, copy, modify, merge, publish, distribute, |
|
12 |
sublicense, and/or sell copies of the Software, and to |
|
13 |
permit persons to whom the Software is furnished to do so, |
|
14 |
subject to the following conditions: |
|
15 |
||
16 |
The above copyright notice and this permission notice shall |
|
17 |
be included in all copies or substantial portions of the Software. |
|
18 |
||
19 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
20 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
21 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
|
22 |
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
|
23 |
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
|
24 |
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
|
25 |
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
26 |
" |
|
1522 | 27 |
"{ Package: 'stx:libtool2' }" |
28 |
||
3193 | 29 |
"{ NameSpace: Smalltalk }" |
30 |
||
1522 | 31 |
ApplicationModel subclass:#MethodFinderWindow |
3292 | 32 |
instanceVariableNames:'resultHolder selectorPatternHolder classOfResultHolder |
33 |
selectedClassOfResultHolder selectedImplementorsHolder |
|
34 |
argumentsEditor messageAnswerEditor receiverEditor receiver |
|
1522 | 35 |
resultSelectors arg2BoxVisible arg1BoxVisible arg4BoxVisible |
36 |
arg3BoxVisible argCountHolder argCountList argument1Editor |
|
37 |
argument2Editor argument3Editor argument4Editor resultSelected |
|
2891 | 38 |
lookAtResultEditor codeHolder searchProcess' |
1522 | 39 |
classVariableNames:'' |
40 |
poolDictionaries:'' |
|
3215 | 41 |
category:'Interface-Tools' |
1522 | 42 |
! |
43 |
||
1530 | 44 |
!MethodFinderWindow class methodsFor:'documentation'! |
45 |
||
3292 | 46 |
copyright |
47 |
" |
|
48 |
Copyright (C) Original Authors (Kaehler, Scott Wallace and Dan Ingalls) |
|
49 |
Copyright (C) 2001 eXept Software AG |
|
50 |
||
51 |
Permission is hereby granted, free of charge, to any |
|
52 |
person obtaining a copy of this software and associated |
|
53 |
documentation files (the 'Software'), to deal in the |
|
54 |
Software without restriction, including without limitation |
|
55 |
the rights to use, copy, modify, merge, publish, distribute, |
|
56 |
sublicense, and/or sell copies of the Software, and to |
|
57 |
permit persons to whom the Software is furnished to do so, |
|
58 |
subject to the following conditions: |
|
59 |
||
60 |
The above copyright notice and this permission notice shall |
|
61 |
be included in all copies or substantial portions of the Software. |
|
62 |
||
63 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
64 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
65 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
|
66 |
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
|
67 |
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
|
68 |
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
|
69 |
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
70 |
" |
|
71 |
! |
|
72 |
||
1530 | 73 |
documentation |
74 |
" |
|
3292 | 75 |
a tool to find implementing methods by example. |
76 |
Give it values for a receiver, optional arguments and a desired result, |
|
77 |
and it will find methods which do that for you. |
|
78 |
Please read the online documentation for details (open via the tool's help menu). |
|
79 |
||
1531 | 80 |
[author:] |
3292 | 81 |
original squeak version by Ted Kaehler, Scott Wallace and Dan Ingalls. |
82 |
ported from Squeak and GUI enhanced 2001 by James Hayes james@exept.de. |
|
83 |
improved by Claus Gittinger. |
|
1530 | 84 |
" |
85 |
! ! |
|
1522 | 86 |
|
1532 | 87 |
!MethodFinderWindow class methodsFor:'constants'! |
88 |
||
2890 | 89 |
defaultIcon |
3109
92920c76aae3
Mark program icons with resource
Stefan Vogel <sv@exept.de>
parents:
3090
diff
changeset
|
90 |
<resource: #programImage> |
92920c76aae3
Mark program icons with resource
Stefan Vogel <sv@exept.de>
parents:
3090
diff
changeset
|
91 |
|
2890 | 92 |
^ ToolbarIconLibrary methodFinder24x24Icon |
93 |
||
94 |
"Created: / 01-06-2012 / 13:05:11 / cg" |
|
95 |
! |
|
96 |
||
1532 | 97 |
markerForImplementingClass |
98 |
^ '=> '. |
|
99 |
^ '*' |
|
100 |
||
101 |
"Created: / 13.11.2001 / 12:09:52 / cg" |
|
102 |
"Modified: / 13.11.2001 / 12:11:57 / cg" |
|
103 |
! ! |
|
104 |
||
3292 | 105 |
!MethodFinderWindow class methodsFor:'help specs'! |
106 |
||
3514 | 107 |
helpSpec |
3292 | 108 |
"This resource specification was automatically generated |
109 |
by the UIHelpTool of ST/X." |
|
110 |
||
111 |
"Do not manually edit this!! If it is corrupted, |
|
112 |
the UIHelpTool may not be able to read the specification." |
|
113 |
||
114 |
" |
|
3675 | 115 |
UIHelpTool openOnClass:MethodFinderWindow |
3292 | 116 |
" |
117 |
||
118 |
<resource: #help> |
|
119 |
||
3514 | 120 |
^ super helpSpec addPairsFrom:#( |
3292 | 121 |
|
3675 | 122 |
#'*' |
123 |
'as in GLOB patterns (i.e. like filename patterns)' |
|
3292 | 124 |
|
125 |
#answerValue |
|
126 |
'Enter result value here.\Can be a constant (like ''hello'')\or an expression, such as "Rectangle basicNew".' |
|
127 |
||
128 |
#arg1Value |
|
129 |
'Enter a value for the first argument here.\Can be a constant or an expression.' |
|
130 |
||
131 |
#arg2Value |
|
132 |
'Enter a value for the second argument here.\Can be a constant or an expression.' |
|
133 |
||
134 |
#arg3Value |
|
135 |
'Enter a value for the third argument here.\Can be a constant or an expression.' |
|
136 |
||
137 |
#argumentCount |
|
138 |
'Specify the number of arguments here.' |
|
139 |
||
140 |
#clearButton |
|
141 |
'Clear all sample value fields.' |
|
142 |
||
3675 | 143 |
#implementorsFound |
144 |
'Shows a list of messages which deliver the result or match the selector pattern' |
|
145 |
||
146 |
#receiverValue |
|
147 |
'Enter a receiver value here.\Can be a constant (like ''hello'')\or an expression, such as "Rectangle basicNew".' |
|
148 |
||
149 |
#selectorPattern |
|
150 |
'Enter a pattern to search by message name' |
|
151 |
||
152 |
#selectorPatternSearch |
|
153 |
'Search by name.\You can use match characters' |
|
154 |
||
3292 | 155 |
#startSearchButton |
156 |
'Search for methods which answer the desired value,\given the concrete arguments' |
|
157 |
||
3675 | 158 |
#startSearchPatternButton |
159 |
'Search for methods whose name matches the pattern' |
|
3292 | 160 |
|
161 |
) |
|
3675 | 162 |
|
163 |
"Modified: / 08-06-2019 / 16:06:17 / Claus Gittinger" |
|
3292 | 164 |
! ! |
165 |
||
1522 | 166 |
!MethodFinderWindow class methodsFor:'interface specs'! |
167 |
||
168 |
windowSpec |
|
169 |
"This resource specification was automatically generated |
|
170 |
by the UIPainter of ST/X." |
|
171 |
||
172 |
"Do not manually edit this!! If it is corrupted, |
|
173 |
the UIPainter may not be able to read the specification." |
|
174 |
||
175 |
" |
|
176 |
UIPainter new openOnClass:MethodFinderWindow andSelector:#windowSpec |
|
177 |
MethodFinderWindow new openInterface:#windowSpec |
|
178 |
MethodFinderWindow open |
|
179 |
" |
|
180 |
||
181 |
<resource: #canvas> |
|
182 |
||
183 |
^ |
|
3289 | 184 |
#(FullSpec |
185 |
name: windowSpec |
|
3675 | 186 |
uuid: '5fb0c294-89f6-11e9-8df0-b8f6b1108e05' |
3289 | 187 |
window: |
188 |
(WindowSpec |
|
189 |
label: 'MethodFinder' |
|
190 |
name: 'MethodFinder' |
|
3675 | 191 |
uuid: '5fb0c87a-89f6-11e9-8df0-b8f6b1108e05' |
3301 | 192 |
bounds: (Rectangle 0 0 816 738) |
193 |
menu: menu |
|
194 |
icon: defaultIcon |
|
195 |
) |
|
196 |
component: |
|
197 |
(SpecCollection |
|
198 |
collection: ( |
|
199 |
(VariableHorizontalPanelSpec |
|
200 |
name: 'VariableHorizontalPanel1' |
|
201 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
3675 | 202 |
uuid: '5fb0cd98-89f6-11e9-8df0-b8f6b1108e05' |
3301 | 203 |
showHandle: true |
204 |
snapMode: both |
|
205 |
component: |
|
206 |
(SpecCollection |
|
207 |
collection: ( |
|
208 |
(VariableVerticalPanelSpec |
|
209 |
name: 'LeftBox' |
|
3675 | 210 |
uuid: '5fb0d1a8-89f6-11e9-8df0-b8f6b1108e05' |
3301 | 211 |
showHandle: true |
212 |
component: |
|
213 |
(SpecCollection |
|
214 |
collection: ( |
|
215 |
(ViewSpec |
|
216 |
name: 'MethodFinderBox' |
|
3675 | 217 |
uuid: '5fb0d36a-89f6-11e9-8df0-b8f6b1108e05' |
3301 | 218 |
component: |
219 |
(SpecCollection |
|
220 |
collection: ( |
|
221 |
(ViewSpec |
|
222 |
name: 'ReceiverArgBox' |
|
223 |
layout: (LayoutFrame 0 0 0 0 0 1 -30 1) |
|
3675 | 224 |
uuid: '5fb0d4f0-89f6-11e9-8df0-b8f6b1108e05' |
3301 | 225 |
component: |
226 |
(SpecCollection |
|
227 |
collection: ( |
|
228 |
(LabelSpec |
|
229 |
label: 'Receiver' |
|
230 |
name: 'ReceiverLabel' |
|
231 |
layout: (LayoutFrame 0 0 0 0 0 0.34000000000000002 28 0) |
|
3675 | 232 |
uuid: '5fb0d6b2-89f6-11e9-8df0-b8f6b1108e05' |
3301 | 233 |
translateLabel: true |
234 |
) |
|
235 |
(ComboListSpec |
|
236 |
name: 'allowedArgments' |
|
237 |
layout: (LayoutFrame 0 0.34000000000000002 1 0 0 0.64000000000000135 28 0) |
|
238 |
activeHelpKey: argumentCount |
|
3675 | 239 |
uuid: '5fb0da9a-89f6-11e9-8df0-b8f6b1108e05' |
3301 | 240 |
model: argCountHolder |
241 |
comboList: argCountList |
|
242 |
useIndex: true |
|
243 |
) |
|
244 |
(LabelSpec |
|
245 |
label: 'Answer' |
|
246 |
name: 'MessageAnswerLabel' |
|
247 |
layout: (LayoutFrame 0 0.64000000000000135 0 0 0 1 28 0) |
|
248 |
activeHelpKey: arg1Value |
|
3675 | 249 |
uuid: '5fb0dd60-89f6-11e9-8df0-b8f6b1108e05' |
3301 | 250 |
translateLabel: true |
251 |
) |
|
252 |
(HorizontalPanelViewSpec |
|
253 |
name: 'HorizontalPanel1' |
|
254 |
layout: (LayoutFrame 0 0 30 0 0 1 0 1) |
|
3675 | 255 |
uuid: '5fb0dee6-89f6-11e9-8df0-b8f6b1108e05' |
3301 | 256 |
horizontalLayout: fit |
257 |
verticalLayout: fit |
|
258 |
horizontalSpace: 3 |
|
259 |
verticalSpace: 3 |
|
260 |
component: |
|
261 |
(SpecCollection |
|
262 |
collection: ( |
|
263 |
(WorkspaceSpec |
|
264 |
name: 'ReceiverEditor' |
|
265 |
activeHelpKey: receiverValue |
|
3675 | 266 |
uuid: '5fb0e152-89f6-11e9-8df0-b8f6b1108e05' |
3301 | 267 |
tabable: true |
268 |
hasHorizontalScrollBar: true |
|
269 |
hasVerticalScrollBar: true |
|
270 |
miniScrollerHorizontal: true |
|
271 |
miniScrollerVertical: true |
|
272 |
autoHideScrollBars: true |
|
273 |
hasKeyboardFocusInitially: false |
|
3675 | 274 |
extent: (Point 86 142) |
3301 | 275 |
postBuildCallback: receiverWidgetCreated: |
276 |
) |
|
277 |
(VerticalPanelViewSpec |
|
278 |
name: 'VerticalPanel1' |
|
3675 | 279 |
uuid: '5fb0e51c-89f6-11e9-8df0-b8f6b1108e05' |
3301 | 280 |
horizontalLayout: fit |
281 |
verticalLayout: fit |
|
282 |
horizontalSpace: 3 |
|
283 |
verticalSpace: 3 |
|
284 |
component: |
|
285 |
(SpecCollection |
|
286 |
collection: ( |
|
287 |
(ViewSpec |
|
288 |
name: 'Box1' |
|
3675 | 289 |
uuid: '5fb0e6d4-89f6-11e9-8df0-b8f6b1108e05' |
3301 | 290 |
visibilityChannel: arg1BoxVisible |
291 |
component: |
|
292 |
(SpecCollection |
|
293 |
collection: ( |
|
294 |
(WorkspaceSpec |
|
295 |
name: 'Arg1Editor' |
|
296 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
297 |
activeHelpKey: arg1Value |
|
3675 | 298 |
uuid: '5fb0e7ce-89f6-11e9-8df0-b8f6b1108e05' |
3301 | 299 |
tabable: true |
300 |
hasHorizontalScrollBar: true |
|
301 |
hasVerticalScrollBar: true |
|
302 |
miniScrollerHorizontal: true |
|
303 |
miniScrollerVertical: true |
|
304 |
autoHideScrollBars: true |
|
305 |
hasKeyboardFocusInitially: false |
|
306 |
postBuildCallback: argument1WidgetCreated: |
|
307 |
) |
|
308 |
) |
|
309 |
||
310 |
) |
|
3675 | 311 |
extent: (Point 87 45) |
3301 | 312 |
) |
313 |
(ViewSpec |
|
314 |
name: 'Box2' |
|
3675 | 315 |
uuid: '5fb0e9b8-89f6-11e9-8df0-b8f6b1108e05' |
3301 | 316 |
visibilityChannel: arg2BoxVisible |
317 |
component: |
|
318 |
(SpecCollection |
|
319 |
collection: ( |
|
320 |
(WorkspaceSpec |
|
321 |
name: 'TextEditor5' |
|
322 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
323 |
activeHelpKey: arg2Value |
|
3675 | 324 |
uuid: '5fb0eabc-89f6-11e9-8df0-b8f6b1108e05' |
3301 | 325 |
tabable: true |
326 |
hasHorizontalScrollBar: true |
|
327 |
hasVerticalScrollBar: true |
|
328 |
miniScrollerHorizontal: true |
|
329 |
miniScrollerVertical: true |
|
330 |
autoHideScrollBars: true |
|
331 |
hasKeyboardFocusInitially: false |
|
332 |
postBuildCallback: argument2WidgetCreated: |
|
333 |
) |
|
334 |
) |
|
335 |
||
336 |
) |
|
3675 | 337 |
extent: (Point 87 46) |
3301 | 338 |
) |
339 |
(ViewSpec |
|
340 |
name: 'Box3' |
|
3675 | 341 |
uuid: '5fb0ec74-89f6-11e9-8df0-b8f6b1108e05' |
3301 | 342 |
visibilityChannel: arg3BoxVisible |
343 |
component: |
|
344 |
(SpecCollection |
|
345 |
collection: ( |
|
346 |
(WorkspaceSpec |
|
347 |
name: 'TextEditor6' |
|
348 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
349 |
activeHelpKey: arg3Value |
|
3675 | 350 |
uuid: '5fb0ed64-89f6-11e9-8df0-b8f6b1108e05' |
3301 | 351 |
tabable: true |
352 |
hasHorizontalScrollBar: true |
|
353 |
hasVerticalScrollBar: true |
|
354 |
miniScrollerHorizontal: true |
|
355 |
miniScrollerVertical: true |
|
356 |
autoHideScrollBars: true |
|
357 |
hasKeyboardFocusInitially: false |
|
358 |
postBuildCallback: argument3WidgetCreated: |
|
359 |
) |
|
360 |
) |
|
361 |
||
362 |
) |
|
3675 | 363 |
extent: (Point 87 45) |
3301 | 364 |
) |
365 |
) |
|
366 |
||
367 |
) |
|
3675 | 368 |
extent: (Point 87 142) |
3301 | 369 |
) |
370 |
(WorkspaceSpec |
|
371 |
name: 'AnswerEditor' |
|
372 |
activeHelpKey: answerValue |
|
3675 | 373 |
uuid: '5fb0ef30-89f6-11e9-8df0-b8f6b1108e05' |
3301 | 374 |
tabable: true |
375 |
hasHorizontalScrollBar: true |
|
376 |
hasVerticalScrollBar: true |
|
377 |
miniScrollerHorizontal: true |
|
378 |
miniScrollerVertical: true |
|
379 |
autoHideScrollBars: true |
|
380 |
hasKeyboardFocusInitially: false |
|
3675 | 381 |
extent: (Point 87 142) |
3301 | 382 |
postBuildCallback: messageAnswerWidgetCreated: |
383 |
) |
|
384 |
) |
|
385 |
||
386 |
) |
|
387 |
) |
|
388 |
) |
|
389 |
||
390 |
) |
|
391 |
) |
|
392 |
(ViewSpec |
|
393 |
name: 'ReceiverArgBoxActionBox' |
|
394 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
|
3675 | 395 |
uuid: '5fb0f0fc-89f6-11e9-8df0-b8f6b1108e05' |
3301 | 396 |
component: |
397 |
(SpecCollection |
|
398 |
collection: ( |
|
399 |
(ActionButtonSpec |
|
400 |
label: 'Clear' |
|
401 |
name: 'Button2' |
|
402 |
layout: (LayoutFrame 5 0 0 0 -5 0.5 0 1) |
|
403 |
activeHelpKey: clearButton |
|
3675 | 404 |
uuid: '5fb0f214-89f6-11e9-8df0-b8f6b1108e05' |
3301 | 405 |
translateLabel: true |
406 |
model: clear |
|
407 |
) |
|
408 |
(ActionButtonSpec |
|
409 |
label: 'Search' |
|
410 |
name: 'Button1' |
|
411 |
layout: (LayoutFrame 5 0.5 0 0 -5 1 0 1) |
|
412 |
activeHelpKey: startSearchButton |
|
3675 | 413 |
uuid: '5fb0f52a-89f6-11e9-8df0-b8f6b1108e05' |
3301 | 414 |
translateLabel: true |
415 |
tabable: true |
|
416 |
model: search |
|
417 |
) |
|
418 |
) |
|
419 |
||
420 |
) |
|
421 |
) |
|
422 |
) |
|
423 |
||
424 |
) |
|
425 |
) |
|
426 |
(ViewSpec |
|
427 |
name: 'SelectorFinderBox' |
|
3675 | 428 |
uuid: '5fb0f714-89f6-11e9-8df0-b8f6b1108e05' |
3301 | 429 |
component: |
430 |
(SpecCollection |
|
431 |
collection: ( |
|
432 |
(ViewSpec |
|
433 |
name: 'MatchActionBox' |
|
434 |
layout: (LayoutFrame 0 0 0 0 0 1 90 0) |
|
3675 | 435 |
uuid: '5fb0f818-89f6-11e9-8df0-b8f6b1108e05' |
3301 | 436 |
component: |
437 |
(SpecCollection |
|
438 |
collection: ( |
|
439 |
(LabelSpec |
|
440 |
label: 'Selector Pattern:' |
|
441 |
name: 'Label1' |
|
442 |
layout: (LayoutFrame 0 0 0 0 0 0.5 25 0) |
|
3675 | 443 |
uuid: '5fb0f908-89f6-11e9-8df0-b8f6b1108e05' |
3301 | 444 |
translateLabel: true |
445 |
adjust: left |
|
446 |
) |
|
447 |
(InputFieldSpec |
|
448 |
name: 'EntryField1' |
|
449 |
layout: (LayoutFrame 2 0 -54 1 -2 1 -29 1) |
|
3675 | 450 |
activeHelpKey: selectorPattern |
451 |
uuid: '5fb0fa70-89f6-11e9-8df0-b8f6b1108e05' |
|
3301 | 452 |
model: selectorPatternHolder |
453 |
immediateAccept: true |
|
454 |
acceptOnReturn: true |
|
455 |
acceptOnTab: true |
|
456 |
acceptOnPointerLeave: true |
|
457 |
) |
|
458 |
(ActionButtonSpec |
|
459 |
label: 'Search' |
|
460 |
name: 'Button4' |
|
461 |
layout: (LayoutFrame 5 0.5 -25 1 -5 1 0 1) |
|
3675 | 462 |
activeHelpKey: startSearchPatternButton |
463 |
uuid: '5fb0fea8-89f6-11e9-8df0-b8f6b1108e05' |
|
3301 | 464 |
translateLabel: true |
465 |
tabable: true |
|
466 |
model: searchPatternMatchesInBackground |
|
467 |
) |
|
468 |
) |
|
469 |
||
470 |
) |
|
471 |
) |
|
472 |
(SequenceViewSpec |
|
473 |
name: 'ResultList' |
|
474 |
layout: (LayoutFrame 0 0 94 0 0 1 0 1) |
|
3675 | 475 |
activeHelpKey: implementorsFound |
476 |
uuid: '5fb1009c-89f6-11e9-8df0-b8f6b1108e05' |
|
3301 | 477 |
model: selectedImplementorsHolder |
478 |
menu: resultListMenu |
|
479 |
hasHorizontalScrollBar: true |
|
480 |
hasVerticalScrollBar: true |
|
481 |
autoHideScrollBars: true |
|
482 |
useIndex: true |
|
483 |
sequenceList: resultHolder |
|
484 |
) |
|
485 |
) |
|
486 |
||
487 |
) |
|
488 |
) |
|
489 |
) |
|
490 |
||
491 |
) |
|
492 |
handles: (Any 0.28000000000000003 1.0) |
|
493 |
) |
|
494 |
(VariableVerticalPanelSpec |
|
495 |
name: 'RightBox' |
|
3675 | 496 |
uuid: '5fb103c6-89f6-11e9-8df0-b8f6b1108e05' |
3301 | 497 |
component: |
498 |
(SpecCollection |
|
499 |
collection: ( |
|
500 |
(SequenceViewSpec |
|
501 |
name: 'List2' |
|
3675 | 502 |
uuid: '5fb10524-89f6-11e9-8df0-b8f6b1108e05' |
3301 | 503 |
model: selectedClassOfResultHolder |
504 |
menu: implementorListMenu |
|
505 |
hasHorizontalScrollBar: true |
|
506 |
hasVerticalScrollBar: true |
|
507 |
autoHideScrollBars: true |
|
508 |
doubleClickSelector: openBrowserOn: |
|
509 |
valueChangeSelector: selectedClassOfResultHolderChanged |
|
510 |
useIndex: false |
|
511 |
sequenceList: classOfResultHolder |
|
512 |
) |
|
513 |
(CodeViewSpec |
|
514 |
name: 'CodeView' |
|
3675 | 515 |
uuid: '5fb106dc-89f6-11e9-8df0-b8f6b1108e05' |
3301 | 516 |
model: codeHolder |
517 |
hasHorizontalScrollBar: true |
|
518 |
hasVerticalScrollBar: true |
|
519 |
autoHideScrollBars: true |
|
520 |
hasKeyboardFocusInitially: false |
|
3675 | 521 |
viewClassName: 'codeViewClass' |
3301 | 522 |
postBuildCallback: sourceCodeWidgetCreated: |
523 |
) |
|
524 |
) |
|
525 |
||
526 |
) |
|
527 |
handles: (Any 0.23999999999999999 1.0) |
|
528 |
) |
|
529 |
) |
|
530 |
||
531 |
) |
|
532 |
handles: (Any 0.33000000000000002 1.0) |
|
533 |
) |
|
534 |
) |
|
535 |
||
536 |
) |
|
537 |
) |
|
538 |
! |
|
539 |
||
540 |
windowSpec_old |
|
541 |
"This resource specification was automatically generated |
|
542 |
by the UIPainter of ST/X." |
|
543 |
||
544 |
"Do not manually edit this!! If it is corrupted, |
|
545 |
the UIPainter may not be able to read the specification." |
|
546 |
||
547 |
" |
|
548 |
UIPainter new openOnClass:MethodFinderWindow andSelector:#windowSpec |
|
549 |
MethodFinderWindow new openInterface:#windowSpec |
|
550 |
MethodFinderWindow open |
|
551 |
" |
|
552 |
||
553 |
<resource: #canvas> |
|
554 |
||
555 |
^ |
|
556 |
#(FullSpec |
|
557 |
name: windowSpec |
|
558 |
window: |
|
559 |
(WindowSpec |
|
560 |
label: 'MethodFinder' |
|
561 |
name: 'MethodFinder' |
|
3289 | 562 |
bounds: (Rectangle 0 0 920 690) |
563 |
menu: menu |
|
564 |
icon: defaultIcon |
|
565 |
) |
|
566 |
component: |
|
567 |
(SpecCollection |
|
568 |
collection: ( |
|
569 |
(VariableHorizontalPanelSpec |
|
570 |
name: 'VariableHorizontalPanel1' |
|
571 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
572 |
snapMode: both |
|
573 |
component: |
|
574 |
(SpecCollection |
|
575 |
collection: ( |
|
576 |
(ViewSpec |
|
577 |
name: 'LeftBox' |
|
578 |
level: 1 |
|
579 |
component: |
|
580 |
(SpecCollection |
|
581 |
collection: ( |
|
582 |
(ViewSpec |
|
583 |
name: 'ReceiverArgBox' |
|
584 |
layout: (LayoutFrame 0 0 0 0 0 1 -100 0.5) |
|
585 |
component: |
|
586 |
(SpecCollection |
|
587 |
collection: ( |
|
588 |
(LabelSpec |
|
589 |
label: 'Receiver' |
|
590 |
name: 'ReceiverLabel' |
|
591 |
layout: (LayoutFrame 0 0 0 0 0 0.34000000000000002 28 0) |
|
592 |
translateLabel: true |
|
593 |
) |
|
594 |
(ComboListSpec |
|
595 |
name: 'allowedArgments' |
|
3292 | 596 |
layout: (LayoutFrame 0 0.34000000000000002 1 0 0 0.64000000000000046 28 0) |
597 |
activeHelpKey: argumentCount |
|
3289 | 598 |
model: argCountHolder |
599 |
comboList: argCountList |
|
600 |
useIndex: true |
|
601 |
) |
|
602 |
(LabelSpec |
|
603 |
label: 'Answer' |
|
604 |
name: 'MessageAnswerLabel' |
|
3292 | 605 |
layout: (LayoutFrame 0 0.64000000000000046 0 0 0 1 28 0) |
606 |
activeHelpKey: arg1Value |
|
3289 | 607 |
translateLabel: true |
608 |
) |
|
609 |
(HorizontalPanelViewSpec |
|
610 |
name: 'HorizontalPanel1' |
|
611 |
layout: (LayoutFrame 0 0 30 0 0 1 0 1) |
|
612 |
horizontalLayout: fit |
|
613 |
verticalLayout: fit |
|
614 |
horizontalSpace: 3 |
|
615 |
verticalSpace: 3 |
|
616 |
component: |
|
617 |
(SpecCollection |
|
618 |
collection: ( |
|
619 |
(WorkspaceSpec |
|
620 |
name: 'ReceiverEditor' |
|
3292 | 621 |
activeHelpKey: receiverValue |
3289 | 622 |
tabable: true |
623 |
hasHorizontalScrollBar: true |
|
624 |
hasVerticalScrollBar: true |
|
625 |
miniScrollerHorizontal: true |
|
626 |
miniScrollerVertical: true |
|
627 |
autoHideScrollBars: true |
|
628 |
hasKeyboardFocusInitially: false |
|
629 |
extent: (Point 110 214) |
|
630 |
postBuildCallback: receiverWidgetCreated: |
|
631 |
) |
|
632 |
(VerticalPanelViewSpec |
|
633 |
name: 'VerticalPanel1' |
|
634 |
horizontalLayout: fit |
|
635 |
verticalLayout: fit |
|
636 |
horizontalSpace: 3 |
|
637 |
verticalSpace: 3 |
|
638 |
component: |
|
639 |
(SpecCollection |
|
640 |
collection: ( |
|
641 |
(ViewSpec |
|
642 |
name: 'Box1' |
|
643 |
visibilityChannel: arg1BoxVisible |
|
644 |
component: |
|
645 |
(SpecCollection |
|
646 |
collection: ( |
|
647 |
(WorkspaceSpec |
|
648 |
name: 'Arg1Editor' |
|
649 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
3292 | 650 |
activeHelpKey: arg1Value |
3289 | 651 |
tabable: true |
652 |
hasHorizontalScrollBar: true |
|
653 |
hasVerticalScrollBar: true |
|
654 |
miniScrollerHorizontal: true |
|
655 |
miniScrollerVertical: true |
|
656 |
autoHideScrollBars: true |
|
657 |
hasKeyboardFocusInitially: false |
|
658 |
postBuildCallback: argument1WidgetCreated: |
|
1532 | 659 |
) |
3289 | 660 |
) |
661 |
||
662 |
) |
|
663 |
extent: (Point 110 69) |
|
664 |
) |
|
665 |
(ViewSpec |
|
666 |
name: 'Box2' |
|
667 |
visibilityChannel: arg2BoxVisible |
|
668 |
component: |
|
669 |
(SpecCollection |
|
670 |
collection: ( |
|
671 |
(WorkspaceSpec |
|
672 |
name: 'TextEditor5' |
|
673 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
3292 | 674 |
activeHelpKey: arg2Value |
3289 | 675 |
tabable: true |
676 |
hasHorizontalScrollBar: true |
|
677 |
hasVerticalScrollBar: true |
|
678 |
miniScrollerHorizontal: true |
|
679 |
miniScrollerVertical: true |
|
680 |
autoHideScrollBars: true |
|
681 |
hasKeyboardFocusInitially: false |
|
682 |
postBuildCallback: argument2WidgetCreated: |
|
1532 | 683 |
) |
3289 | 684 |
) |
685 |
||
686 |
) |
|
687 |
extent: (Point 110 70) |
|
688 |
) |
|
689 |
(ViewSpec |
|
690 |
name: 'Box3' |
|
691 |
visibilityChannel: arg3BoxVisible |
|
692 |
component: |
|
693 |
(SpecCollection |
|
694 |
collection: ( |
|
695 |
(WorkspaceSpec |
|
696 |
name: 'TextEditor6' |
|
697 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
3292 | 698 |
activeHelpKey: arg3Value |
3289 | 699 |
tabable: true |
700 |
hasHorizontalScrollBar: true |
|
701 |
hasVerticalScrollBar: true |
|
702 |
miniScrollerHorizontal: true |
|
703 |
miniScrollerVertical: true |
|
704 |
autoHideScrollBars: true |
|
705 |
hasKeyboardFocusInitially: false |
|
706 |
postBuildCallback: argument3WidgetCreated: |
|
1532 | 707 |
) |
3289 | 708 |
) |
709 |
||
710 |
) |
|
711 |
extent: (Point 110 69) |
|
1530 | 712 |
) |
3289 | 713 |
) |
714 |
||
715 |
) |
|
716 |
extent: (Point 110 214) |
|
717 |
) |
|
718 |
(WorkspaceSpec |
|
719 |
name: 'AnswerEditor' |
|
3292 | 720 |
activeHelpKey: answerValue |
3289 | 721 |
tabable: true |
722 |
hasHorizontalScrollBar: true |
|
723 |
hasVerticalScrollBar: true |
|
724 |
miniScrollerHorizontal: true |
|
725 |
miniScrollerVertical: true |
|
726 |
autoHideScrollBars: true |
|
727 |
hasKeyboardFocusInitially: false |
|
728 |
extent: (Point 110 214) |
|
729 |
postBuildCallback: messageAnswerWidgetCreated: |
|
1525 | 730 |
) |
3289 | 731 |
) |
732 |
||
733 |
) |
|
734 |
) |
|
735 |
) |
|
736 |
||
737 |
) |
|
738 |
) |
|
739 |
(ViewSpec |
|
740 |
name: 'ReceiverArgBoxActionBox' |
|
741 |
layout: (LayoutFrame 0 0 -98 0.5 0 1 -75 0.5) |
|
742 |
component: |
|
743 |
(SpecCollection |
|
744 |
collection: ( |
|
745 |
(ActionButtonSpec |
|
3292 | 746 |
activeHelpKey: clearButton |
3289 | 747 |
label: 'Clear' |
748 |
name: 'Button2' |
|
749 |
layout: (LayoutFrame 5 0 0 0 -5 0.5 0 1) |
|
750 |
translateLabel: true |
|
751 |
model: clear |
|
1532 | 752 |
) |
3289 | 753 |
(ActionButtonSpec |
3292 | 754 |
activeHelpKey: startSearchButton |
3289 | 755 |
label: 'Search' |
756 |
name: 'Button1' |
|
757 |
layout: (LayoutFrame 5 0.5 0 0 -5 1 0 1) |
|
758 |
translateLabel: true |
|
759 |
tabable: true |
|
760 |
model: search |
|
761 |
) |
|
762 |
) |
|
763 |
||
764 |
) |
|
765 |
) |
|
766 |
(ViewSpec |
|
767 |
name: 'MatchActionBox' |
|
3290 | 768 |
layout: (LayoutFrame 0 0 -70 0.5 0 1 10 0.5) |
3289 | 769 |
component: |
770 |
(SpecCollection |
|
771 |
collection: ( |
|
772 |
(LabelSpec |
|
773 |
label: 'Selector Pattern:' |
|
774 |
name: 'Label1' |
|
775 |
layout: (LayoutFrame 0 0 0 0 0 0.5 25 0) |
|
776 |
translateLabel: true |
|
777 |
adjust: left |
|
1522 | 778 |
) |
3289 | 779 |
(InputFieldSpec |
780 |
name: 'EntryField1' |
|
3290 | 781 |
layout: (LayoutFrame 2 0 -54 1 -2 1 -29 1) |
3292 | 782 |
model: selectorPatternHolder |
3289 | 783 |
immediateAccept: true |
784 |
acceptOnReturn: true |
|
785 |
acceptOnTab: true |
|
786 |
acceptOnPointerLeave: true |
|
787 |
) |
|
788 |
(ActionButtonSpec |
|
789 |
label: 'Search' |
|
790 |
name: 'Button4' |
|
791 |
layout: (LayoutFrame 5 0.5 -25 1 -5 1 0 1) |
|
792 |
translateLabel: true |
|
793 |
tabable: true |
|
794 |
model: searchPatternMatchesInBackground |
|
2886 | 795 |
) |
3289 | 796 |
) |
797 |
||
798 |
) |
|
799 |
) |
|
800 |
(SequenceViewSpec |
|
801 |
name: 'ResultList' |
|
3290 | 802 |
layout: (LayoutFrame 0 0 15 0.5 0 1 0 1) |
3289 | 803 |
model: selectedImplementorsHolder |
804 |
menu: resultListMenu |
|
805 |
hasHorizontalScrollBar: true |
|
806 |
hasVerticalScrollBar: true |
|
807 |
autoHideScrollBars: true |
|
808 |
useIndex: true |
|
809 |
sequenceList: resultHolder |
|
1530 | 810 |
) |
3289 | 811 |
) |
812 |
||
813 |
) |
|
814 |
) |
|
815 |
(VariableVerticalPanelSpec |
|
816 |
name: 'VariableVerticalPanel1' |
|
817 |
component: |
|
818 |
(SpecCollection |
|
819 |
collection: ( |
|
820 |
(SequenceViewSpec |
|
821 |
name: 'List2' |
|
822 |
model: selectedClassOfResultHolder |
|
823 |
menu: implementorListMenu |
|
824 |
hasHorizontalScrollBar: true |
|
825 |
hasVerticalScrollBar: true |
|
826 |
autoHideScrollBars: true |
|
827 |
doubleClickSelector: openBrowserOn: |
|
828 |
valueChangeSelector: selectedClassOfResultHolderChanged |
|
829 |
useIndex: false |
|
830 |
sequenceList: classOfResultHolder |
|
1522 | 831 |
) |
3289 | 832 |
(CodeViewSpec |
833 |
name: 'CodeView' |
|
834 |
model: codeHolder |
|
835 |
hasHorizontalScrollBar: true |
|
836 |
hasVerticalScrollBar: true |
|
837 |
autoHideScrollBars: true |
|
838 |
hasKeyboardFocusInitially: false |
|
839 |
postBuildCallback: sourceCodeWidgetCreated: |
|
3292 | 840 |
viewClassName: 'codeViewClass' |
3289 | 841 |
) |
842 |
) |
|
843 |
||
844 |
) |
|
845 |
handles: (Any 0.5 1.0) |
|
1522 | 846 |
) |
3289 | 847 |
) |
848 |
||
849 |
) |
|
3292 | 850 |
handles: (Any 0.37391304347826104 1.0) |
1522 | 851 |
) |
3289 | 852 |
) |
853 |
||
854 |
) |
|
855 |
) |
|
1522 | 856 |
! ! |
857 |
||
1525 | 858 |
!MethodFinderWindow class methodsFor:'menu specs'! |
859 |
||
1529 | 860 |
implementorListMenu |
861 |
"This resource specification was automatically generated |
|
862 |
by the MenuEditor of ST/X." |
|
863 |
||
864 |
"Do not manually edit this!! If it is corrupted, |
|
865 |
the MenuEditor may not be able to read the specification." |
|
866 |
||
867 |
" |
|
868 |
MenuEditor new openOnClass:MethodFinderWindow andSelector:#implementorListMenu |
|
869 |
(Menu new fromLiteralArrayEncoding:(MethodFinderWindow implementorListMenu)) startUp |
|
870 |
" |
|
871 |
||
872 |
<resource: #menu> |
|
873 |
||
874 |
^ |
|
875 |
#(#Menu |
|
876 |
#( |
|
877 |
#(#MenuItem |
|
878 |
#label: 'Browse' |
|
879 |
#translateLabel: true |
|
880 |
#value: #openBrowserOnSelectedItem |
|
881 |
) |
|
882 |
) |
|
883 |
nil |
|
884 |
nil |
|
885 |
) |
|
886 |
! |
|
887 |
||
1525 | 888 |
menu |
889 |
"This resource specification was automatically generated |
|
890 |
by the MenuEditor of ST/X." |
|
891 |
||
892 |
"Do not manually edit this!! If it is corrupted, |
|
893 |
the MenuEditor may not be able to read the specification." |
|
894 |
||
895 |
" |
|
896 |
MenuEditor new openOnClass:MethodFinderWindow andSelector:#menu |
|
897 |
(Menu new fromLiteralArrayEncoding:(MethodFinderWindow menu)) startUp |
|
898 |
" |
|
899 |
||
900 |
<resource: #menu> |
|
901 |
||
902 |
^ |
|
903 |
#(#Menu |
|
904 |
#( |
|
905 |
#(#MenuItem |
|
906 |
#label: '&File' |
|
907 |
#activeHelpKey: #file |
|
908 |
#submenu: |
|
909 |
#(#Menu |
|
910 |
#( |
|
911 |
#(#MenuItem |
|
912 |
#label: 'Exit' |
|
913 |
#value: #closeRequest |
|
914 |
#activeHelpKey: #fileExit |
|
915 |
) |
|
916 |
) |
|
917 |
nil |
|
918 |
nil |
|
919 |
) |
|
920 |
) |
|
921 |
#(#MenuItem |
|
3193 | 922 |
label: 'MENU_Help' |
923 |
startGroup: conditionalRight |
|
1525 | 924 |
#submenu: |
925 |
#(#Menu |
|
926 |
#( |
|
927 |
#(#MenuItem |
|
928 |
#label: 'Documentation' |
|
929 |
#value: #openHTMLDocumentation |
|
930 |
#activeHelpKey: #helpTutorial |
|
931 |
) |
|
932 |
#(#MenuItem |
|
1532 | 933 |
#label: 'About MethodFinder...' |
1525 | 934 |
#value: #openAboutThisApplication |
935 |
#activeHelpKey: #aboutThisAppliaction |
|
936 |
) |
|
937 |
) |
|
938 |
nil |
|
939 |
nil |
|
940 |
) |
|
941 |
) |
|
942 |
) |
|
943 |
nil |
|
944 |
nil |
|
945 |
) |
|
1532 | 946 |
|
947 |
"Modified: / 13.11.2001 / 12:36:39 / cg" |
|
2927 | 948 |
! |
949 |
||
950 |
resultListMenu |
|
951 |
"This resource specification was automatically generated |
|
952 |
by the MenuEditor of ST/X." |
|
953 |
||
954 |
"Do not manually edit this!! If it is corrupted, |
|
955 |
the MenuEditor may not be able to read the specification." |
|
956 |
||
957 |
" |
|
958 |
MenuEditor new openOnClass:MethodFinderWindow andSelector:#implementorListMenu |
|
959 |
(Menu new fromLiteralArrayEncoding:(MethodFinderWindow implementorListMenu)) startUp |
|
960 |
" |
|
961 |
||
962 |
<resource: #menu> |
|
963 |
||
964 |
^ |
|
965 |
#(#Menu |
|
966 |
#( |
|
967 |
#(#MenuItem |
|
3024 | 968 |
#label: 'Browse Senders' |
969 |
#translateLabel: true |
|
970 |
#value: #openBrowserOnSenderOfSelectedResultItem |
|
971 |
) |
|
972 |
#(#MenuItem |
|
2927 | 973 |
#label: 'Browse Implementors' |
974 |
#translateLabel: true |
|
975 |
#value: #openBrowserOnSelectedResultItem |
|
976 |
) |
|
977 |
) |
|
978 |
nil |
|
979 |
nil |
|
980 |
) |
|
981 |
||
982 |
"Created: / 21-09-2012 / 11:05:15 / cg" |
|
1525 | 983 |
! ! |
984 |
||
3289 | 985 |
!MethodFinderWindow class methodsFor:'startup'! |
986 |
||
987 |
openOnSelectorPattern:selector |
|
988 |
|app| |
|
989 |
||
990 |
app := self new. |
|
991 |
app allButOpen. |
|
3292 | 992 |
app selectorPatternHolder value:selector. |
3289 | 993 |
app openWindow. |
3290 | 994 |
"/ app waitForBackgroundSearchFinished. |
995 |
||
3289 | 996 |
^ app |
997 |
||
998 |
" |
|
999 |
self openOnSelectorPattern:'asLowercase' |
|
1000 |
" |
|
1001 |
! ! |
|
1002 |
||
1522 | 1003 |
!MethodFinderWindow methodsFor:'accessing'! |
1004 |
||
1005 |
receiver |
|
1525 | 1006 |
"Return a copy of the value of the instance variable 'receiver' " |
1522 | 1007 |
|
1008 |
^ receiver copy |
|
1009 |
! ! |
|
1010 |
||
1011 |
!MethodFinderWindow methodsFor:'actions'! |
|
1012 |
||
1013 |
clear |
|
3292 | 1014 |
"Reset the contents of all the outputs." |
1522 | 1015 |
|
1016 |
receiverEditor contents:nil. |
|
1017 |
argument1Editor contents:nil. |
|
1018 |
argument2Editor contents:nil. |
|
1019 |
argument3Editor contents:nil. |
|
1020 |
messageAnswerEditor contents:nil. |
|
1021 |
self resultHolder value:nil. |
|
1525 | 1022 |
self classOfResultHolder value: nil. |
2730 | 1023 |
codeHolder value:nil. |
1522 | 1024 |
! |
1025 |
||
1026 |
messageAnswerEditorContents |
|
3024 | 1027 |
"Return a cleaned up version of message answer taken from the messageAnswerEditor |
1028 |
as an association. The association has cleanedAnswerString as a key and the |
|
1029 |
compiledAnswer as value." |
|
1030 |
||
1031 |
|aCleanedAnswerString compiledAnswer| |
|
1522 | 1032 |
|
3024 | 1033 |
aCleanedAnswerString := self cleanInputs:(messageAnswerEditor contents). |
1034 |
compiledAnswer := Compiler evaluate:aCleanedAnswerString. |
|
1035 |
((self isExpression:aCleanedAnswerString) or:[ compiledAnswer isNil ]) ifTrue:[ |
|
1036 |
aCleanedAnswerString := compiledAnswer printString |
|
1037 |
]. |
|
1038 |
^ aCleanedAnswerString -> compiledAnswer. |
|
1522 | 1039 |
! |
1040 |
||
1041 |
openBrowserOn:anArgument |
|
1042 |
"Opens browser on theArgument of a specific class. anArgument being a string with the |
|
1525 | 1043 |
Class and the selector upon which the browser is to be opened. Return the receiver." |
1522 | 1044 |
|
1532 | 1045 |
|classAndSelector| |
1522 | 1046 |
|
1532 | 1047 |
classAndSelector := self extractClassAndSelectorFrom:anArgument. |
1048 |
classAndSelector isNil ifTrue:[ |
|
1525 | 1049 |
^ self |
1522 | 1050 |
]. |
3482 | 1051 |
SystemBrowser default |
2459 | 1052 |
openInClass:classAndSelector key |
1053 |
selector:classAndSelector value |
|
1525 | 1054 |
|
1055 |
" |
|
1056 |
MethodFinderWindow new openBrowserOn: '*SmallInteger +' |
|
1057 |
MethodFinderWindow new openBrowserOn: 'String ,' |
|
1058 |
MethodFinderWindow new openBrowserOn: 'Number detentBy:atMultiplesOf:snap:' |
|
1059 |
||
1060 |
||
1061 |
" |
|
1532 | 1062 |
|
3482 | 1063 |
"Modified: / 01-09-2017 / 14:21:18 / cg" |
1522 | 1064 |
! |
1065 |
||
1529 | 1066 |
openBrowserOnSelectedItem |
2927 | 1067 |
"on the selected implementor" |
1068 |
||
1529 | 1069 |
|sel| |
1070 |
||
1071 |
sel := self selectedClassOfResultHolder value. |
|
1072 |
self openBrowserOn:sel |
|
1532 | 1073 |
|
2927 | 1074 |
"Modified: / 13-11-2001 / 12:47:39 / cg" |
1075 |
"Modified (comment): / 21-09-2012 / 11:08:33 / cg" |
|
1076 |
! |
|
1077 |
||
1078 |
openBrowserOnSelectedResultItem |
|
1079 |
"on an item in the lower left list, |
|
1080 |
on all implementors of that message" |
|
1081 |
||
1082 |
|selIndex selector| |
|
1083 |
||
1084 |
selIndex := self selectedImplementorsHolder value. |
|
1085 |
selIndex isNil ifTrue:[^ self]. |
|
1086 |
||
1087 |
selector := resultSelectors at:selIndex. |
|
1088 |
UserPreferences browserClass browseImplementorsOf:selector. |
|
1089 |
||
1090 |
"Created: / 21-09-2012 / 11:05:46 / cg" |
|
1529 | 1091 |
! |
1092 |
||
3024 | 1093 |
openBrowserOnSenderOfSelectedResultItem |
1094 |
"on an item in the lower left list, |
|
1095 |
on all implementors of that message" |
|
1096 |
||
1097 |
|selIndex selector| |
|
1525 | 1098 |
|
3024 | 1099 |
selIndex := self selectedImplementorsHolder value. |
1100 |
selIndex isNil ifTrue:[^ self]. |
|
1101 |
||
1102 |
selector := resultSelectors at:selIndex. |
|
1103 |
UserPreferences browserClass browseSendersOf:selector. |
|
1104 |
! |
|
1522 | 1105 |
|
1106 |
search |
|
3024 | 1107 |
"Do a search based on the input in the various text editors. Return the receiver." |
3322 | 1108 |
|
3024 | 1109 |
|tempReceiver tempAnswer tempArguments anArray resultArray receiverWithArgument mf| |
1522 | 1110 |
|
3024 | 1111 |
self resultHolder value:nil. |
1112 |
self classOfResultHolder value:nil. |
|
1113 |
self codeHolder value:nil. |
|
1114 |
tempArguments := self argumentEditorsContents. |
|
1115 |
tempReceiver := self receiverEditorContents. |
|
1116 |
tempAnswer := self messageAnswerEditorContents. |
|
1117 |
"self cleanInputRec:tempReceiver arg:tempArguments ans:tempAnswer." |
|
1118 |
anArray := Array new:2. |
|
3292 | 1119 |
receiverWithArgument := self mergeReceiver:(tempReceiver value) |
1120 |
withArgument:(tempArguments values). |
|
3024 | 1121 |
anArray |
1122 |
at:1 put:receiverWithArgument; |
|
1123 |
at:2 put:tempAnswer value. |
|
3322 | 1124 |
"an array now holds the following array #(#(receiver argument) answer) or #(#(receiver) answer). which should |
3024 | 1125 |
be suitable input for the method finder." |
1126 |
self withCursor:Cursor execute |
|
1127 |
do:[ |
|
1128 |
mf := MethodFinder new. |
|
1129 |
resultArray := mf |
|
1130 |
load:anArray; |
|
1131 |
findMessage. |
|
1132 |
]. |
|
1133 |
((resultArray at:1) includesSubString:'no single') ifTrue:[ |
|
1134 |
self warn:(resultArray at:1). |
|
1135 |
^ self |
|
1136 |
]. |
|
1137 |
"the following then replaces data1 and data2 created by the method finder to the appropriate arguments" |
|
3322 | 1138 |
resultArray |
1139 |
keysAndValuesDo:[:key :value | |
|
3024 | 1140 |
|newValue| |
1522 | 1141 |
|
3675 | 1142 |
newValue := value copyReplaceString:'data1' |
1143 |
withString:(tempReceiver value storeString). "/ was: "tempReceiver key" |
|
3024 | 1144 |
(tempArguments size) >= 1 ifTrue:[ |
3675 | 1145 |
newValue := newValue copyReplaceString:'data2' |
1146 |
withString:(tempArguments valueAt:1) storeString "/ was "keyAt:1" |
|
3024 | 1147 |
]. |
1148 |
(tempArguments size) > 1 ifTrue:[ |
|
3544 | 1149 |
newValue := newValue copyReplaceString:'data3' |
3675 | 1150 |
withString:(tempArguments valueAt:2) storeString. "/ was "keyAt:2" |
3024 | 1151 |
]. |
1152 |
(tempArguments size) > 2 ifTrue:[ |
|
3544 | 1153 |
newValue := newValue copyReplaceString:'data4' |
3675 | 1154 |
withString:(tempArguments valueAt:3) storeString. "/ was: keyAt:3 |
3024 | 1155 |
]. |
1156 |
(tempArguments size) > 3 ifTrue:[ |
|
1157 |
self halt:'unimplemented'. |
|
1158 |
]. |
|
3544 | 1159 |
" newValue:= value copyReplaceString: 'data3' withString:(self messageAnswer key). " |
3024 | 1160 |
newValue := newValue , ' --> ' , (tempAnswer key). |
1161 |
newValue replaceAll:Character cr with:Character space. |
|
1162 |
resultArray at:key put:newValue. |
|
1163 |
]. |
|
1164 |
self resultHolder value:resultArray. |
|
1165 |
resultSelectors := mf selectors. |
|
1166 |
receiver := tempReceiver |
|
1532 | 1167 |
|
2859 | 1168 |
"Modified: / 26-09-2011 / 12:42:28 / cg" |
3544 | 1169 |
"Modified: / 27-02-2018 / 11:37:58 / stefan" |
3675 | 1170 |
"Modified: / 08-06-2019 / 16:24:00 / Claus Gittinger" |
1532 | 1171 |
! |
1172 |
||
3023 | 1173 |
searchPatternMatchesInBackground |
1174 |
"Do a search based on the pattern match as a background task" |
|
2886 | 1175 |
|
3023 | 1176 |
| p pattern| |
2891 | 1177 |
|
1178 |
(p := searchProcess) notNil ifTrue:[ |
|
1179 |
searchProcess := nil. |
|
1180 |
p terminate. |
|
1181 |
]. |
|
1182 |
||
3292 | 1183 |
pattern := self selectorPatternHolder value. |
3023 | 1184 |
pattern isEmptyOrNil ifTrue:[ |
1185 |
self resultHolder value:self resultInfoText. |
|
1186 |
self classOfResultHolder value:nil. |
|
1187 |
self codeHolder value:nil. |
|
1188 |
^ self |
|
1189 |
]. |
|
1190 |
||
2891 | 1191 |
searchProcess := |
1192 |
[ |
|
3290 | 1193 |
|list counts firsts seconds selectors resultList idx match| |
2891 | 1194 |
|
1195 |
self withCursor:Cursor execute do:[ |
|
1196 |
pattern includesMatchCharacters ifFalse:[ |
|
3290 | 1197 |
list := SystemBrowser findImplementorsOf:pattern in:Smalltalk allClasses ignoreCase:true. |
3292 | 1198 |
list isEmptyOrNil ifTrue:[ |
1199 |
match := pattern,'*'. |
|
1200 |
list := SystemBrowser findImplementorsMatching:match in:Smalltalk allClasses ignoreCase:true. |
|
1201 |
]. |
|
3290 | 1202 |
] ifTrue:[ |
3292 | 1203 |
"/ match := '*',pattern,'*'. |
1204 |
match := pattern. |
|
3290 | 1205 |
list := SystemBrowser findImplementorsMatching:match in:Smalltalk allClasses ignoreCase:true. |
2891 | 1206 |
]. |
1207 |
]. |
|
3023 | 1208 |
|
1209 |
counts := IdentityDictionary new. |
|
1210 |
firsts := IdentityDictionary new. |
|
1211 |
seconds := IdentityDictionary new. |
|
1212 |
selectors := IdentitySet new. |
|
1213 |
list do:[:eachMethod | |
|
1214 |
|msel| |
|
1215 |
||
1216 |
msel := eachMethod selector. |
|
1217 |
selectors add:msel. |
|
1218 |
(counts at:msel ifAbsentPut:[ 0 asValue ]) increment. |
|
1219 |
(firsts includesKey:msel) ifTrue:[ |
|
1220 |
(seconds includesKey:msel) ifFalse:[ |
|
1221 |
seconds at:msel ifAbsentPut:[ eachMethod mclass ]. |
|
1222 |
]. |
|
1223 |
] ifFalse:[ |
|
1224 |
firsts at:msel ifAbsentPut:[ eachMethod mclass ]. |
|
1225 |
]. |
|
1226 |
]. |
|
1227 |
resultSelectors := selectors asOrderedCollection sort. |
|
1228 |
resultList := resultSelectors |
|
1229 |
collect:[:sel | |
|
1230 |
|cnt s| |
|
1231 |
||
1232 |
s := sel allBold , ' --> '. |
|
1233 |
cnt := (counts at:sel) value. |
|
1234 |
cnt == 1 ifTrue:[ |
|
1235 |
s , (firsts at:sel) name |
|
1236 |
] ifFalse:[ |
|
1237 |
cnt == 2 ifTrue:[ |
|
1238 |
s , (firsts at:sel) name , ' and ' , (seconds at:sel) name |
|
1239 |
] ifFalse:[ |
|
1240 |
s , cnt printString , ' implementor(s)' |
|
1241 |
] |
|
1242 |
]. |
|
1243 |
]. |
|
3292 | 1244 |
|
3290 | 1245 |
self enqueueDelayedAction:[ self updateListAfterPatternSearch: resultList ]. |
2891 | 1246 |
] fork. |
1247 |
||
1248 |
"Created: / 01-06-2012 / 13:16:54 / cg" |
|
1249 |
! |
|
1250 |
||
1522 | 1251 |
updateImplementorsOf:anInteger |
1525 | 1252 |
"Request the implementors of the selected argument provided by aNumber. |
2892 | 1253 |
Return the receiver." |
1254 |
||
1255 |
|methods classList aNumber| |
|
1525 | 1256 |
|
2892 | 1257 |
(anInteger isNil) ifTrue:[ |
1258 |
^ self |
|
1259 |
]. |
|
3646 | 1260 |
aNumber := anInteger ? 1. |
2892 | 1261 |
methods := SystemBrowser |
1262 |
findImplementorsOf:(resultSelectors at:aNumber) |
|
1263 |
in:Smalltalk allClasses |
|
1264 |
ignoreCase:false. |
|
3675 | 1265 |
methods := methods asOrderedCollection. |
1266 |
classList := methods collect:[:m | m mclass name , ' ' , m selector ]. |
|
1267 |
classList := self markMatchingClasses:(resultSelectors at:aNumber) |
|
1268 |
classesWithSelector:classList. |
|
1269 |
"/ now classList contains a list of <className> <selector>, |
|
1270 |
"/ where the one which is responsible for the selected result is marked (bold) |
|
2892 | 1271 |
self classOfResultHolder value:classList. |
3675 | 1272 |
|
1273 |
"/ initially select the bold one |
|
1274 |
classList notEmptyOrNil ifTrue:[ |
|
1275 |
|receiversMethodEntryInClass| |
|
1276 |
||
1277 |
receiversMethodEntryInClass := classList detect:#isText ifNone:nil. |
|
1278 |
receiversMethodEntryInClass notNil ifTrue:[ |
|
1279 |
self selectedClassOfResultHolder value:receiversMethodEntryInClass. |
|
1280 |
] ifFalse:[ |
|
1281 |
self selectedClassOfResultHolder value:(classList first). |
|
1282 |
]. |
|
2892 | 1283 |
self selectedClassOfResultHolderChanged. |
1284 |
] ifFalse:[ |
|
1285 |
self selectedClassOfResultHolder value:nil. |
|
1286 |
]. |
|
1522 | 1287 |
|
2892 | 1288 |
"Modified (comment): / 24-06-2012 / 18:41:45 / cg" |
3675 | 1289 |
"Modified: / 08-06-2019 / 15:39:49 / Claus Gittinger" |
2891 | 1290 |
! |
1291 |
||
3292 | 1292 |
updateListAfterPatternSearch:resultList |
1293 |
|searchPattern idx| |
|
1294 |
||
2892 | 1295 |
self classOfResultHolder value:nil. |
1296 |
self codeHolder value:nil. |
|
3023 | 1297 |
self resultHolder value:resultList. |
2891 | 1298 |
|
3292 | 1299 |
searchPattern := self selectorPatternHolder value. |
1300 |
"/ is the search pattern in the list (i.e. a perfect match)? |
|
1301 |
"/ Then select it. |
|
1302 |
idx := resultSelectors indexOf:searchPattern. |
|
1303 |
idx ~~ 0 ifTrue:[ |
|
1304 |
self selectedImplementorsHolder setValue:idx; changed |
|
1305 |
]. |
|
1522 | 1306 |
! ! |
1307 |
||
1308 |
!MethodFinderWindow methodsFor:'aspects'! |
|
1309 |
||
1310 |
arg1BoxVisible |
|
3292 | 1311 |
"Determines if the box should be visible or not. |
1312 |
Return a holder providing true or false" |
|
1313 |
||
1522 | 1314 |
arg1BoxVisible isNil ifTrue:[ |
1315 |
arg1BoxVisible := BlockValue |
|
3665 | 1316 |
with:[:vh | vh >= 2 ] |
1522 | 1317 |
argument:(self argCountHolder) |
1318 |
]. |
|
1319 |
^ arg1BoxVisible. |
|
3665 | 1320 |
|
1321 |
"Modified: / 17-05-2019 / 16:16:59 / Stefan Vogel" |
|
1522 | 1322 |
! |
1323 |
||
1324 |
arg2BoxVisible |
|
3292 | 1325 |
"Determines if the box should be visible or not. |
1326 |
Return a holder providing true or false" |
|
1327 |
||
1522 | 1328 |
arg2BoxVisible isNil ifTrue:[ |
1329 |
arg2BoxVisible := BlockValue |
|
3665 | 1330 |
with:[:vh | vh >= 3 ] |
1522 | 1331 |
argument:(self argCountHolder) |
1332 |
]. |
|
1333 |
^ arg2BoxVisible. |
|
3665 | 1334 |
|
1335 |
"Modified: / 17-05-2019 / 16:16:54 / Stefan Vogel" |
|
1522 | 1336 |
! |
1337 |
||
1338 |
arg3BoxVisible |
|
3292 | 1339 |
"Determines if the box should be visible or not. |
1340 |
Return a holder providing true or false" |
|
1341 |
||
1522 | 1342 |
arg3BoxVisible isNil ifTrue:[ |
1343 |
arg3BoxVisible := BlockValue |
|
3665 | 1344 |
with:[:vh | vh >= 4 ] |
1522 | 1345 |
argument:(self argCountHolder) |
1346 |
]. |
|
1347 |
^ arg3BoxVisible. |
|
3665 | 1348 |
|
1349 |
"Modified: / 17-05-2019 / 16:16:48 / Stefan Vogel" |
|
1522 | 1350 |
! |
1351 |
||
1352 |
arg4BoxVisible |
|
3292 | 1353 |
"Determines if the box should be visible or not. |
1354 |
Return a holder providing true or false" |
|
1355 |
||
1522 | 1356 |
arg4BoxVisible isNil ifTrue:[ |
1357 |
arg4BoxVisible := BlockValue |
|
3665 | 1358 |
with:[:vh | vh >= 5 ] |
1522 | 1359 |
argument:(self argCountHolder) |
1360 |
]. |
|
1361 |
^ arg4BoxVisible. |
|
3665 | 1362 |
|
1363 |
"Modified: / 17-05-2019 / 16:16:43 / Stefan Vogel" |
|
1522 | 1364 |
! |
1365 |
||
1366 |
argCountHolder |
|
3292 | 1367 |
"Return an argCounterHolder which is initialized at 2." |
1368 |
||
1522 | 1369 |
argCountHolder isNil ifTrue:[ |
1370 |
argCountHolder := 2 asValue. |
|
1371 |
]. |
|
1372 |
^ argCountHolder. |
|
1373 |
! |
|
1374 |
||
1375 |
argCountList |
|
3292 | 1376 |
"Return the argCountList (shown in the combo)" |
1377 |
||
1522 | 1378 |
argCountList isNil ifTrue:[ |
1379 |
argCountList := #('0 arguments' '1 argument' '2 arguments' '3 arguments') asValue |
|
1380 |
]. |
|
1381 |
^ argCountList. |
|
1382 |
! |
|
1383 |
||
1384 |
classOfResultHolder |
|
1525 | 1385 |
"Return a valueHolder which contains a collection with the names of the |
1386 |
implementors of a specific message. " |
|
1522 | 1387 |
|
3292 | 1388 |
classOfResultHolder isNil ifTrue:[ |
1389 |
classOfResultHolder := ValueHolder new. |
|
1522 | 1390 |
]. |
3292 | 1391 |
^ classOfResultHolder |
1522 | 1392 |
! |
1393 |
||
1532 | 1394 |
codeHolder |
1395 |
codeHolder isNil ifTrue:[ |
|
1396 |
codeHolder := '' asValue. |
|
1397 |
]. |
|
1398 |
^ codeHolder. |
|
1399 |
||
1400 |
"Created: / 13.11.2001 / 12:44:11 / cg" |
|
1401 |
! |
|
1402 |
||
3292 | 1403 |
codeViewClass |
1404 |
"the species of view to be created as codeview" |
|
1405 |
||
1406 |
^ Tools::CodeView2 ? CodeView |
|
1407 |
! |
|
1408 |
||
1522 | 1409 |
resultHolder |
1525 | 1410 |
"Return a value holder which contains the results of a search as a collection." |
1522 | 1411 |
|
3292 | 1412 |
resultHolder isNil ifTrue:[ |
1413 |
resultHolder := ValueHolder new. |
|
1414 |
resultHolder value:(self resultInfoText collect:[:l | l withColor:Color darkGrey]). |
|
1522 | 1415 |
]. |
3292 | 1416 |
^ resultHolder. |
2886 | 1417 |
|
2890 | 1418 |
"Modified: / 01-06-2012 / 13:06:02 / cg" |
1529 | 1419 |
! |
1420 |
||
3023 | 1421 |
resultInfoText |
1422 |
^ { |
|
1423 |
'Please enter combination of' . |
|
1424 |
' ',('receiver, arg and result' allBold) . |
|
1425 |
'or a'. |
|
1426 |
' ',('selector search pattern' allBold) . |
|
3289 | 1427 |
'into the above fields.' . |
1428 |
'Then click on either ',('"search"' allBold),'-button.' |
|
3023 | 1429 |
} |
1430 |
! |
|
1431 |
||
1529 | 1432 |
selectedClassOfResultHolder |
2927 | 1433 |
"valueHolder which contains the index of the selected result class (right list)" |
1529 | 1434 |
|
3292 | 1435 |
selectedClassOfResultHolder isNil ifTrue:[ |
1436 |
selectedClassOfResultHolder := ValueHolder new. |
|
1529 | 1437 |
]. |
3292 | 1438 |
^ selectedClassOfResultHolder |
2927 | 1439 |
|
1440 |
"Modified (comment): / 21-09-2012 / 11:10:29 / cg" |
|
1441 |
! |
|
1442 |
||
1443 |
selectedImplementorsHolder |
|
1444 |
"valueHolder which contains the index of the selected implementors list (left list)" |
|
1445 |
||
3292 | 1446 |
selectedImplementorsHolder isNil ifTrue:[ |
1447 |
selectedImplementorsHolder := ValueHolder new. |
|
1448 |
selectedImplementorsHolder onChangeEvaluate:[self updateImplementorsOf:selectedImplementorsHolder value]. |
|
2927 | 1449 |
]. |
3292 | 1450 |
^ selectedImplementorsHolder |
2927 | 1451 |
|
1452 |
"Created: / 21-09-2012 / 11:10:13 / cg" |
|
2886 | 1453 |
! |
1454 |
||
3292 | 1455 |
selectorPatternHolder |
1456 |
selectorPatternHolder isNil ifTrue:[ |
|
1457 |
selectorPatternHolder := ValueHolder new. |
|
1458 |
selectorPatternHolder onChangeSend:#selectorPatternChanged to:self. |
|
2886 | 1459 |
]. |
3292 | 1460 |
^ selectorPatternHolder |
2886 | 1461 |
|
1462 |
"Created: / 27-04-2012 / 14:44:01 / cg" |
|
1522 | 1463 |
! ! |
1464 |
||
1465 |
!MethodFinderWindow methodsFor:'controlInput'! |
|
1466 |
||
3090 | 1467 |
cleanInputs:aDirtyString |
1468 |
"Find and remove common mistakes made by the user. Return the |
|
1525 | 1469 |
'aStringToBeCleaned' variable" |
3090 | 1470 |
|
1471 |
|aStringToBeCleaned rs position| |
|
1522 | 1472 |
|
3090 | 1473 |
aStringToBeCleaned := aDirtyString. |
1474 |
(aStringToBeCleaned endsWith:(Character cr)) ifTrue:[ |
|
1475 |
aStringToBeCleaned := aStringToBeCleaned copyFrom:1 to:(aStringToBeCleaned size - 1). |
|
1476 |
]. |
|
1477 |
aStringToBeCleaned := aStringToBeCleaned withoutSeparators. |
|
1478 |
rs := ReadStream on:aStringToBeCleaned. |
|
1479 |
[ |
|
1480 |
rs upToAll_positionBefore:'#true'. |
|
1481 |
rs atEnd |
|
1482 |
] whileFalse:[ |
|
1483 |
position := rs position. |
|
1484 |
aStringToBeCleaned := aStringToBeCleaned |
|
1485 |
copyReplaceFrom:position |
|
1486 |
to:position |
|
1487 |
with:''. |
|
1488 |
rs := ReadStream on:aStringToBeCleaned. |
|
1489 |
]. |
|
1490 |
rs := ReadStream on:aStringToBeCleaned. |
|
1491 |
[ |
|
1492 |
rs upToAll_positionBefore:'#false'. |
|
1493 |
rs atEnd |
|
1494 |
] whileFalse:[ |
|
1495 |
position := rs position. |
|
1496 |
aStringToBeCleaned := aStringToBeCleaned |
|
1497 |
copyReplaceFrom:position |
|
1498 |
to:position |
|
1499 |
with:''. |
|
1500 |
rs := ReadStream on:aStringToBeCleaned. |
|
1501 |
]. |
|
1502 |
[ |
|
1503 |
rs upToAll_positionBefore:'#nil'. |
|
1504 |
rs atEnd |
|
1505 |
] whileFalse:[ |
|
1506 |
position := rs position. |
|
1507 |
aStringToBeCleaned := aStringToBeCleaned |
|
1508 |
copyReplaceFrom:position |
|
1509 |
to:position |
|
1510 |
with:''. |
|
1511 |
rs := ReadStream on:aStringToBeCleaned. |
|
1512 |
]. |
|
1513 |
^ aStringToBeCleaned |
|
1522 | 1514 |
! |
1515 |
||
3315 | 1516 |
markMatchingClasses:aSelector classesWithSelector:anOrderedCollection |
3090 | 1517 |
" Matches the class of the receiver with all the elements in anOrderedCollection |
1518 |
(which are classes with selectors). If a match is found it is marked with an asterisk. |
|
3315 | 1519 |
The classes are then sorted so the asterisk appears first. Return the |
3090 | 1520 |
markedClassList." |
1521 |
||
3675 | 1522 |
|marker recClass unmarkedClassList markedClassList toMark| |
1522 | 1523 |
|
3090 | 1524 |
marker := self class markerForImplementingClass. |
1525 |
recClass := receiver value class. |
|
3675 | 1526 |
|
1527 |
toMark := OrderedCollection new. |
|
1528 |
||
3090 | 1529 |
unmarkedClassList := anOrderedCollection copy. |
3315 | 1530 |
unmarkedClassList do:[:classAndMethod | |
3290 | 1531 |
|className class sel| |
1532 | 1532 |
|
3675 | 1533 |
className := (classAndMethod copyButLast:aSelector size) withoutSeparators. |
3290 | 1534 |
class := Smalltalk classNamed:className. "/ Compiler evaluate:className. |
3315 | 1535 |
|
3090 | 1536 |
"/ (recClass == class) |
3315 | 1537 |
|
3090 | 1538 |
(recClass whichClassImplements:aSelector) == class ifTrue:[ |
3675 | 1539 |
toMark add:classAndMethod. |
1532 | 1540 |
]. |
3090 | 1541 |
]. |
3675 | 1542 |
unmarkedClassList removeAll:toMark. |
1543 |
unmarkedClassList addAll:(toMark collect:#allBold). |
|
1544 |
||
3315 | 1545 |
unmarkedClassList |
1546 |
sort:[:a :b | |
|
3090 | 1547 |
|rawA rawB| |
1522 | 1548 |
|
3090 | 1549 |
rawA := a string withoutPrefix:marker. |
1550 |
rawB := b string withoutPrefix:marker. |
|
1551 |
rawA < rawB. |
|
1552 |
]. |
|
1553 |
markedClassList := unmarkedClassList. |
|
1554 |
^ markedClassList |
|
1532 | 1555 |
|
3675 | 1556 |
"Modified: / 13-11-2001 / 12:16:05 / cg" |
1557 |
"Modified: / 08-06-2019 / 15:36:30 / Claus Gittinger" |
|
1522 | 1558 |
! |
1559 |
||
3292 | 1560 |
mergeReceiver: aReceiver withArgument: arguments |
1522 | 1561 |
|
1525 | 1562 |
"Puts the receiver and arguments into an array so it can be of a suitable input for the |
1563 |
MethodFinder. Return an array." |
|
1564 |
||
1522 | 1565 |
| tempReceiver tempArguments receiverWithArgument| |
1566 |
||
1567 |
tempReceiver:= aReceiver. |
|
1568 |
tempArguments := arguments. |
|
1569 |
||
1570 |
(tempArguments isEmpty or:[(tempArguments) isNil]) |
|
1571 |
ifTrue:[ receiverWithArgument:=Array new:1."no argument" |
|
1572 |
receiverWithArgument at:1 put: tempReceiver. |
|
1573 |
] |
|
1574 |
ifFalse:[ |
|
1575 |
(tempArguments size = 1) |
|
1576 |
ifTrue:[ receiverWithArgument:=Array new:2. |
|
1577 |
receiverWithArgument at:1 put: tempReceiver. |
|
1578 |
receiverWithArgument at:2 put: (tempArguments at:1) |
|
1579 |
]. "a receiver with an argument" |
|
1580 |
||
1581 |
(tempArguments size = 2) |
|
1582 |
ifTrue:[ receiverWithArgument:=Array new:3. |
|
1583 |
receiverWithArgument at:1 put: tempReceiver. |
|
1584 |
(receiverWithArgument at:2 put: (tempArguments at:1)). |
|
1585 |
(receiverWithArgument at:3 put: (tempArguments at:2)) |
|
1586 |
]. "a receiver with an argument" |
|
1587 |
(tempArguments size = 3) |
|
1588 |
ifTrue:[ receiverWithArgument:=Array new:4. |
|
1589 |
receiverWithArgument at:1 put: tempReceiver. |
|
1590 |
(receiverWithArgument at:2 put: (tempArguments at:1)). |
|
1591 |
(receiverWithArgument at:3 put: (tempArguments at:2)). |
|
1592 |
(receiverWithArgument at:4 put: (tempArguments at:3)). |
|
1593 |
||
1594 |
]. "a receiver with an argument" |
|
1595 |
||
1596 |
]. |
|
1597 |
^receiverWithArgument |
|
1598 |
! ! |
|
1599 |
||
3292 | 1600 |
!MethodFinderWindow methodsFor:'initialization'! |
1601 |
||
1602 |
argument1WidgetCreated: aWidget |
|
1603 |
"UI post creation hook. remember the widget as an instance variable." |
|
1604 |
||
1605 |
argument1Editor := aWidget scrolledView. |
|
1606 |
aWidget tabMeansNextField:true. |
|
1607 |
||
1608 |
"Modified: / 13.11.2001 / 12:21:41 / cg" |
|
1609 |
! |
|
1610 |
||
1611 |
argument2WidgetCreated: aWidget |
|
1612 |
"UI post creation hook. remember the widget as an instance variable." |
|
1613 |
||
1614 |
argument2Editor := aWidget scrolledView. |
|
1615 |
aWidget tabMeansNextField:true. |
|
1616 |
||
1617 |
"Modified: / 13.11.2001 / 12:21:45 / cg" |
|
1618 |
! |
|
1619 |
||
1620 |
argument3WidgetCreated: aWidget |
|
1621 |
"UI post creation hook. remember the widget as an instance variable" |
|
1622 |
||
1623 |
argument3Editor := aWidget scrolledView. |
|
1624 |
aWidget tabMeansNextField:true. |
|
1625 |
||
1626 |
"Modified: / 13.11.2001 / 12:21:49 / cg" |
|
1627 |
! |
|
1628 |
||
1629 |
messageAnswerWidgetCreated: aWidget |
|
1630 |
"UI post creation hook. remember the widget as an instance variable." |
|
1631 |
||
1632 |
messageAnswerEditor := aWidget scrolledView. |
|
1633 |
aWidget tabMeansNextField:true. |
|
1634 |
||
1635 |
"Modified: / 13.11.2001 / 12:24:55 / cg" |
|
1636 |
! |
|
1637 |
||
1638 |
receiverWidgetCreated: aWidget |
|
1639 |
"UI post creation hook. remember the widget as an instance variable." |
|
1640 |
||
1641 |
receiverEditor := aWidget scrolledView. |
|
1642 |
aWidget tabMeansNextField:true. |
|
1643 |
||
1644 |
"Modified: / 13.11.2001 / 12:24:49 / cg" |
|
1645 |
! |
|
1646 |
||
1647 |
sourceCodeWidgetCreated: aWidget |
|
1648 |
"UI post creation hook. make the codeView readonly" |
|
1649 |
||
1650 |
aWidget acceptAction:nil. |
|
1651 |
aWidget readOnly:true |
|
1652 |
||
1653 |
"Created: / 13.11.2001 / 12:50:27 / cg" |
|
1654 |
"Modified: / 13.11.2001 / 12:51:23 / cg" |
|
1655 |
! ! |
|
1656 |
||
1657 |
!MethodFinderWindow methodsFor:'menu actions'! |
|
1532 | 1658 |
|
1659 |
aboutThisApplicationText |
|
1660 |
|msg| |
|
1661 |
||
1662 |
msg := super aboutThisApplicationText. |
|
3292 | 1663 |
msg := msg , '\\Original written by Ted Kaehler, Scott Wallace and Dan Ingalls. |
1664 |
Ported from Squeak to ST/X by James Hayes (2001 james@exept.de). |
|
1665 |
Improved by Claus Gittinger. |
|
1666 |
'. |
|
1532 | 1667 |
^msg withCRs. |
1668 |
||
1669 |
"Modified: / 13.11.2001 / 12:56:44 / cg" |
|
3292 | 1670 |
! |
1671 |
||
1672 |
openHTMLDocumentation |
|
1673 |
"about/help menu action" |
|
1674 |
||
1675 |
HTMLDocumentView openFullOnDocumentationFile:'tools/misc/TOP.html#METHODFINDER' |
|
1676 |
! ! |
|
1677 |
||
1678 |
!MethodFinderWindow methodsFor:'private'! |
|
1679 |
||
1680 |
argumentEditorsContents |
|
1681 |
||
1682 |
"Determine how many text editors of the arguments are used and store the result |
|
1683 |
as argCounter. The result being the minimum between how many editors have |
|
1684 |
expressions in and how many are displayed. |
|
1685 |
||
1686 |
Add each argument string (key)and the evaluated version (value) to an Ordered Dictionary |
|
1687 |
from each of the text editors. |
|
1688 |
||
1689 |
Return the OrderedDictionary with the expressions from all the text editors. " |
|
1690 |
||
1691 |
| tempArguments argCounter tempArgument1Editor tempArgument2Editor tempArgument3Editor |
|
1692 |
associationKey associationValue| |
|
1693 |
||
1694 |
argCounter:=0. |
|
1695 |
||
1696 |
tempArgument1Editor:= (self cleanInputs: argument1Editor contents). |
|
1697 |
tempArgument2Editor:= (self cleanInputs: argument2Editor contents). |
|
1698 |
tempArgument3Editor:= (self cleanInputs: argument3Editor contents). |
|
1699 |
||
1700 |
tempArgument1Editor = '' ifFalse:[argCounter:=argCounter +1]. |
|
1701 |
tempArgument2Editor = '' ifFalse:[argCounter:=argCounter +1]. |
|
1702 |
tempArgument3Editor = '' ifFalse:[argCounter:=argCounter +1]. |
|
1703 |
||
1704 |
||
1705 |
argCounter:= (argCounter min: (self argCountHolder value -1)). |
|
1706 |
tempArguments:= OrderedDictionary new:argCounter. |
|
1707 |
||
1708 |
(argCounter value >= 1) |
|
1709 |
ifTrue:[associationValue:= (Compiler evaluate: tempArgument1Editor). |
|
1710 |
((self isExpression:tempArgument1Editor) or:[ associationValue isNil]) ifTrue:[ "looks if an expression is typed in" |
|
1711 |
associationKey:=associationValue printString] |
|
1712 |
ifFalse:[ |
|
1713 |
associationKey:=tempArgument1Editor]. |
|
1714 |
||
1715 |
tempArguments add: associationKey-> associationValue. |
|
1716 |
]. |
|
1717 |
(argCounter value >= 2) |
|
1718 |
ifTrue:[ associationValue:= (Compiler evaluate: tempArgument2Editor). |
|
1719 |
(((self isExpression:tempArgument2Editor) or:[ associationValue isNil])) ifTrue:[ "looks if an expression is typed in" |
|
1720 |
associationKey:=associationValue printString] |
|
1721 |
ifFalse:[ |
|
1722 |
associationKey:=tempArgument2Editor]. |
|
1723 |
||
1724 |
tempArguments add: associationKey-> associationValue]. |
|
1725 |
||
1726 |
(argCounter value >= 3) |
|
1727 |
ifTrue:[ associationValue:= (Compiler evaluate: tempArgument3Editor). |
|
1728 |
((self isExpression:tempArgument3Editor) or:[ associationValue isNil]) ifTrue:[ "looks if an expression is typed in" |
|
1729 |
associationKey:=associationValue printString] |
|
1730 |
ifFalse:[ |
|
1731 |
associationKey:=tempArgument3Editor]. |
|
1732 |
||
1733 |
tempArguments add: associationKey-> associationValue]. |
|
1734 |
||
1735 |
||
1736 |
^tempArguments |
|
1737 |
! |
|
1738 |
||
1739 |
extractClassAndSelectorFrom:anArgument |
|
1740 |
"Opens browser on theArgument of a specific class. anArgument being a string with the |
|
1741 |
Class and the selector upon which the browser is to be opened. Return the receiver." |
|
1742 |
||
1743 |
|aClass aSelector x theArgument marker| |
|
1744 |
||
1745 |
anArgument isNil ifTrue:[ |
|
1746 |
^ nil |
|
1747 |
]. |
|
1748 |
marker := self class markerForImplementingClass. |
|
1749 |
||
1750 |
theArgument := anArgument string withoutPrefix:marker. |
|
1751 |
aClass := theArgument copyUpTo:(Character space). |
|
1752 |
x := aClass size + 2. |
|
1753 |
aSelector := theArgument copyFrom:x. |
|
1754 |
aClass := Smalltalk classNamed:aClass. |
|
1755 |
(aSelector startsWith:'class ') ifTrue:[ |
|
1756 |
aSelector := aSelector withoutPrefix:'class '. |
|
1757 |
aClass := aClass class. |
|
1758 |
]. |
|
1759 |
^ aClass -> aSelector asSymbol |
|
1760 |
||
1761 |
" |
|
1762 |
MethodFinderWindow new extractClassAndSelectorFrom: '*SmallInteger +' |
|
1763 |
MethodFinderWindow new extractClassAndSelectorFrom: 'String ,' |
|
1764 |
MethodFinderWindow new extractClassAndSelectorFrom: 'Number detentBy:atMultiplesOf:snap:' |
|
1765 |
||
1766 |
||
1767 |
" |
|
1768 |
||
1769 |
"Modified: / 27-04-2012 / 15:05:53 / cg" |
|
1770 |
! |
|
1771 |
||
1772 |
isExpression:aString |
|
1773 |
"Return true or false depending on if the subString includes certain characters" |
|
1774 |
||
1775 |
"/ cg: this is naive - why not ask the parser, if it is a literal? |
|
1776 |
(aString includesSubString:': ') ifTrue:[ |
|
1777 |
^ true |
|
1778 |
]. |
|
1779 |
(aString includes:$+) ifTrue:[ |
|
1780 |
^ true |
|
1781 |
]. |
|
1782 |
(aString includes:$-) ifTrue:[ |
|
1783 |
^ true |
|
1784 |
]. |
|
1785 |
(aString includes:$*) ifTrue:[ |
|
1786 |
^ true |
|
1787 |
]. |
|
1788 |
(aString includes:$/) ifTrue:[ |
|
1789 |
^ true |
|
1790 |
]. |
|
1791 |
(aString includes:$>) ifTrue:[ |
|
1792 |
^ true |
|
1793 |
]. |
|
1794 |
(aString includes:$<) ifTrue:[ |
|
1795 |
^ true |
|
1796 |
]. |
|
1797 |
(aString includesSubString:' new') ifTrue:[ |
|
1798 |
^ true |
|
1799 |
]. |
|
1800 |
(aString includes:$[) |
|
1801 |
& (aString includes:$]) |
|
1802 |
& (aString includes:$.) ifTrue:[ ^ false ]. |
|
1803 |
||
1804 |
(aString includes:$.) ifTrue:[ |
|
1805 |
^ true |
|
1806 |
]. |
|
1807 |
^ false |
|
1808 |
! |
|
1809 |
||
1810 |
receiverEditorContents |
|
1811 |
"Return a cleaned up version of receiver taken from the receiverEditor |
|
3322 | 1812 |
as an association. The association has aCleanedReceiverString as a key and the |
3292 | 1813 |
compiledReceiver as value." |
3322 | 1814 |
|
1815 |
|aCleanedReceiverString compiledReceiver| |
|
3292 | 1816 |
|
3322 | 1817 |
aCleanedReceiverString := self cleanInputs:(receiverEditor contents). |
1818 |
compiledReceiver := Compiler evaluate:aCleanedReceiverString. |
|
1819 |
((self isExpression:aCleanedReceiverString) or:[ compiledReceiver isNil ]) ifTrue:[ |
|
1820 |
aCleanedReceiverString := compiledReceiver printString |
|
3292 | 1821 |
]. |
3322 | 1822 |
^ aCleanedReceiverString -> compiledReceiver. |
3292 | 1823 |
! |
1824 |
||
1825 |
waitForBackgroundSearchFinished |
|
1826 |
| p | |
|
1827 |
||
1828 |
(p := searchProcess) isNil ifTrue:[^ self]. |
|
1829 |
p isDead ifTrue:[^ self]. |
|
1830 |
p waitUntilTerminated |
|
1831 |
! ! |
|
1832 |
||
1833 |
!MethodFinderWindow methodsFor:'user actions'! |
|
1834 |
||
1835 |
selectedClassOfResultHolderChanged |
|
1836 |
|sel classAndSelector mthd| |
|
1837 |
||
1838 |
sel := self selectedClassOfResultHolder value. |
|
1839 |
||
1840 |
classAndSelector := self extractClassAndSelectorFrom:sel. |
|
1841 |
classAndSelector isNil ifTrue:[ |
|
1842 |
^ self |
|
1843 |
]. |
|
1844 |
mthd := classAndSelector key >> classAndSelector value. |
|
1845 |
mthd notNil ifTrue:[ |
|
1846 |
self withWaitCursorDo:[ |
|
1847 |
self codeHolder value:mthd source |
|
1848 |
] |
|
1849 |
] ifFalse:[ |
|
1850 |
self codeHolder value:nil |
|
1851 |
]. |
|
1852 |
||
1853 |
"Created: / 13.11.2001 / 12:43:43 / cg" |
|
1854 |
"Modified: / 13.11.2001 / 12:48:56 / cg" |
|
1855 |
! |
|
1856 |
||
1857 |
selectorPatternChanged |
|
1858 |
self searchPatternMatchesInBackground |
|
1859 |
||
1860 |
"Created: / 01-06-2012 / 13:18:16 / cg" |
|
1532 | 1861 |
! ! |
1862 |
||
1522 | 1863 |
!MethodFinderWindow class methodsFor:'documentation'! |
1864 |
||
1865 |
version |
|
1866 |
^ '$Header$' |
|
2730 | 1867 |
! |
1868 |
||
1869 |
version_CVS |
|
1870 |
^ '$Header$' |
|
1522 | 1871 |
! ! |
3003 | 1872 |