1522
|
1 |
"{ Package: 'stx:libtool2' }"
|
|
2 |
|
|
3 |
ApplicationModel subclass:#MethodFinderWindow
|
|
4 |
instanceVariableNames:'argumentsEditor messageAnswerEditor receiverEditor receiver
|
|
5 |
resultSelectors arg2BoxVisible arg1BoxVisible arg4BoxVisible
|
|
6 |
arg3BoxVisible argCountHolder argCountList argument1Editor
|
|
7 |
argument2Editor argument3Editor argument4Editor resultSelected
|
2891
|
8 |
lookAtResultEditor codeHolder searchProcess'
|
1522
|
9 |
classVariableNames:''
|
|
10 |
poolDictionaries:''
|
1538
|
11 |
category:'Interface-MethodFinder'
|
1522
|
12 |
!
|
|
13 |
|
1530
|
14 |
!MethodFinderWindow class methodsFor:'documentation'!
|
|
15 |
|
|
16 |
documentation
|
|
17 |
"
|
1531
|
18 |
[author:]
|
|
19 |
ported from Squeak and GUI enhanced by James Hayes james@exept.de
|
1530
|
20 |
"
|
|
21 |
! !
|
1522
|
22 |
|
1532
|
23 |
!MethodFinderWindow class methodsFor:'constants'!
|
|
24 |
|
2890
|
25 |
defaultIcon
|
|
26 |
^ ToolbarIconLibrary methodFinder24x24Icon
|
|
27 |
|
|
28 |
"Created: / 01-06-2012 / 13:05:11 / cg"
|
|
29 |
!
|
|
30 |
|
1532
|
31 |
markerForImplementingClass
|
|
32 |
^ '=> '.
|
|
33 |
^ '*'
|
|
34 |
|
|
35 |
"Created: / 13.11.2001 / 12:09:52 / cg"
|
|
36 |
"Modified: / 13.11.2001 / 12:11:57 / cg"
|
|
37 |
! !
|
|
38 |
|
1522
|
39 |
!MethodFinderWindow class methodsFor:'interface specs'!
|
|
40 |
|
|
41 |
windowSpec
|
|
42 |
"This resource specification was automatically generated
|
|
43 |
by the UIPainter of ST/X."
|
|
44 |
|
|
45 |
"Do not manually edit this!! If it is corrupted,
|
|
46 |
the UIPainter may not be able to read the specification."
|
|
47 |
|
|
48 |
"
|
|
49 |
UIPainter new openOnClass:MethodFinderWindow andSelector:#windowSpec
|
|
50 |
MethodFinderWindow new openInterface:#windowSpec
|
|
51 |
MethodFinderWindow open
|
|
52 |
"
|
|
53 |
|
|
54 |
<resource: #canvas>
|
|
55 |
|
|
56 |
^
|
2886
|
57 |
#(FullSpec
|
|
58 |
name: windowSpec
|
|
59 |
window:
|
|
60 |
(WindowSpec
|
|
61 |
label: 'MethodFinder'
|
|
62 |
name: 'MethodFinder'
|
2890
|
63 |
bounds: (Rectangle 0 0 798 595)
|
2886
|
64 |
menu: menu
|
2890
|
65 |
icon: defaultIcon
|
1522
|
66 |
)
|
2886
|
67 |
component:
|
|
68 |
(SpecCollection
|
|
69 |
collection: (
|
|
70 |
(VariableHorizontalPanelSpec
|
|
71 |
name: 'VariableHorizontalPanel1'
|
|
72 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
|
|
73 |
snapMode: both
|
|
74 |
component:
|
|
75 |
(SpecCollection
|
|
76 |
collection: (
|
|
77 |
(ViewSpec
|
|
78 |
name: 'LeftBox'
|
|
79 |
level: 1
|
|
80 |
component:
|
|
81 |
(SpecCollection
|
|
82 |
collection: (
|
|
83 |
(ViewSpec
|
|
84 |
name: 'ReceiverArgBox'
|
2887
|
85 |
layout: (LayoutFrame 0 0 0 0 0 1 -100 0.5)
|
2886
|
86 |
component:
|
|
87 |
(SpecCollection
|
|
88 |
collection: (
|
|
89 |
(LabelSpec
|
|
90 |
label: 'Receiver'
|
|
91 |
name: 'ReceiverLabel'
|
|
92 |
layout: (LayoutFrame 0 0 0 0 0 0.34 24 0)
|
|
93 |
translateLabel: true
|
|
94 |
)
|
|
95 |
(ComboListSpec
|
|
96 |
name: 'allowedArgments'
|
|
97 |
layout: (LayoutFrame 0 0.34 1 0 0 0.64 23 0)
|
|
98 |
model: argCountHolder
|
|
99 |
comboList: argCountList
|
|
100 |
useIndex: true
|
1530
|
101 |
)
|
2886
|
102 |
(LabelSpec
|
|
103 |
label: 'Answer'
|
|
104 |
name: 'MessageAnswerLabel'
|
|
105 |
layout: (LayoutFrame 0 0.64 0 0 0 1 24 0)
|
|
106 |
translateLabel: true
|
1532
|
107 |
)
|
2886
|
108 |
(HorizontalPanelViewSpec
|
|
109 |
name: 'HorizontalPanel1'
|
|
110 |
layout: (LayoutFrame 0 0 25 0 0 1 0 1)
|
|
111 |
horizontalLayout: fit
|
|
112 |
verticalLayout: fit
|
|
113 |
horizontalSpace: 3
|
|
114 |
verticalSpace: 3
|
|
115 |
component:
|
|
116 |
(SpecCollection
|
|
117 |
collection: (
|
|
118 |
(WorkspaceSpec
|
|
119 |
name: 'ReceiverEditor'
|
|
120 |
tabable: true
|
|
121 |
hasHorizontalScrollBar: true
|
|
122 |
hasVerticalScrollBar: true
|
|
123 |
miniScrollerHorizontal: true
|
|
124 |
miniScrollerVertical: true
|
|
125 |
autoHideScrollBars: true
|
|
126 |
hasKeyboardFocusInitially: false
|
2890
|
127 |
extent: (Point 113 172)
|
2886
|
128 |
postBuildCallback: receiverWidgetCreated:
|
1532
|
129 |
)
|
2886
|
130 |
(VerticalPanelViewSpec
|
|
131 |
name: 'VerticalPanel1'
|
|
132 |
horizontalLayout: fit
|
|
133 |
verticalLayout: fit
|
|
134 |
horizontalSpace: 3
|
|
135 |
verticalSpace: 3
|
|
136 |
component:
|
|
137 |
(SpecCollection
|
|
138 |
collection: (
|
|
139 |
(ViewSpec
|
|
140 |
name: 'Box1'
|
|
141 |
visibilityChannel: arg1BoxVisible
|
|
142 |
component:
|
|
143 |
(SpecCollection
|
|
144 |
collection: (
|
|
145 |
(WorkspaceSpec
|
|
146 |
name: 'Arg1Editor'
|
|
147 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
|
|
148 |
tabable: true
|
|
149 |
hasHorizontalScrollBar: true
|
|
150 |
hasVerticalScrollBar: true
|
|
151 |
miniScrollerHorizontal: true
|
|
152 |
miniScrollerVertical: true
|
|
153 |
autoHideScrollBars: true
|
|
154 |
hasKeyboardFocusInitially: false
|
|
155 |
postBuildCallback: argument1WidgetCreated:
|
1532
|
156 |
)
|
|
157 |
)
|
|
158 |
|
|
159 |
)
|
2890
|
160 |
extent: (Point 114 55)
|
1532
|
161 |
)
|
2886
|
162 |
(ViewSpec
|
|
163 |
name: 'Box2'
|
|
164 |
visibilityChannel: arg2BoxVisible
|
|
165 |
component:
|
|
166 |
(SpecCollection
|
|
167 |
collection: (
|
|
168 |
(WorkspaceSpec
|
|
169 |
name: 'TextEditor5'
|
|
170 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
|
|
171 |
tabable: true
|
|
172 |
hasHorizontalScrollBar: true
|
|
173 |
hasVerticalScrollBar: true
|
|
174 |
miniScrollerHorizontal: true
|
|
175 |
miniScrollerVertical: true
|
|
176 |
autoHideScrollBars: true
|
|
177 |
hasKeyboardFocusInitially: false
|
|
178 |
postBuildCallback: argument2WidgetCreated:
|
1532
|
179 |
)
|
|
180 |
)
|
|
181 |
|
|
182 |
)
|
2890
|
183 |
extent: (Point 114 56)
|
1532
|
184 |
)
|
2886
|
185 |
(ViewSpec
|
|
186 |
name: 'Box3'
|
|
187 |
visibilityChannel: arg3BoxVisible
|
|
188 |
component:
|
|
189 |
(SpecCollection
|
|
190 |
collection: (
|
|
191 |
(WorkspaceSpec
|
|
192 |
name: 'TextEditor6'
|
|
193 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
|
|
194 |
tabable: true
|
|
195 |
hasHorizontalScrollBar: true
|
|
196 |
hasVerticalScrollBar: true
|
|
197 |
miniScrollerHorizontal: true
|
|
198 |
miniScrollerVertical: true
|
|
199 |
autoHideScrollBars: true
|
|
200 |
hasKeyboardFocusInitially: false
|
|
201 |
postBuildCallback: argument3WidgetCreated:
|
1532
|
202 |
)
|
|
203 |
)
|
|
204 |
|
|
205 |
)
|
2890
|
206 |
extent: (Point 114 55)
|
1530
|
207 |
)
|
|
208 |
)
|
|
209 |
|
|
210 |
)
|
2890
|
211 |
extent: (Point 114 172)
|
1530
|
212 |
)
|
2886
|
213 |
(WorkspaceSpec
|
|
214 |
name: 'AnswerEditor'
|
|
215 |
tabable: true
|
|
216 |
hasHorizontalScrollBar: true
|
|
217 |
hasVerticalScrollBar: true
|
|
218 |
miniScrollerHorizontal: true
|
|
219 |
miniScrollerVertical: true
|
|
220 |
autoHideScrollBars: true
|
|
221 |
hasKeyboardFocusInitially: false
|
2890
|
222 |
extent: (Point 114 172)
|
2886
|
223 |
postBuildCallback: messageAnswerWidgetCreated:
|
1525
|
224 |
)
|
|
225 |
)
|
|
226 |
|
|
227 |
)
|
|
228 |
)
|
1532
|
229 |
)
|
|
230 |
|
|
231 |
)
|
|
232 |
)
|
2886
|
233 |
(ViewSpec
|
|
234 |
name: 'ReceiverArgBoxActionBox'
|
2887
|
235 |
layout: (LayoutFrame 0 0 -98 0.5 0 1 -75 0.5)
|
2886
|
236 |
component:
|
|
237 |
(SpecCollection
|
|
238 |
collection: (
|
|
239 |
(ActionButtonSpec
|
|
240 |
label: 'Clear'
|
|
241 |
name: 'Button2'
|
|
242 |
layout: (LayoutFrame 5 0 0 0 -5 0.5 0 1)
|
|
243 |
translateLabel: true
|
|
244 |
model: clear
|
1532
|
245 |
)
|
2886
|
246 |
(ActionButtonSpec
|
|
247 |
label: 'Search'
|
|
248 |
name: 'Button1'
|
|
249 |
layout: (LayoutFrame 5 0.5 0 0 -5 1 0 1)
|
|
250 |
translateLabel: true
|
|
251 |
tabable: true
|
|
252 |
model: search
|
1522
|
253 |
)
|
|
254 |
)
|
|
255 |
|
|
256 |
)
|
|
257 |
)
|
2886
|
258 |
(ViewSpec
|
|
259 |
name: 'MatchActionBox'
|
2887
|
260 |
layout: (LayoutFrame 0 0 -70 0.5 0 1 -20 0.5)
|
2886
|
261 |
component:
|
|
262 |
(SpecCollection
|
|
263 |
collection: (
|
|
264 |
(LabelSpec
|
|
265 |
label: 'Selector Pattern:'
|
|
266 |
name: 'Label1'
|
2887
|
267 |
layout: (LayoutFrame 0 0 0 0 0 0.5 25 0)
|
2886
|
268 |
translateLabel: true
|
|
269 |
adjust: left
|
|
270 |
)
|
|
271 |
(InputFieldSpec
|
|
272 |
name: 'EntryField1'
|
2887
|
273 |
layout: (LayoutFrame 0 0 -25 1 0 0.5 -5 1)
|
2886
|
274 |
model: selectorPattern
|
|
275 |
immediateAccept: true
|
|
276 |
acceptOnReturn: true
|
|
277 |
acceptOnTab: true
|
|
278 |
acceptOnPointerLeave: true
|
|
279 |
)
|
|
280 |
(ActionButtonSpec
|
|
281 |
label: 'Search'
|
|
282 |
name: 'Button4'
|
|
283 |
layout: (LayoutFrame 5 0.5 -25 1 -5 1 0 1)
|
|
284 |
translateLabel: true
|
|
285 |
tabable: true
|
3023
|
286 |
model: searchPatternMatchesInBackground
|
2886
|
287 |
)
|
|
288 |
)
|
|
289 |
|
|
290 |
)
|
|
291 |
)
|
|
292 |
(SequenceViewSpec
|
|
293 |
name: 'ResultList'
|
2887
|
294 |
layout: (LayoutFrame 0 0 -15 0.5 0 1 0 1)
|
2927
|
295 |
model: selectedImplementorsHolder
|
|
296 |
menu: resultListMenu
|
2886
|
297 |
hasHorizontalScrollBar: true
|
|
298 |
hasVerticalScrollBar: true
|
|
299 |
autoHideScrollBars: true
|
|
300 |
valueChangeSelector: updateImplementorsOf:
|
|
301 |
useIndex: true
|
|
302 |
sequenceList: resultHolder
|
|
303 |
)
|
1530
|
304 |
)
|
|
305 |
|
|
306 |
)
|
|
307 |
)
|
2886
|
308 |
(VariableVerticalPanelSpec
|
|
309 |
name: 'VariableVerticalPanel1'
|
|
310 |
component:
|
|
311 |
(SpecCollection
|
|
312 |
collection: (
|
|
313 |
(SequenceViewSpec
|
|
314 |
name: 'List2'
|
|
315 |
model: selectedClassOfResultHolder
|
|
316 |
menu: implementorListMenu
|
|
317 |
hasHorizontalScrollBar: true
|
|
318 |
hasVerticalScrollBar: true
|
|
319 |
autoHideScrollBars: true
|
|
320 |
doubleClickSelector: openBrowserOn:
|
|
321 |
valueChangeSelector: selectedClassOfResultHolderChanged
|
|
322 |
useIndex: false
|
|
323 |
sequenceList: classOfResultHolder
|
1530
|
324 |
)
|
2886
|
325 |
(CodeViewSpec
|
|
326 |
name: 'CodeView'
|
|
327 |
model: codeHolder
|
|
328 |
hasHorizontalScrollBar: true
|
|
329 |
hasVerticalScrollBar: true
|
|
330 |
autoHideScrollBars: true
|
|
331 |
hasKeyboardFocusInitially: false
|
|
332 |
postBuildCallback: sourceCodeWidgetCreated:
|
1522
|
333 |
)
|
|
334 |
)
|
|
335 |
|
|
336 |
)
|
2886
|
337 |
handles: (Any 0.5 1.0)
|
1522
|
338 |
)
|
|
339 |
)
|
|
340 |
|
|
341 |
)
|
2890
|
342 |
handles: (Any 0.443786982248521 1.0)
|
1522
|
343 |
)
|
|
344 |
)
|
|
345 |
|
|
346 |
)
|
|
347 |
)
|
2927
|
348 |
|
|
349 |
"Modified: / 21-09-2012 / 11:09:44 / cg"
|
1522
|
350 |
! !
|
|
351 |
|
1525
|
352 |
!MethodFinderWindow class methodsFor:'menu specs'!
|
|
353 |
|
1529
|
354 |
implementorListMenu
|
|
355 |
"This resource specification was automatically generated
|
|
356 |
by the MenuEditor of ST/X."
|
|
357 |
|
|
358 |
"Do not manually edit this!! If it is corrupted,
|
|
359 |
the MenuEditor may not be able to read the specification."
|
|
360 |
|
|
361 |
"
|
|
362 |
MenuEditor new openOnClass:MethodFinderWindow andSelector:#implementorListMenu
|
|
363 |
(Menu new fromLiteralArrayEncoding:(MethodFinderWindow implementorListMenu)) startUp
|
|
364 |
"
|
|
365 |
|
|
366 |
<resource: #menu>
|
|
367 |
|
|
368 |
^
|
|
369 |
#(#Menu
|
|
370 |
#(
|
|
371 |
#(#MenuItem
|
|
372 |
#label: 'Browse'
|
|
373 |
#translateLabel: true
|
|
374 |
#value: #openBrowserOnSelectedItem
|
|
375 |
)
|
|
376 |
)
|
|
377 |
nil
|
|
378 |
nil
|
|
379 |
)
|
|
380 |
!
|
|
381 |
|
1525
|
382 |
menu
|
|
383 |
"This resource specification was automatically generated
|
|
384 |
by the MenuEditor of ST/X."
|
|
385 |
|
|
386 |
"Do not manually edit this!! If it is corrupted,
|
|
387 |
the MenuEditor may not be able to read the specification."
|
|
388 |
|
|
389 |
"
|
|
390 |
MenuEditor new openOnClass:MethodFinderWindow andSelector:#menu
|
|
391 |
(Menu new fromLiteralArrayEncoding:(MethodFinderWindow menu)) startUp
|
|
392 |
"
|
|
393 |
|
|
394 |
<resource: #menu>
|
|
395 |
|
|
396 |
^
|
|
397 |
#(#Menu
|
|
398 |
#(
|
|
399 |
#(#MenuItem
|
|
400 |
#label: '&File'
|
|
401 |
#activeHelpKey: #file
|
|
402 |
#submenu:
|
|
403 |
#(#Menu
|
|
404 |
#(
|
|
405 |
#(#MenuItem
|
|
406 |
#label: 'Exit'
|
|
407 |
#value: #closeRequest
|
|
408 |
#activeHelpKey: #fileExit
|
|
409 |
)
|
|
410 |
)
|
|
411 |
nil
|
|
412 |
nil
|
|
413 |
)
|
|
414 |
)
|
|
415 |
#(#MenuItem
|
|
416 |
#label: 'Help'
|
|
417 |
#startGroup: #right
|
|
418 |
#submenu:
|
|
419 |
#(#Menu
|
|
420 |
#(
|
|
421 |
#(#MenuItem
|
|
422 |
#label: 'Documentation'
|
|
423 |
#value: #openHTMLDocumentation
|
|
424 |
#activeHelpKey: #helpTutorial
|
|
425 |
)
|
|
426 |
#(#MenuItem
|
1532
|
427 |
#label: 'About MethodFinder...'
|
1525
|
428 |
#value: #openAboutThisApplication
|
|
429 |
#activeHelpKey: #aboutThisAppliaction
|
|
430 |
)
|
|
431 |
)
|
|
432 |
nil
|
|
433 |
nil
|
|
434 |
)
|
|
435 |
)
|
|
436 |
)
|
|
437 |
nil
|
|
438 |
nil
|
|
439 |
)
|
1532
|
440 |
|
|
441 |
"Modified: / 13.11.2001 / 12:36:39 / cg"
|
2927
|
442 |
!
|
|
443 |
|
|
444 |
resultListMenu
|
|
445 |
"This resource specification was automatically generated
|
|
446 |
by the MenuEditor of ST/X."
|
|
447 |
|
|
448 |
"Do not manually edit this!! If it is corrupted,
|
|
449 |
the MenuEditor may not be able to read the specification."
|
|
450 |
|
|
451 |
"
|
|
452 |
MenuEditor new openOnClass:MethodFinderWindow andSelector:#implementorListMenu
|
|
453 |
(Menu new fromLiteralArrayEncoding:(MethodFinderWindow implementorListMenu)) startUp
|
|
454 |
"
|
|
455 |
|
|
456 |
<resource: #menu>
|
|
457 |
|
|
458 |
^
|
|
459 |
#(#Menu
|
|
460 |
#(
|
|
461 |
#(#MenuItem
|
3024
|
462 |
#label: 'Browse Senders'
|
|
463 |
#translateLabel: true
|
|
464 |
#value: #openBrowserOnSenderOfSelectedResultItem
|
|
465 |
)
|
|
466 |
#(#MenuItem
|
2927
|
467 |
#label: 'Browse Implementors'
|
|
468 |
#translateLabel: true
|
|
469 |
#value: #openBrowserOnSelectedResultItem
|
|
470 |
)
|
|
471 |
)
|
|
472 |
nil
|
|
473 |
nil
|
|
474 |
)
|
|
475 |
|
|
476 |
"Created: / 21-09-2012 / 11:05:15 / cg"
|
1525
|
477 |
! !
|
|
478 |
|
1522
|
479 |
!MethodFinderWindow methodsFor:'accessing'!
|
|
480 |
|
|
481 |
receiver
|
1525
|
482 |
"Return a copy of the value of the instance variable 'receiver' "
|
1522
|
483 |
|
|
484 |
^ receiver copy
|
|
485 |
! !
|
|
486 |
|
|
487 |
!MethodFinderWindow methodsFor:'actions'!
|
|
488 |
|
|
489 |
argumentEditorsContents
|
1525
|
490 |
|
|
491 |
"Determine how many text editors of the arguments are used and store the result
|
|
492 |
as argCounter. The result being the minimum between how many editors have
|
|
493 |
expressions in and how many are displayed.
|
|
494 |
|
|
495 |
Add each argument string (key)and the evaluated version (value) to an Ordered Dictionary
|
|
496 |
from each of the text editors.
|
|
497 |
|
|
498 |
Return the OrderedDictionary with the expressions from all the text editors. "
|
|
499 |
|
2165
|
500 |
| tempArguments argCounter tempArgument1Editor tempArgument2Editor tempArgument3Editor
|
1522
|
501 |
associationKey associationValue|
|
|
502 |
|
|
503 |
argCounter:=0.
|
|
504 |
|
|
505 |
tempArgument1Editor:= (self cleanInputs: argument1Editor contents).
|
|
506 |
tempArgument2Editor:= (self cleanInputs: argument2Editor contents).
|
|
507 |
tempArgument3Editor:= (self cleanInputs: argument3Editor contents).
|
|
508 |
|
|
509 |
tempArgument1Editor = '' ifFalse:[argCounter:=argCounter +1].
|
|
510 |
tempArgument2Editor = '' ifFalse:[argCounter:=argCounter +1].
|
|
511 |
tempArgument3Editor = '' ifFalse:[argCounter:=argCounter +1].
|
|
512 |
|
|
513 |
|
|
514 |
argCounter:= (argCounter min: (self argCountHolder value -1)).
|
|
515 |
tempArguments:= OrderedDictionary new:argCounter.
|
|
516 |
|
|
517 |
(argCounter value >= 1)
|
|
518 |
ifTrue:[associationValue:= (Compiler evaluate: tempArgument1Editor).
|
|
519 |
((self isExpression:tempArgument1Editor) or:[ associationValue isNil]) ifTrue:[ "looks if an expression is typed in"
|
|
520 |
associationKey:=associationValue printString]
|
|
521 |
ifFalse:[
|
|
522 |
associationKey:=tempArgument1Editor].
|
|
523 |
|
|
524 |
tempArguments add: associationKey-> associationValue.
|
|
525 |
].
|
|
526 |
(argCounter value >= 2)
|
|
527 |
ifTrue:[ associationValue:= (Compiler evaluate: tempArgument2Editor).
|
|
528 |
(((self isExpression:tempArgument2Editor) or:[ associationValue isNil])) ifTrue:[ "looks if an expression is typed in"
|
|
529 |
associationKey:=associationValue printString]
|
|
530 |
ifFalse:[
|
|
531 |
associationKey:=tempArgument2Editor].
|
|
532 |
|
|
533 |
tempArguments add: associationKey-> associationValue].
|
|
534 |
|
|
535 |
(argCounter value >= 3)
|
|
536 |
ifTrue:[ associationValue:= (Compiler evaluate: tempArgument3Editor).
|
|
537 |
((self isExpression:tempArgument3Editor) or:[ associationValue isNil]) ifTrue:[ "looks if an expression is typed in"
|
|
538 |
associationKey:=associationValue printString]
|
|
539 |
ifFalse:[
|
|
540 |
associationKey:=tempArgument3Editor].
|
|
541 |
|
|
542 |
tempArguments add: associationKey-> associationValue].
|
|
543 |
|
|
544 |
|
|
545 |
^tempArguments
|
|
546 |
!
|
|
547 |
|
|
548 |
clear
|
1525
|
549 |
"Reset the contents of all the outputs. Return the receiver."
|
1522
|
550 |
|
|
551 |
receiverEditor contents:nil.
|
|
552 |
argument1Editor contents:nil.
|
|
553 |
argument2Editor contents:nil.
|
|
554 |
argument3Editor contents:nil.
|
|
555 |
messageAnswerEditor contents:nil.
|
|
556 |
self resultHolder value:nil.
|
1525
|
557 |
self classOfResultHolder value: nil.
|
2730
|
558 |
codeHolder value:nil.
|
1522
|
559 |
!
|
|
560 |
|
1532
|
561 |
extractClassAndSelectorFrom:anArgument
|
|
562 |
"Opens browser on theArgument of a specific class. anArgument being a string with the
|
|
563 |
Class and the selector upon which the browser is to be opened. Return the receiver."
|
|
564 |
|
|
565 |
|aClass aSelector x theArgument marker|
|
|
566 |
|
|
567 |
anArgument isNil ifTrue:[
|
|
568 |
^ nil
|
|
569 |
].
|
|
570 |
marker := self class markerForImplementingClass.
|
|
571 |
|
3003
|
572 |
theArgument := anArgument string withoutPrefix:marker.
|
1532
|
573 |
aClass := theArgument copyUpTo:(Character space).
|
|
574 |
x := aClass size + 2.
|
|
575 |
aSelector := theArgument copyFrom:x.
|
|
576 |
aClass := Smalltalk classNamed:aClass.
|
2886
|
577 |
(aSelector startsWith:'class ') ifTrue:[
|
3003
|
578 |
aSelector := aSelector withoutPrefix:'class '.
|
2886
|
579 |
aClass := aClass class.
|
|
580 |
].
|
1532
|
581 |
^ aClass -> aSelector asSymbol
|
|
582 |
|
|
583 |
"
|
|
584 |
MethodFinderWindow new extractClassAndSelectorFrom: '*SmallInteger +'
|
|
585 |
MethodFinderWindow new extractClassAndSelectorFrom: 'String ,'
|
|
586 |
MethodFinderWindow new extractClassAndSelectorFrom: 'Number detentBy:atMultiplesOf:snap:'
|
|
587 |
|
|
588 |
|
|
589 |
"
|
|
590 |
|
2886
|
591 |
"Modified: / 27-04-2012 / 15:05:53 / cg"
|
1532
|
592 |
!
|
|
593 |
|
3024
|
594 |
isExpression:aString
|
|
595 |
"Return true or false depending on if the subString includes certain characters"
|
|
596 |
|
|
597 |
(aString includesSubString:': ') ifTrue:[
|
|
598 |
^ true
|
|
599 |
].
|
|
600 |
(aString includes:$+) ifTrue:[
|
|
601 |
^ true
|
|
602 |
].
|
|
603 |
(aString includes:$-) ifTrue:[
|
|
604 |
^ true
|
|
605 |
].
|
|
606 |
(aString includes:$*) ifTrue:[
|
|
607 |
^ true
|
|
608 |
].
|
|
609 |
(aString includes:$/) ifTrue:[
|
|
610 |
^ true
|
|
611 |
].
|
|
612 |
(aString includes:$>) ifTrue:[
|
|
613 |
^ true
|
|
614 |
].
|
|
615 |
(aString includes:$<) ifTrue:[
|
|
616 |
^ true
|
|
617 |
].
|
|
618 |
(aString includesSubString:' new') ifTrue:[
|
|
619 |
^ true
|
|
620 |
].
|
|
621 |
(aString includes:$[)
|
|
622 |
& (aString includes:$])
|
|
623 |
& (aString includes:$.) ifTrue:[ ^ false ].
|
1522
|
624 |
|
3024
|
625 |
(aString includes:$.) ifTrue:[
|
|
626 |
^ true
|
|
627 |
].
|
|
628 |
^ false
|
1522
|
629 |
!
|
|
630 |
|
|
631 |
messageAnswerEditorContents
|
3024
|
632 |
"Return a cleaned up version of message answer taken from the messageAnswerEditor
|
|
633 |
as an association. The association has cleanedAnswerString as a key and the
|
|
634 |
compiledAnswer as value."
|
|
635 |
|
|
636 |
|aCleanedAnswerString compiledAnswer|
|
1522
|
637 |
|
3024
|
638 |
aCleanedAnswerString := self cleanInputs:(messageAnswerEditor contents).
|
|
639 |
compiledAnswer := Compiler evaluate:aCleanedAnswerString.
|
|
640 |
((self isExpression:aCleanedAnswerString) or:[ compiledAnswer isNil ]) ifTrue:[
|
|
641 |
aCleanedAnswerString := compiledAnswer printString
|
|
642 |
].
|
|
643 |
^ aCleanedAnswerString -> compiledAnswer.
|
1522
|
644 |
!
|
|
645 |
|
|
646 |
openBrowserOn:anArgument
|
|
647 |
"Opens browser on theArgument of a specific class. anArgument being a string with the
|
1525
|
648 |
Class and the selector upon which the browser is to be opened. Return the receiver."
|
1522
|
649 |
|
1532
|
650 |
|classAndSelector|
|
1522
|
651 |
|
1532
|
652 |
classAndSelector := self extractClassAndSelectorFrom:anArgument.
|
|
653 |
classAndSelector isNil ifTrue:[
|
1525
|
654 |
^ self
|
1522
|
655 |
].
|
3024
|
656 |
UserPreferences systemBrowserClass
|
2459
|
657 |
openInClass:classAndSelector key
|
|
658 |
selector:classAndSelector value
|
1525
|
659 |
|
|
660 |
"
|
|
661 |
MethodFinderWindow new openBrowserOn: '*SmallInteger +'
|
|
662 |
MethodFinderWindow new openBrowserOn: 'String ,'
|
|
663 |
MethodFinderWindow new openBrowserOn: 'Number detentBy:atMultiplesOf:snap:'
|
|
664 |
|
|
665 |
|
|
666 |
"
|
1532
|
667 |
|
|
668 |
"Modified: / 13.11.2001 / 12:46:17 / cg"
|
1522
|
669 |
!
|
|
670 |
|
1529
|
671 |
openBrowserOnSelectedItem
|
2927
|
672 |
"on the selected implementor"
|
|
673 |
|
1529
|
674 |
|sel|
|
|
675 |
|
|
676 |
sel := self selectedClassOfResultHolder value.
|
|
677 |
self openBrowserOn:sel
|
1532
|
678 |
|
2927
|
679 |
"Modified: / 13-11-2001 / 12:47:39 / cg"
|
|
680 |
"Modified (comment): / 21-09-2012 / 11:08:33 / cg"
|
|
681 |
!
|
|
682 |
|
|
683 |
openBrowserOnSelectedResultItem
|
|
684 |
"on an item in the lower left list,
|
|
685 |
on all implementors of that message"
|
|
686 |
|
|
687 |
|selIndex selector|
|
|
688 |
|
|
689 |
selIndex := self selectedImplementorsHolder value.
|
|
690 |
selIndex isNil ifTrue:[^ self].
|
|
691 |
|
|
692 |
selector := resultSelectors at:selIndex.
|
|
693 |
UserPreferences browserClass browseImplementorsOf:selector.
|
|
694 |
|
|
695 |
"Created: / 21-09-2012 / 11:05:46 / cg"
|
1529
|
696 |
!
|
|
697 |
|
3024
|
698 |
openBrowserOnSenderOfSelectedResultItem
|
|
699 |
"on an item in the lower left list,
|
|
700 |
on all implementors of that message"
|
|
701 |
|
|
702 |
|selIndex selector|
|
1525
|
703 |
|
3024
|
704 |
selIndex := self selectedImplementorsHolder value.
|
|
705 |
selIndex isNil ifTrue:[^ self].
|
|
706 |
|
|
707 |
selector := resultSelectors at:selIndex.
|
|
708 |
UserPreferences browserClass browseSendersOf:selector.
|
|
709 |
!
|
1522
|
710 |
|
3024
|
711 |
receiverEditorContents
|
|
712 |
"Return a cleaned up version of receiver taken from the receiverEditor
|
|
713 |
as an association. The association has aCleanedRecieverString as a key and the
|
|
714 |
compiledReceiver as value."
|
|
715 |
|
|
716 |
|aCleanedRecieverString compiledReceiver|
|
1522
|
717 |
|
3024
|
718 |
aCleanedRecieverString := self cleanInputs:(receiverEditor contents).
|
|
719 |
compiledReceiver := Compiler evaluate:aCleanedRecieverString.
|
|
720 |
((self isExpression:aCleanedRecieverString) or:[ compiledReceiver isNil ]) ifTrue:[
|
|
721 |
aCleanedRecieverString := compiledReceiver printString
|
|
722 |
].
|
|
723 |
^ aCleanedRecieverString -> compiledReceiver.
|
1522
|
724 |
!
|
|
725 |
|
|
726 |
search
|
3024
|
727 |
"Do a search based on the input in the various text editors. Return the receiver."
|
|
728 |
|
|
729 |
|tempReceiver tempAnswer tempArguments anArray resultArray receiverWithArgument mf|
|
1522
|
730 |
|
3024
|
731 |
self resultHolder value:nil.
|
|
732 |
self classOfResultHolder value:nil.
|
|
733 |
self codeHolder value:nil.
|
|
734 |
tempArguments := self argumentEditorsContents.
|
|
735 |
tempReceiver := self receiverEditorContents.
|
|
736 |
tempAnswer := self messageAnswerEditorContents.
|
|
737 |
"self cleanInputRec:tempReceiver arg:tempArguments ans:tempAnswer."
|
|
738 |
anArray := Array new:2.
|
|
739 |
receiverWithArgument := self mergReciever:(tempReceiver value)
|
|
740 |
WithArgument:(tempArguments values).
|
|
741 |
anArray
|
|
742 |
at:1 put:receiverWithArgument;
|
|
743 |
at:2 put:tempAnswer value.
|
|
744 |
"an array now holds the following array #(#(receiver argument) answer) or #(#(reciever) answer). which should
|
|
745 |
be suitable input for the method finder."
|
|
746 |
self withCursor:Cursor execute
|
|
747 |
do:[
|
|
748 |
mf := MethodFinder new.
|
|
749 |
resultArray := mf
|
|
750 |
load:anArray;
|
|
751 |
findMessage.
|
|
752 |
].
|
|
753 |
((resultArray at:1) includesSubString:'no single') ifTrue:[
|
|
754 |
self warn:(resultArray at:1).
|
|
755 |
^ self
|
|
756 |
].
|
|
757 |
"the following then replaces data1 and data2 created by the method finder to the appropriate arguments"
|
|
758 |
resultArray
|
|
759 |
keysAndValuesDo:[:key :value |
|
|
760 |
|newValue|
|
1522
|
761 |
|
3024
|
762 |
newValue := value replString:'data1' withString:(tempReceiver key).
|
|
763 |
(tempArguments size) >= 1 ifTrue:[
|
|
764 |
newValue := newValue replString:'data2'
|
|
765 |
withString:(tempArguments keyAt:1)
|
|
766 |
].
|
|
767 |
(tempArguments size) > 1 ifTrue:[
|
|
768 |
newValue := newValue replString:'data3'
|
|
769 |
withString:(tempArguments keyAt:2).
|
|
770 |
].
|
|
771 |
(tempArguments size) > 2 ifTrue:[
|
|
772 |
newValue := newValue replString:'data4'
|
|
773 |
withString:(tempArguments keyAt:3).
|
|
774 |
].
|
|
775 |
(tempArguments size) > 3 ifTrue:[
|
|
776 |
self halt:'unimplemented'.
|
|
777 |
].
|
|
778 |
" newValue:= value replString: 'data3' withString:(self messageAnswer key). "
|
|
779 |
newValue := newValue , ' --> ' , (tempAnswer key).
|
|
780 |
newValue replaceAll:Character cr with:Character space.
|
|
781 |
resultArray at:key put:newValue.
|
|
782 |
].
|
|
783 |
self resultHolder value:resultArray.
|
|
784 |
resultSelectors := mf selectors.
|
|
785 |
receiver := tempReceiver
|
1532
|
786 |
|
2859
|
787 |
"Modified: / 26-09-2011 / 12:42:28 / cg"
|
1532
|
788 |
!
|
|
789 |
|
2891
|
790 |
searchPatternChanged
|
|
791 |
self searchPatternMatchesInBackground
|
|
792 |
|
|
793 |
"Created: / 01-06-2012 / 13:18:16 / cg"
|
|
794 |
!
|
|
795 |
|
3023
|
796 |
searchPatternMatchesInBackground
|
|
797 |
"Do a search based on the pattern match as a background task"
|
2886
|
798 |
|
3023
|
799 |
| p pattern|
|
2891
|
800 |
|
|
801 |
(p := searchProcess) notNil ifTrue:[
|
|
802 |
searchProcess := nil.
|
|
803 |
p terminate.
|
|
804 |
].
|
|
805 |
|
3023
|
806 |
pattern := self selectorPattern value.
|
|
807 |
pattern isEmptyOrNil ifTrue:[
|
|
808 |
self resultHolder value:self resultInfoText.
|
|
809 |
self classOfResultHolder value:nil.
|
|
810 |
self codeHolder value:nil.
|
|
811 |
^ self
|
|
812 |
].
|
|
813 |
|
2891
|
814 |
searchProcess :=
|
|
815 |
[
|
3023
|
816 |
|list counts firsts seconds selectors resultList|
|
2891
|
817 |
|
|
818 |
self withCursor:Cursor execute do:[
|
|
819 |
pattern includesMatchCharacters ifFalse:[
|
|
820 |
pattern := '*',pattern,'*'
|
|
821 |
].
|
|
822 |
list := SystemBrowser findImplementorsMatching:pattern in:Smalltalk allClasses ignoreCase:true.
|
|
823 |
].
|
3023
|
824 |
|
|
825 |
counts := IdentityDictionary new.
|
|
826 |
firsts := IdentityDictionary new.
|
|
827 |
seconds := IdentityDictionary new.
|
|
828 |
selectors := IdentitySet new.
|
|
829 |
list do:[:eachMethod |
|
|
830 |
|msel|
|
|
831 |
|
|
832 |
msel := eachMethod selector.
|
|
833 |
selectors add:msel.
|
|
834 |
(counts at:msel ifAbsentPut:[ 0 asValue ]) increment.
|
|
835 |
(firsts includesKey:msel) ifTrue:[
|
|
836 |
(seconds includesKey:msel) ifFalse:[
|
|
837 |
seconds at:msel ifAbsentPut:[ eachMethod mclass ].
|
|
838 |
].
|
|
839 |
] ifFalse:[
|
|
840 |
firsts at:msel ifAbsentPut:[ eachMethod mclass ].
|
|
841 |
].
|
|
842 |
].
|
|
843 |
resultSelectors := selectors asOrderedCollection sort.
|
|
844 |
resultList := resultSelectors
|
|
845 |
collect:[:sel |
|
|
846 |
|cnt s|
|
|
847 |
|
|
848 |
s := sel allBold , ' --> '.
|
|
849 |
cnt := (counts at:sel) value.
|
|
850 |
cnt == 1 ifTrue:[
|
|
851 |
s , (firsts at:sel) name
|
|
852 |
] ifFalse:[
|
|
853 |
cnt == 2 ifTrue:[
|
|
854 |
s , (firsts at:sel) name , ' and ' , (seconds at:sel) name
|
|
855 |
] ifFalse:[
|
|
856 |
s , cnt printString , ' implementor(s)'
|
|
857 |
]
|
|
858 |
].
|
|
859 |
].
|
|
860 |
self enqueueDelayedAction:[ self updateListAfterPatternSearch: resultList ]
|
2891
|
861 |
] fork.
|
|
862 |
|
|
863 |
"Created: / 01-06-2012 / 13:16:54 / cg"
|
|
864 |
!
|
|
865 |
|
1532
|
866 |
selectedClassOfResultHolderChanged
|
|
867 |
|sel classAndSelector mthd|
|
|
868 |
|
|
869 |
sel := self selectedClassOfResultHolder value.
|
|
870 |
|
|
871 |
classAndSelector := self extractClassAndSelectorFrom:sel.
|
|
872 |
classAndSelector isNil ifTrue:[
|
|
873 |
^ self
|
|
874 |
].
|
|
875 |
mthd := classAndSelector key >> classAndSelector value.
|
|
876 |
mthd notNil ifTrue:[
|
|
877 |
self withWaitCursorDo:[
|
|
878 |
self codeHolder value:mthd source
|
|
879 |
]
|
|
880 |
] ifFalse:[
|
|
881 |
self codeHolder value:nil
|
|
882 |
].
|
|
883 |
|
|
884 |
"Created: / 13.11.2001 / 12:43:43 / cg"
|
|
885 |
"Modified: / 13.11.2001 / 12:48:56 / cg"
|
1522
|
886 |
!
|
|
887 |
|
|
888 |
updateImplementorsOf:anInteger
|
1525
|
889 |
"Request the implementors of the selected argument provided by aNumber.
|
2892
|
890 |
Return the receiver."
|
|
891 |
|
|
892 |
|methods classList aNumber|
|
1525
|
893 |
|
2892
|
894 |
(anInteger isNil) ifTrue:[
|
|
895 |
^ self
|
|
896 |
].
|
|
897 |
anInteger isNil ifTrue:[
|
|
898 |
aNumber := 1
|
|
899 |
] ifFalse:[
|
|
900 |
aNumber := anInteger
|
|
901 |
].
|
|
902 |
methods := SystemBrowser
|
|
903 |
findImplementorsOf:(resultSelectors at:aNumber)
|
|
904 |
in:Smalltalk allClasses
|
|
905 |
ignoreCase:false.
|
|
906 |
classList := methods asOrderedCollection
|
|
907 |
collect:[:m | m mclass name , ' ' , m selector ].
|
|
908 |
classList := (self markMatchingClasses:(resultSelectors at:aNumber)
|
|
909 |
classesWithSelector:classList).
|
|
910 |
self classOfResultHolder value:classList.
|
|
911 |
classList size > 0 ifTrue:[
|
|
912 |
self selectedClassOfResultHolder value:(classList first).
|
|
913 |
self selectedClassOfResultHolderChanged.
|
|
914 |
] ifFalse:[
|
|
915 |
self selectedClassOfResultHolder value:nil.
|
|
916 |
].
|
1522
|
917 |
|
2892
|
918 |
"Modified (comment): / 24-06-2012 / 18:41:45 / cg"
|
2891
|
919 |
!
|
|
920 |
|
3023
|
921 |
updateListAfterPatternSearch:resultList
|
2892
|
922 |
self classOfResultHolder value:nil.
|
|
923 |
self codeHolder value:nil.
|
3023
|
924 |
self resultHolder value:resultList.
|
2891
|
925 |
|
|
926 |
"Created: / 01-06-2012 / 13:17:34 / cg"
|
1522
|
927 |
! !
|
|
928 |
|
|
929 |
!MethodFinderWindow methodsFor:'aspects'!
|
|
930 |
|
|
931 |
arg1BoxVisible
|
1525
|
932 |
"Determines if the box should be visble or not. Return true or false"
|
1522
|
933 |
arg1BoxVisible isNil ifTrue:[
|
|
934 |
arg1BoxVisible := BlockValue
|
|
935 |
with:[:vh | vh value >= 2 ]
|
|
936 |
argument:(self argCountHolder)
|
|
937 |
].
|
|
938 |
^ arg1BoxVisible.
|
|
939 |
!
|
|
940 |
|
|
941 |
arg2BoxVisible
|
1525
|
942 |
"Determines if the box should be visble or not. Return true or false"
|
1522
|
943 |
arg2BoxVisible isNil ifTrue:[
|
|
944 |
arg2BoxVisible := BlockValue
|
|
945 |
with:[:vh | vh value >= 3 ]
|
|
946 |
argument:(self argCountHolder)
|
|
947 |
].
|
|
948 |
^ arg2BoxVisible.
|
|
949 |
!
|
|
950 |
|
|
951 |
arg3BoxVisible
|
1525
|
952 |
"Determines if the box should be visble or not. Return true or false"
|
1522
|
953 |
arg3BoxVisible isNil ifTrue:[
|
|
954 |
arg3BoxVisible := BlockValue
|
|
955 |
with:[:vh | vh value >= 4 ]
|
|
956 |
argument:(self argCountHolder)
|
|
957 |
].
|
|
958 |
^ arg3BoxVisible.
|
|
959 |
!
|
|
960 |
|
|
961 |
arg4BoxVisible
|
1525
|
962 |
"Determines if the box should be visble or not. Return true or false"
|
1522
|
963 |
arg4BoxVisible isNil ifTrue:[
|
|
964 |
arg4BoxVisible := BlockValue
|
|
965 |
with:[:vh | vh value >= 5 ]
|
|
966 |
argument:(self argCountHolder)
|
|
967 |
].
|
|
968 |
^ arg4BoxVisible.
|
|
969 |
!
|
|
970 |
|
|
971 |
argCountHolder
|
1525
|
972 |
"Return the value of argCounterHolder which is initialized at 2."
|
1522
|
973 |
argCountHolder isNil ifTrue:[
|
|
974 |
argCountHolder := 2 asValue.
|
|
975 |
].
|
|
976 |
^ argCountHolder.
|
|
977 |
!
|
|
978 |
|
|
979 |
argCountList
|
1525
|
980 |
"Return the argCountList"
|
1522
|
981 |
argCountList isNil ifTrue:[
|
|
982 |
argCountList := #('0 arguments' '1 argument' '2 arguments' '3 arguments') asValue
|
|
983 |
].
|
|
984 |
^ argCountList.
|
|
985 |
!
|
|
986 |
|
|
987 |
classOfResultHolder
|
1525
|
988 |
"Return a valueHolder which contains a collection with the names of the
|
|
989 |
implementors of a specific message. "
|
1522
|
990 |
|
|
991 |
|holder|
|
|
992 |
(holder := builder bindingAt:#classOfResultHolder) isNil ifTrue:[
|
1525
|
993 |
holder := ValueHolder new.
|
|
994 |
builder aspectAt:#classOfResultHolder put:holder
|
1522
|
995 |
].
|
|
996 |
^ holder
|
|
997 |
!
|
|
998 |
|
1532
|
999 |
codeHolder
|
|
1000 |
codeHolder isNil ifTrue:[
|
|
1001 |
codeHolder := '' asValue.
|
|
1002 |
].
|
|
1003 |
^ codeHolder.
|
|
1004 |
|
|
1005 |
"Created: / 13.11.2001 / 12:44:11 / cg"
|
|
1006 |
!
|
|
1007 |
|
1522
|
1008 |
resultHolder
|
1525
|
1009 |
"Return a value holder which contains the results of a search as a collection."
|
1522
|
1010 |
|
|
1011 |
|holder|
|
|
1012 |
(holder := builder bindingAt:#resultHolder) isNil ifTrue:[
|
1525
|
1013 |
holder := ValueHolder new.
|
|
1014 |
builder aspectAt:#resultHolder put:holder.
|
3023
|
1015 |
holder value:self resultInfoText.
|
1522
|
1016 |
].
|
|
1017 |
^ holder.
|
2886
|
1018 |
|
2890
|
1019 |
"Modified: / 01-06-2012 / 13:06:02 / cg"
|
1529
|
1020 |
!
|
|
1021 |
|
3023
|
1022 |
resultInfoText
|
|
1023 |
^ {
|
|
1024 |
'Please enter combination of' .
|
|
1025 |
' ',('receiver, arg and result' allBold) .
|
|
1026 |
'or a'.
|
|
1027 |
' ',('selector search pattern' allBold) .
|
|
1028 |
'into the above fields, then click on either ',('"search"' allBold),'-button.'
|
|
1029 |
}
|
|
1030 |
!
|
|
1031 |
|
1529
|
1032 |
selectedClassOfResultHolder
|
2927
|
1033 |
"valueHolder which contains the index of the selected result class (right list)"
|
1529
|
1034 |
|
|
1035 |
|holder|
|
2927
|
1036 |
|
1529
|
1037 |
(holder := builder bindingAt:#selectedClassOfResultHolder) isNil ifTrue:[
|
|
1038 |
holder := ValueHolder new.
|
|
1039 |
builder aspectAt:#selectedClassOfResultHolder put:holder
|
|
1040 |
].
|
|
1041 |
^ holder
|
2927
|
1042 |
|
|
1043 |
"Modified (comment): / 21-09-2012 / 11:10:29 / cg"
|
|
1044 |
!
|
|
1045 |
|
|
1046 |
selectedImplementorsHolder
|
|
1047 |
"valueHolder which contains the index of the selected implementors list (left list)"
|
|
1048 |
|
|
1049 |
|holder|
|
|
1050 |
|
|
1051 |
(holder := builder bindingAt:#selectedImplementorsHolder) isNil ifTrue:[
|
|
1052 |
holder := ValueHolder new.
|
|
1053 |
builder aspectAt:#selectedImplementorsHolder put:holder
|
|
1054 |
].
|
|
1055 |
^ holder
|
|
1056 |
|
|
1057 |
"Created: / 21-09-2012 / 11:10:13 / cg"
|
2886
|
1058 |
!
|
|
1059 |
|
|
1060 |
selectorPattern
|
|
1061 |
|holder|
|
|
1062 |
(holder := builder bindingAt:#selectorPattern) isNil ifTrue:[
|
|
1063 |
holder := ValueHolder new.
|
|
1064 |
builder aspectAt:#selectorPattern put:holder.
|
2891
|
1065 |
holder onChangeSend:#searchPatternChanged to:self.
|
2886
|
1066 |
].
|
|
1067 |
^ holder
|
|
1068 |
|
|
1069 |
"Created: / 27-04-2012 / 14:44:01 / cg"
|
1522
|
1070 |
! !
|
|
1071 |
|
|
1072 |
!MethodFinderWindow methodsFor:'callBacks'!
|
|
1073 |
|
|
1074 |
argument1WidgetCreated: aWidget
|
1525
|
1075 |
"Store the widget as an instance variable. Return the receiver"
|
|
1076 |
|
|
1077 |
|
1522
|
1078 |
argument1Editor := aWidget scrolledView.
|
1532
|
1079 |
aWidget tabMeansNextField:true.
|
|
1080 |
|
|
1081 |
"Modified: / 13.11.2001 / 12:21:41 / cg"
|
1522
|
1082 |
!
|
|
1083 |
|
|
1084 |
argument2WidgetCreated: aWidget
|
1525
|
1085 |
"Store the widget as an instance variable. Return the receiver"
|
|
1086 |
|
1522
|
1087 |
|
|
1088 |
argument2Editor := aWidget scrolledView.
|
1532
|
1089 |
aWidget tabMeansNextField:true.
|
|
1090 |
|
|
1091 |
"Modified: / 13.11.2001 / 12:21:45 / cg"
|
1522
|
1092 |
!
|
|
1093 |
|
|
1094 |
argument3WidgetCreated: aWidget
|
1525
|
1095 |
"Store the widget as an instance variable. Return the receiver"
|
|
1096 |
|
1522
|
1097 |
|
|
1098 |
argument3Editor := aWidget scrolledView.
|
1532
|
1099 |
aWidget tabMeansNextField:true.
|
|
1100 |
|
|
1101 |
"Modified: / 13.11.2001 / 12:21:49 / cg"
|
1522
|
1102 |
!
|
|
1103 |
|
1525
|
1104 |
messageAnswerWidgetCreated: aWidget
|
|
1105 |
"Store the widget as an instance variable. Return the receiver"
|
1522
|
1106 |
|
1525
|
1107 |
messageAnswerEditor := aWidget scrolledView.
|
1532
|
1108 |
aWidget tabMeansNextField:true.
|
|
1109 |
|
|
1110 |
"Modified: / 13.11.2001 / 12:24:55 / cg"
|
1522
|
1111 |
!
|
|
1112 |
|
1525
|
1113 |
openHTMLDocumentation
|
|
1114 |
HTMLDocumentView openFullOnDocumentationFile:'tools/misc/TOP.html#METHODFINDER'
|
1522
|
1115 |
!
|
|
1116 |
|
|
1117 |
receiverWidgetCreated: aWidget
|
1525
|
1118 |
"Store the widget as an instance variable. Return the receiver"
|
1522
|
1119 |
|
|
1120 |
receiverEditor := aWidget scrolledView.
|
1532
|
1121 |
aWidget tabMeansNextField:true.
|
|
1122 |
|
|
1123 |
"Modified: / 13.11.2001 / 12:24:49 / cg"
|
|
1124 |
!
|
|
1125 |
|
|
1126 |
sourceCodeWidgetCreated: aWidget
|
|
1127 |
aWidget acceptAction:nil.
|
|
1128 |
aWidget readOnly:true
|
|
1129 |
|
|
1130 |
"Created: / 13.11.2001 / 12:50:27 / cg"
|
|
1131 |
"Modified: / 13.11.2001 / 12:51:23 / cg"
|
1522
|
1132 |
! !
|
|
1133 |
|
|
1134 |
!MethodFinderWindow methodsFor:'controlInput'!
|
|
1135 |
|
|
1136 |
cleanInputs: aDirtyString
|
1525
|
1137 |
"Find and remove common mistakes made by the user. Return the
|
|
1138 |
'aStringToBeCleaned' variable"
|
1522
|
1139 |
| aStringToBeCleaned rs position|
|
|
1140 |
|
|
1141 |
aStringToBeCleaned:=aDirtyString.
|
|
1142 |
|
|
1143 |
(aStringToBeCleaned endsWith:(Character cr)) ifTrue:[
|
|
1144 |
aStringToBeCleaned:=aStringToBeCleaned copyFrom:1 to: (aStringToBeCleaned size -1).].
|
|
1145 |
aStringToBeCleaned:= aStringToBeCleaned withoutSeparators.
|
|
1146 |
|
|
1147 |
|
|
1148 |
rs:=ReadStream on: aStringToBeCleaned.
|
|
1149 |
[rs upToAll: '#true'. rs atEnd] whileFalse: [
|
|
1150 |
position:= rs position.
|
|
1151 |
aStringToBeCleaned:=aStringToBeCleaned copyReplaceFrom: position to: position with: ''. "remove #"
|
|
1152 |
rs:=ReadStream on: aStringToBeCleaned.
|
|
1153 |
].
|
|
1154 |
|
|
1155 |
rs:=ReadStream on: aStringToBeCleaned.
|
|
1156 |
[rs upToAll: '#false'. rs atEnd] whileFalse: [
|
|
1157 |
position:= rs position.
|
|
1158 |
aStringToBeCleaned:=aStringToBeCleaned copyReplaceFrom: position to: position with: ''. "remove #"
|
|
1159 |
rs:=ReadStream on: aStringToBeCleaned.
|
|
1160 |
rs:=ReadStream on: aStringToBeCleaned. ].
|
|
1161 |
|
|
1162 |
[rs upToAll: '#nil'. rs atEnd] whileFalse: [
|
|
1163 |
position:= rs position.
|
|
1164 |
aStringToBeCleaned:=aStringToBeCleaned copyReplaceFrom: position to: position with: ''. "remove #"
|
|
1165 |
rs:=ReadStream on: aStringToBeCleaned. ].
|
|
1166 |
^aStringToBeCleaned
|
|
1167 |
!
|
|
1168 |
|
1525
|
1169 |
markMatchingClasses: aSelector classesWithSelector:anOrderedCollection
|
|
1170 |
" Matches the class of the receiver with all the elements in anOrderedCollection
|
|
1171 |
(which are classes with selectors). If a match is found it is marked with an asterisk.
|
|
1172 |
The classes are then sorted so the the asterisk appears first. Return the
|
|
1173 |
markedClassList."
|
1522
|
1174 |
|
2165
|
1175 |
| marker recClass unmarkedClassList markedClassList|
|
1522
|
1176 |
|
1532
|
1177 |
marker := self class markerForImplementingClass.
|
|
1178 |
|
|
1179 |
recClass := receiver value class.
|
1525
|
1180 |
unmarkedClassList:=anOrderedCollection copy.
|
|
1181 |
unmarkedClassList do:
|
|
1182 |
[:classAndMethod | | class |
|
|
1183 |
class:=Compiler evaluate:
|
|
1184 |
((ReadStream on: classAndMethod) upToAll: aSelector).
|
1532
|
1185 |
"/ (recClass == class)
|
|
1186 |
(recClass whichClassImplements:aSelector) == class
|
|
1187 |
ifTrue:
|
|
1188 |
["/ unmarkedClassList add: marker, classAndMethod.
|
|
1189 |
unmarkedClassList add: classAndMethod allBold.
|
|
1190 |
unmarkedClassList remove: classAndMethod.
|
|
1191 |
].
|
|
1192 |
].
|
1522
|
1193 |
|
|
1194 |
unmarkedClassList sort:[:a :b | |rawA rawB|
|
3003
|
1195 |
rawA := a string withoutPrefix:marker.
|
|
1196 |
rawB := b string withoutPrefix:marker.
|
1532
|
1197 |
rawA < rawB. ].
|
1525
|
1198 |
markedClassList:= unmarkedClassList.
|
|
1199 |
|
|
1200 |
^markedClassList
|
1532
|
1201 |
|
|
1202 |
"Modified: / 13.11.2001 / 12:16:05 / cg"
|
1522
|
1203 |
!
|
|
1204 |
|
|
1205 |
mergReciever: aReceiver WithArgument: arguments
|
|
1206 |
|
1525
|
1207 |
"Puts the receiver and arguments into an array so it can be of a suitable input for the
|
|
1208 |
MethodFinder. Return an array."
|
|
1209 |
|
1522
|
1210 |
| tempReceiver tempArguments receiverWithArgument|
|
|
1211 |
|
|
1212 |
tempReceiver:= aReceiver.
|
|
1213 |
tempArguments := arguments.
|
|
1214 |
|
|
1215 |
(tempArguments isEmpty or:[(tempArguments) isNil])
|
|
1216 |
ifTrue:[ receiverWithArgument:=Array new:1."no argument"
|
|
1217 |
receiverWithArgument at:1 put: tempReceiver.
|
|
1218 |
]
|
|
1219 |
ifFalse:[
|
|
1220 |
(tempArguments size = 1)
|
|
1221 |
ifTrue:[ receiverWithArgument:=Array new:2.
|
|
1222 |
receiverWithArgument at:1 put: tempReceiver.
|
|
1223 |
receiverWithArgument at:2 put: (tempArguments at:1)
|
|
1224 |
]. "a receiver with an argument"
|
|
1225 |
|
|
1226 |
(tempArguments size = 2)
|
|
1227 |
ifTrue:[ receiverWithArgument:=Array new:3.
|
|
1228 |
receiverWithArgument at:1 put: tempReceiver.
|
|
1229 |
(receiverWithArgument at:2 put: (tempArguments at:1)).
|
|
1230 |
(receiverWithArgument at:3 put: (tempArguments at:2))
|
|
1231 |
]. "a receiver with an argument"
|
|
1232 |
(tempArguments size = 3)
|
|
1233 |
ifTrue:[ receiverWithArgument:=Array new:4.
|
|
1234 |
receiverWithArgument at:1 put: tempReceiver.
|
|
1235 |
(receiverWithArgument at:2 put: (tempArguments at:1)).
|
|
1236 |
(receiverWithArgument at:3 put: (tempArguments at:2)).
|
|
1237 |
(receiverWithArgument at:4 put: (tempArguments at:3)).
|
|
1238 |
|
|
1239 |
]. "a receiver with an argument"
|
|
1240 |
|
|
1241 |
].
|
|
1242 |
^receiverWithArgument
|
|
1243 |
! !
|
|
1244 |
|
1532
|
1245 |
!MethodFinderWindow methodsFor:'misc'!
|
|
1246 |
|
|
1247 |
aboutThisApplicationText
|
|
1248 |
|msg|
|
|
1249 |
|
|
1250 |
msg := super aboutThisApplicationText.
|
2412
|
1251 |
msg := msg , '\\Ported from Squeak to ST/X by James Hayes (james@exept.de).
|
|
1252 |
Original written by Ted Kaehler, Scott Wallace and Dan Ingalls.'.
|
1532
|
1253 |
^msg withCRs.
|
|
1254 |
|
|
1255 |
"Modified: / 13.11.2001 / 12:56:44 / cg"
|
|
1256 |
! !
|
|
1257 |
|
1522
|
1258 |
!MethodFinderWindow class methodsFor:'documentation'!
|
|
1259 |
|
|
1260 |
version
|
|
1261 |
^ '$Header$'
|
2730
|
1262 |
!
|
|
1263 |
|
|
1264 |
version_CVS
|
|
1265 |
^ '$Header$'
|
1522
|
1266 |
! !
|
3003
|
1267 |
|