author | Claus Gittinger <cg@exept.de> |
Fri, 01 Jun 2012 13:12:25 +0200 | |
changeset 2890 | 3d8556368fe9 |
parent 2889 | e17b2eacfe84 |
child 2891 | d4f1cd8626e6 |
permissions | -rw-r--r-- |
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 |
|
1532 | 8 |
lookAtResultEditor codeHolder' |
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 |
|
286 |
model: searchPatternMatches |
|
287 |
) |
|
288 |
) |
|
289 |
||
290 |
) |
|
291 |
) |
|
292 |
(SequenceViewSpec |
|
293 |
name: 'ResultList' |
|
2887 | 294 |
layout: (LayoutFrame 0 0 -15 0.5 0 1 0 1) |
2886 | 295 |
hasHorizontalScrollBar: true |
296 |
hasVerticalScrollBar: true |
|
297 |
autoHideScrollBars: true |
|
298 |
valueChangeSelector: updateImplementorsOf: |
|
299 |
useIndex: true |
|
300 |
sequenceList: resultHolder |
|
301 |
) |
|
1530 | 302 |
) |
303 |
||
304 |
) |
|
305 |
) |
|
2886 | 306 |
(VariableVerticalPanelSpec |
307 |
name: 'VariableVerticalPanel1' |
|
308 |
component: |
|
309 |
(SpecCollection |
|
310 |
collection: ( |
|
311 |
(SequenceViewSpec |
|
312 |
name: 'List2' |
|
313 |
model: selectedClassOfResultHolder |
|
314 |
menu: implementorListMenu |
|
315 |
hasHorizontalScrollBar: true |
|
316 |
hasVerticalScrollBar: true |
|
317 |
autoHideScrollBars: true |
|
318 |
doubleClickSelector: openBrowserOn: |
|
319 |
valueChangeSelector: selectedClassOfResultHolderChanged |
|
320 |
useIndex: false |
|
321 |
sequenceList: classOfResultHolder |
|
1530 | 322 |
) |
2886 | 323 |
(CodeViewSpec |
324 |
name: 'CodeView' |
|
325 |
model: codeHolder |
|
326 |
hasHorizontalScrollBar: true |
|
327 |
hasVerticalScrollBar: true |
|
328 |
autoHideScrollBars: true |
|
329 |
hasKeyboardFocusInitially: false |
|
330 |
postBuildCallback: sourceCodeWidgetCreated: |
|
1522 | 331 |
) |
332 |
) |
|
333 |
||
334 |
) |
|
2886 | 335 |
handles: (Any 0.5 1.0) |
1522 | 336 |
) |
337 |
) |
|
338 |
||
339 |
) |
|
2890 | 340 |
handles: (Any 0.443786982248521 1.0) |
1522 | 341 |
) |
342 |
) |
|
343 |
||
344 |
) |
|
345 |
) |
|
346 |
! ! |
|
347 |
||
1525 | 348 |
!MethodFinderWindow class methodsFor:'menu specs'! |
349 |
||
1529 | 350 |
implementorListMenu |
351 |
"This resource specification was automatically generated |
|
352 |
by the MenuEditor of ST/X." |
|
353 |
||
354 |
"Do not manually edit this!! If it is corrupted, |
|
355 |
the MenuEditor may not be able to read the specification." |
|
356 |
||
357 |
" |
|
358 |
MenuEditor new openOnClass:MethodFinderWindow andSelector:#implementorListMenu |
|
359 |
(Menu new fromLiteralArrayEncoding:(MethodFinderWindow implementorListMenu)) startUp |
|
360 |
" |
|
361 |
||
362 |
<resource: #menu> |
|
363 |
||
364 |
^ |
|
365 |
#(#Menu |
|
366 |
#( |
|
367 |
#(#MenuItem |
|
368 |
#label: 'Browse' |
|
369 |
#translateLabel: true |
|
370 |
#value: #openBrowserOnSelectedItem |
|
371 |
) |
|
372 |
) |
|
373 |
nil |
|
374 |
nil |
|
375 |
) |
|
376 |
! |
|
377 |
||
1525 | 378 |
menu |
379 |
"This resource specification was automatically generated |
|
380 |
by the MenuEditor of ST/X." |
|
381 |
||
382 |
"Do not manually edit this!! If it is corrupted, |
|
383 |
the MenuEditor may not be able to read the specification." |
|
384 |
||
385 |
" |
|
386 |
MenuEditor new openOnClass:MethodFinderWindow andSelector:#menu |
|
387 |
(Menu new fromLiteralArrayEncoding:(MethodFinderWindow menu)) startUp |
|
388 |
" |
|
389 |
||
390 |
<resource: #menu> |
|
391 |
||
392 |
^ |
|
393 |
#(#Menu |
|
394 |
#( |
|
395 |
#(#MenuItem |
|
396 |
#label: '&File' |
|
397 |
#activeHelpKey: #file |
|
398 |
#submenu: |
|
399 |
#(#Menu |
|
400 |
#( |
|
401 |
#(#MenuItem |
|
402 |
#label: 'Exit' |
|
403 |
#value: #closeRequest |
|
404 |
#activeHelpKey: #fileExit |
|
405 |
) |
|
406 |
) |
|
407 |
nil |
|
408 |
nil |
|
409 |
) |
|
410 |
) |
|
411 |
#(#MenuItem |
|
412 |
#label: 'Help' |
|
413 |
#startGroup: #right |
|
414 |
#submenu: |
|
415 |
#(#Menu |
|
416 |
#( |
|
417 |
#(#MenuItem |
|
418 |
#label: 'Documentation' |
|
419 |
#value: #openHTMLDocumentation |
|
420 |
#activeHelpKey: #helpTutorial |
|
421 |
) |
|
422 |
#(#MenuItem |
|
1532 | 423 |
#label: 'About MethodFinder...' |
1525 | 424 |
#value: #openAboutThisApplication |
425 |
#activeHelpKey: #aboutThisAppliaction |
|
426 |
) |
|
427 |
) |
|
428 |
nil |
|
429 |
nil |
|
430 |
) |
|
431 |
) |
|
432 |
) |
|
433 |
nil |
|
434 |
nil |
|
435 |
) |
|
1532 | 436 |
|
437 |
"Modified: / 13.11.2001 / 12:36:39 / cg" |
|
1525 | 438 |
! ! |
439 |
||
1522 | 440 |
!MethodFinderWindow methodsFor:'accessing'! |
441 |
||
442 |
receiver |
|
1525 | 443 |
"Return a copy of the value of the instance variable 'receiver' " |
1522 | 444 |
|
445 |
^ receiver copy |
|
446 |
! ! |
|
447 |
||
448 |
!MethodFinderWindow methodsFor:'actions'! |
|
449 |
||
450 |
argumentEditorsContents |
|
1525 | 451 |
|
452 |
"Determine how many text editors of the arguments are used and store the result |
|
453 |
as argCounter. The result being the minimum between how many editors have |
|
454 |
expressions in and how many are displayed. |
|
455 |
||
456 |
Add each argument string (key)and the evaluated version (value) to an Ordered Dictionary |
|
457 |
from each of the text editors. |
|
458 |
||
459 |
Return the OrderedDictionary with the expressions from all the text editors. " |
|
460 |
||
2165 | 461 |
| tempArguments argCounter tempArgument1Editor tempArgument2Editor tempArgument3Editor |
1522 | 462 |
associationKey associationValue| |
463 |
||
464 |
argCounter:=0. |
|
465 |
||
466 |
tempArgument1Editor:= (self cleanInputs: argument1Editor contents). |
|
467 |
tempArgument2Editor:= (self cleanInputs: argument2Editor contents). |
|
468 |
tempArgument3Editor:= (self cleanInputs: argument3Editor contents). |
|
469 |
||
470 |
tempArgument1Editor = '' ifFalse:[argCounter:=argCounter +1]. |
|
471 |
tempArgument2Editor = '' ifFalse:[argCounter:=argCounter +1]. |
|
472 |
tempArgument3Editor = '' ifFalse:[argCounter:=argCounter +1]. |
|
473 |
||
474 |
||
475 |
argCounter:= (argCounter min: (self argCountHolder value -1)). |
|
476 |
tempArguments:= OrderedDictionary new:argCounter. |
|
477 |
||
478 |
(argCounter value >= 1) |
|
479 |
ifTrue:[associationValue:= (Compiler evaluate: tempArgument1Editor). |
|
480 |
((self isExpression:tempArgument1Editor) or:[ associationValue isNil]) ifTrue:[ "looks if an expression is typed in" |
|
481 |
associationKey:=associationValue printString] |
|
482 |
ifFalse:[ |
|
483 |
associationKey:=tempArgument1Editor]. |
|
484 |
||
485 |
tempArguments add: associationKey-> associationValue. |
|
486 |
]. |
|
487 |
(argCounter value >= 2) |
|
488 |
ifTrue:[ associationValue:= (Compiler evaluate: tempArgument2Editor). |
|
489 |
(((self isExpression:tempArgument2Editor) or:[ associationValue isNil])) ifTrue:[ "looks if an expression is typed in" |
|
490 |
associationKey:=associationValue printString] |
|
491 |
ifFalse:[ |
|
492 |
associationKey:=tempArgument2Editor]. |
|
493 |
||
494 |
tempArguments add: associationKey-> associationValue]. |
|
495 |
||
496 |
(argCounter value >= 3) |
|
497 |
ifTrue:[ associationValue:= (Compiler evaluate: tempArgument3Editor). |
|
498 |
((self isExpression:tempArgument3Editor) or:[ associationValue isNil]) ifTrue:[ "looks if an expression is typed in" |
|
499 |
associationKey:=associationValue printString] |
|
500 |
ifFalse:[ |
|
501 |
associationKey:=tempArgument3Editor]. |
|
502 |
||
503 |
tempArguments add: associationKey-> associationValue]. |
|
504 |
||
505 |
||
506 |
^tempArguments |
|
507 |
! |
|
508 |
||
509 |
clear |
|
1525 | 510 |
"Reset the contents of all the outputs. Return the receiver." |
1522 | 511 |
|
512 |
receiverEditor contents:nil. |
|
513 |
argument1Editor contents:nil. |
|
514 |
argument2Editor contents:nil. |
|
515 |
argument3Editor contents:nil. |
|
516 |
messageAnswerEditor contents:nil. |
|
517 |
self resultHolder value:nil. |
|
1525 | 518 |
self classOfResultHolder value: nil. |
2730 | 519 |
codeHolder value:nil. |
1522 | 520 |
! |
521 |
||
1532 | 522 |
extractClassAndSelectorFrom:anArgument |
523 |
"Opens browser on theArgument of a specific class. anArgument being a string with the |
|
524 |
Class and the selector upon which the browser is to be opened. Return the receiver." |
|
525 |
||
526 |
|aClass aSelector x theArgument marker| |
|
527 |
||
528 |
anArgument isNil ifTrue:[ |
|
529 |
^ nil |
|
530 |
]. |
|
531 |
marker := self class markerForImplementingClass. |
|
532 |
||
533 |
theArgument := anArgument string. |
|
534 |
(theArgument startsWith:marker) ifTrue:[ |
|
535 |
theArgument := theArgument copyFrom:marker size+1 |
|
536 |
]. |
|
537 |
aClass := theArgument copyUpTo:(Character space). |
|
538 |
x := aClass size + 2. |
|
539 |
aSelector := theArgument copyFrom:x. |
|
540 |
aClass := Smalltalk classNamed:aClass. |
|
2886 | 541 |
(aSelector startsWith:'class ') ifTrue:[ |
542 |
aSelector := aSelector copyFrom:'class 'size+1. |
|
543 |
aClass := aClass class. |
|
544 |
]. |
|
1532 | 545 |
^ aClass -> aSelector asSymbol |
546 |
||
547 |
" |
|
548 |
MethodFinderWindow new extractClassAndSelectorFrom: '*SmallInteger +' |
|
549 |
MethodFinderWindow new extractClassAndSelectorFrom: 'String ,' |
|
550 |
MethodFinderWindow new extractClassAndSelectorFrom: 'Number detentBy:atMultiplesOf:snap:' |
|
551 |
||
552 |
||
553 |
" |
|
554 |
||
2886 | 555 |
"Modified: / 27-04-2012 / 15:05:53 / cg" |
1532 | 556 |
! |
557 |
||
1522 | 558 |
isExpression: aString |
1525 | 559 |
"Return true or false depending on if the subString includes certain characters" |
1522 | 560 |
(aString includesSubString:': ') ifTrue:[^true]. |
561 |
(aString includesSubString:'+') ifTrue:[^true]. |
|
562 |
(aString includesSubString:'-') ifTrue:[^true]. |
|
563 |
(aString includesSubString:'*') ifTrue:[^true]. |
|
564 |
(aString includesSubString:'/') ifTrue:[^true]. |
|
565 |
(aString includesSubString:'>') ifTrue:[^true]. |
|
566 |
(aString includesSubString:'<') ifTrue:[^true]. |
|
567 |
(aString includesSubString:' new') ifTrue:[^true]. |
|
568 |
(aString includesSubString:'[') & (aString includesSubString:']') & (aString includesSubString:'.') |
|
569 |
ifTrue:[^false]. |
|
570 |
(aString includesSubString:'.') ifTrue:[^true]. |
|
571 |
||
572 |
^false |
|
573 |
! |
|
574 |
||
575 |
messageAnswerEditorContents |
|
1525 | 576 |
"Return a cleaned up version of message answer taken from the messageAnswerEditor |
577 |
as an association. The association has cleanedAnswerString as a key and the |
|
578 |
compiledAnswer as value." |
|
1522 | 579 |
|
580 |
| aCleanedAnswerString compiledAnswer | |
|
581 |
||
582 |
aCleanedAnswerString:=self cleanInputs: (messageAnswerEditor contents). |
|
583 |
compiledAnswer:=Compiler evaluate: aCleanedAnswerString. |
|
584 |
((self isExpression:aCleanedAnswerString) or:[compiledAnswer isNil]) ifTrue:[ |
|
585 |
aCleanedAnswerString:=compiledAnswer printString]. |
|
586 |
||
587 |
^aCleanedAnswerString->compiledAnswer. |
|
588 |
! |
|
589 |
||
590 |
openBrowserOn:anArgument |
|
591 |
"Opens browser on theArgument of a specific class. anArgument being a string with the |
|
1525 | 592 |
Class and the selector upon which the browser is to be opened. Return the receiver." |
1522 | 593 |
|
1532 | 594 |
|classAndSelector| |
1522 | 595 |
|
1532 | 596 |
classAndSelector := self extractClassAndSelectorFrom:anArgument. |
597 |
classAndSelector isNil ifTrue:[ |
|
1525 | 598 |
^ self |
1522 | 599 |
]. |
2459 | 600 |
UserPreferences current systemBrowserClass |
601 |
openInClass:classAndSelector key |
|
602 |
selector:classAndSelector value |
|
1525 | 603 |
|
604 |
" |
|
605 |
MethodFinderWindow new openBrowserOn: '*SmallInteger +' |
|
606 |
MethodFinderWindow new openBrowserOn: 'String ,' |
|
607 |
MethodFinderWindow new openBrowserOn: 'Number detentBy:atMultiplesOf:snap:' |
|
608 |
||
609 |
||
610 |
" |
|
1532 | 611 |
|
612 |
"Modified: / 13.11.2001 / 12:46:17 / cg" |
|
1522 | 613 |
! |
614 |
||
1529 | 615 |
openBrowserOnSelectedItem |
616 |
|sel| |
|
617 |
||
618 |
sel := self selectedClassOfResultHolder value. |
|
619 |
self openBrowserOn:sel |
|
1532 | 620 |
|
621 |
"Modified: / 13.11.2001 / 12:47:39 / cg" |
|
1529 | 622 |
! |
623 |
||
1522 | 624 |
receiverEditorContents |
1525 | 625 |
"Return a cleaned up version of receiver taken from the receiverEditor |
626 |
as an association. The association has aCleanedRecieverString as a key and the |
|
627 |
compiledReceiver as value." |
|
628 |
||
1522 | 629 |
| aCleanedRecieverString compiledReceiver | |
630 |
||
631 |
aCleanedRecieverString:=self cleanInputs: (receiverEditor contents). |
|
632 |
||
633 |
compiledReceiver:=Compiler evaluate: aCleanedRecieverString. |
|
634 |
||
635 |
((self isExpression:aCleanedRecieverString) or:[compiledReceiver isNil]) ifTrue:[ |
|
636 |
aCleanedRecieverString:=compiledReceiver printString]. |
|
637 |
^aCleanedRecieverString->compiledReceiver. |
|
638 |
! |
|
639 |
||
640 |
search |
|
1525 | 641 |
"Do a search based on the input in the various text editors. Return the receiver." |
1522 | 642 |
| tempReceiver tempAnswer tempArguments anArray resultArray receiverWithArgument mf| |
1534 | 643 |
|
644 |
self resultHolder value: nil. "reset the result list" |
|
1522 | 645 |
self classOfResultHolder value: nil. "reset the implementorOf list" |
1534 | 646 |
self codeHolder value: nil. "reset the source" |
1522 | 647 |
|
648 |
tempArguments:=self argumentEditorsContents. |
|
649 |
tempReceiver :=self receiverEditorContents . |
|
650 |
tempAnswer:= self messageAnswerEditorContents. |
|
651 |
||
652 |
"self cleanInputRec:tempReceiver arg:tempArguments ans:tempAnswer." |
|
653 |
||
654 |
||
655 |
anArray:=Array new:2. "creates an array which is to be used as input for the method finder." |
|
656 |
||
657 |
receiverWithArgument:=self mergReciever: (tempReceiver value) WithArgument: (tempArguments values). |
|
658 |
||
659 |
anArray at:1 put:receiverWithArgument; |
|
660 |
at:2 put: tempAnswer value. |
|
661 |
||
662 |
"an array now holds the following array #(#(receiver argument) answer) or #(#(reciever) answer). which should |
|
663 |
be suitable input for the method finder." |
|
1534 | 664 |
self withCursor:Cursor execute do:[ |
665 |
mf:= MethodFinder new. |
|
666 |
resultArray:= mf load: anArray; findMessage. |
|
667 |
]. |
|
1522 | 668 |
|
669 |
((resultArray at: 1 )includesSubString: 'no single') ifTrue:[ |
|
670 |
self warn: (resultArray at: 1 ). |
|
671 |
^self |
|
672 |
]. |
|
673 |
"the following then replaces data1 and data2 created by the method finder to the appropriate arguments" |
|
2859 | 674 |
|
1522 | 675 |
resultArray keysAndValuesDo:[:key :value | | newValue | |
676 |
newValue:= value replString: 'data1' withString:(tempReceiver key). |
|
677 |
(tempArguments size) >= 1 ifTrue:[ |
|
678 |
newValue:= newValue replString: 'data2' withString:(tempArguments keyAt:1)]. |
|
679 |
||
680 |
(tempArguments size) > 1 ifTrue:[ |
|
681 |
newValue:= newValue replString: 'data3' withString:(tempArguments keyAt:2).]. |
|
682 |
||
683 |
(tempArguments size) > 2 ifTrue:[ |
|
684 |
newValue:= newValue replString: 'data4' withString:(tempArguments keyAt:3).]. |
|
685 |
||
2859 | 686 |
(tempArguments size) > 3 ifTrue:[ self halt:'unimplemented'. ]. |
1532 | 687 |
|
1522 | 688 |
|
689 |
" newValue:= value replString: 'data3' withString:(self messageAnswer key). " |
|
690 |
||
691 |
newValue:=newValue, ' --> ', (tempAnswer key). |
|
1532 | 692 |
newValue replaceAll:Character cr with:Character space. |
1522 | 693 |
|
694 |
resultArray at: key put: newValue. |
|
695 |
||
696 |
]. |
|
697 |
||
698 |
self resultHolder value: resultArray. |
|
699 |
resultSelectors:= mf selectors. "used to find implementors so we do not have to " |
|
700 |
receiver:=tempReceiver "search the string for the selector found. Stored as an ordered collection" |
|
1532 | 701 |
|
2859 | 702 |
"Modified: / 26-09-2011 / 12:42:28 / cg" |
1532 | 703 |
! |
704 |
||
2886 | 705 |
searchPatternMatches |
706 |
"Do a search based on the pattern match" |
|
707 |
||
708 |
| pattern list selectors counts| |
|
709 |
||
710 |
pattern := self selectorPattern value. |
|
711 |
||
712 |
self resultHolder value: nil. "reset the result list" |
|
713 |
self classOfResultHolder value: nil. "reset the implementorOf list" |
|
714 |
self codeHolder value: nil. "reset the source" |
|
715 |
||
716 |
self withCursor:Cursor execute do:[ |
|
2889
e17b2eacfe84
changed: #searchPatternMatches
Claus Gittinger <cg@exept.de>
parents:
2887
diff
changeset
|
717 |
pattern includesMatchCharacters ifFalse:[ |
e17b2eacfe84
changed: #searchPatternMatches
Claus Gittinger <cg@exept.de>
parents:
2887
diff
changeset
|
718 |
pattern := '*',pattern,'*' |
e17b2eacfe84
changed: #searchPatternMatches
Claus Gittinger <cg@exept.de>
parents:
2887
diff
changeset
|
719 |
]. |
2886 | 720 |
list := SystemBrowser findImplementorsMatching:pattern in:Smalltalk allClasses ignoreCase:true. |
721 |
]. |
|
722 |
||
723 |
counts := IdentityDictionary new. |
|
724 |
selectors := IdentitySet new. |
|
725 |
||
726 |
list do:[:eachMethod | |
|
727 |
selectors add: eachMethod selector. |
|
728 |
(counts at:(eachMethod selector) ifAbsentPut:[0 asValue]) increment |
|
729 |
]. |
|
730 |
||
731 |
resultSelectors := selectors asOrderedCollection sort. |
|
732 |
||
733 |
self resultHolder value: (resultSelectors collect:[:sel | sel,' --> ',(counts at:sel) value printString,' implementor(s)']). |
|
734 |
||
735 |
"Created: / 27-04-2012 / 14:46:35 / cg" |
|
736 |
! |
|
737 |
||
1532 | 738 |
selectedClassOfResultHolderChanged |
739 |
|sel classAndSelector mthd| |
|
740 |
||
741 |
sel := self selectedClassOfResultHolder value. |
|
742 |
||
743 |
classAndSelector := self extractClassAndSelectorFrom:sel. |
|
744 |
classAndSelector isNil ifTrue:[ |
|
745 |
^ self |
|
746 |
]. |
|
747 |
mthd := classAndSelector key >> classAndSelector value. |
|
748 |
mthd notNil ifTrue:[ |
|
749 |
self withWaitCursorDo:[ |
|
750 |
self codeHolder value:mthd source |
|
751 |
] |
|
752 |
] ifFalse:[ |
|
753 |
self codeHolder value:nil |
|
754 |
]. |
|
755 |
||
756 |
"Created: / 13.11.2001 / 12:43:43 / cg" |
|
757 |
"Modified: / 13.11.2001 / 12:48:56 / cg" |
|
1522 | 758 |
! |
759 |
||
760 |
updateImplementorsOf:anInteger |
|
1525 | 761 |
"Request the implementors of the selected argument provided by aNumber. |
762 |
Return the receiver. " |
|
1522 | 763 |
|methods classList aNumber| |
764 |
||
1525 | 765 |
|
1522 | 766 |
(anInteger isNil) ifTrue:[^self]. |
767 |
anInteger isNil ifTrue:[aNumber:=1] |
|
768 |
ifFalse:[aNumber:=anInteger]. |
|
1525 | 769 |
methods:=SystemBrowser findImplementorsOf: (resultSelectors at:aNumber) in:Smalltalk allClasses ignoreCase:false. |
770 |
classList:=methods asOrderedCollection collect:[:m | m mclass name , ' ' , m selector]. |
|
1522 | 771 |
|
772 |
classList:=(self markMatchingClasses:(resultSelectors at:aNumber) classesWithSelector:classList). |
|
773 |
||
774 |
self classOfResultHolder value: classList. |
|
1532 | 775 |
self selectedClassOfResultHolder value:nil. |
776 |
||
777 |
"Modified: / 13.11.2001 / 12:07:31 / cg" |
|
1522 | 778 |
! ! |
779 |
||
780 |
!MethodFinderWindow methodsFor:'aspects'! |
|
781 |
||
782 |
arg1BoxVisible |
|
1525 | 783 |
"Determines if the box should be visble or not. Return true or false" |
1522 | 784 |
arg1BoxVisible isNil ifTrue:[ |
785 |
arg1BoxVisible := BlockValue |
|
786 |
with:[:vh | vh value >= 2 ] |
|
787 |
argument:(self argCountHolder) |
|
788 |
]. |
|
789 |
^ arg1BoxVisible. |
|
790 |
! |
|
791 |
||
792 |
arg2BoxVisible |
|
1525 | 793 |
"Determines if the box should be visble or not. Return true or false" |
1522 | 794 |
arg2BoxVisible isNil ifTrue:[ |
795 |
arg2BoxVisible := BlockValue |
|
796 |
with:[:vh | vh value >= 3 ] |
|
797 |
argument:(self argCountHolder) |
|
798 |
]. |
|
799 |
^ arg2BoxVisible. |
|
800 |
! |
|
801 |
||
802 |
arg3BoxVisible |
|
1525 | 803 |
"Determines if the box should be visble or not. Return true or false" |
1522 | 804 |
arg3BoxVisible isNil ifTrue:[ |
805 |
arg3BoxVisible := BlockValue |
|
806 |
with:[:vh | vh value >= 4 ] |
|
807 |
argument:(self argCountHolder) |
|
808 |
]. |
|
809 |
^ arg3BoxVisible. |
|
810 |
! |
|
811 |
||
812 |
arg4BoxVisible |
|
1525 | 813 |
"Determines if the box should be visble or not. Return true or false" |
1522 | 814 |
arg4BoxVisible isNil ifTrue:[ |
815 |
arg4BoxVisible := BlockValue |
|
816 |
with:[:vh | vh value >= 5 ] |
|
817 |
argument:(self argCountHolder) |
|
818 |
]. |
|
819 |
^ arg4BoxVisible. |
|
820 |
! |
|
821 |
||
822 |
argCountHolder |
|
1525 | 823 |
"Return the value of argCounterHolder which is initialized at 2." |
1522 | 824 |
argCountHolder isNil ifTrue:[ |
825 |
argCountHolder := 2 asValue. |
|
826 |
]. |
|
827 |
^ argCountHolder. |
|
828 |
! |
|
829 |
||
830 |
argCountList |
|
1525 | 831 |
"Return the argCountList" |
1522 | 832 |
argCountList isNil ifTrue:[ |
833 |
argCountList := #('0 arguments' '1 argument' '2 arguments' '3 arguments') asValue |
|
834 |
]. |
|
835 |
^ argCountList. |
|
836 |
! |
|
837 |
||
838 |
classOfResultHolder |
|
1525 | 839 |
"Return a valueHolder which contains a collection with the names of the |
840 |
implementors of a specific message. " |
|
1522 | 841 |
|
842 |
|holder| |
|
843 |
(holder := builder bindingAt:#classOfResultHolder) isNil ifTrue:[ |
|
1525 | 844 |
holder := ValueHolder new. |
845 |
builder aspectAt:#classOfResultHolder put:holder |
|
1522 | 846 |
]. |
847 |
^ holder |
|
848 |
! |
|
849 |
||
1532 | 850 |
codeHolder |
851 |
codeHolder isNil ifTrue:[ |
|
852 |
codeHolder := '' asValue. |
|
853 |
]. |
|
854 |
^ codeHolder. |
|
855 |
||
856 |
"Created: / 13.11.2001 / 12:44:11 / cg" |
|
857 |
! |
|
858 |
||
1522 | 859 |
resultHolder |
1525 | 860 |
"Return a value holder which contains the results of a search as a collection." |
1522 | 861 |
|
862 |
|holder| |
|
863 |
(holder := builder bindingAt:#resultHolder) isNil ifTrue:[ |
|
1525 | 864 |
holder := ValueHolder new. |
865 |
builder aspectAt:#resultHolder put:holder. |
|
2887 | 866 |
holder value:{ |
867 |
'Please enter combination of' . |
|
868 |
' ',('receiver, arg and result' allBold) . |
|
869 |
'or a'. |
|
870 |
' ',('selector search pattern' allBold) . |
|
2890 | 871 |
'into the above fields, then click on either ',('"search"' allBold),'-button.' |
2887 | 872 |
} |
1522 | 873 |
]. |
874 |
^ holder. |
|
2886 | 875 |
|
2890 | 876 |
"Modified: / 01-06-2012 / 13:06:02 / cg" |
1529 | 877 |
! |
878 |
||
879 |
selectedClassOfResultHolder |
|
880 |
"Return a valueHolder which contains the index of the selected result class |
|
881 |
(right list)" |
|
882 |
||
883 |
|holder| |
|
884 |
(holder := builder bindingAt:#selectedClassOfResultHolder) isNil ifTrue:[ |
|
885 |
holder := ValueHolder new. |
|
886 |
builder aspectAt:#selectedClassOfResultHolder put:holder |
|
887 |
]. |
|
888 |
^ holder |
|
2886 | 889 |
! |
890 |
||
891 |
selectorPattern |
|
892 |
|holder| |
|
893 |
(holder := builder bindingAt:#selectorPattern) isNil ifTrue:[ |
|
894 |
holder := ValueHolder new. |
|
895 |
builder aspectAt:#selectorPattern put:holder. |
|
896 |
holder onChangeSend:#searchPatternMatches to:self. |
|
897 |
]. |
|
898 |
^ holder |
|
899 |
||
900 |
"Created: / 27-04-2012 / 14:44:01 / cg" |
|
1522 | 901 |
! ! |
902 |
||
903 |
!MethodFinderWindow methodsFor:'callBacks'! |
|
904 |
||
905 |
argument1WidgetCreated: aWidget |
|
1525 | 906 |
"Store the widget as an instance variable. Return the receiver" |
907 |
||
908 |
||
1522 | 909 |
argument1Editor := aWidget scrolledView. |
1532 | 910 |
aWidget tabMeansNextField:true. |
911 |
||
912 |
"Modified: / 13.11.2001 / 12:21:41 / cg" |
|
1522 | 913 |
! |
914 |
||
915 |
argument2WidgetCreated: aWidget |
|
1525 | 916 |
"Store the widget as an instance variable. Return the receiver" |
917 |
||
1522 | 918 |
|
919 |
argument2Editor := aWidget scrolledView. |
|
1532 | 920 |
aWidget tabMeansNextField:true. |
921 |
||
922 |
"Modified: / 13.11.2001 / 12:21:45 / cg" |
|
1522 | 923 |
! |
924 |
||
925 |
argument3WidgetCreated: aWidget |
|
1525 | 926 |
"Store the widget as an instance variable. Return the receiver" |
927 |
||
1522 | 928 |
|
929 |
argument3Editor := aWidget scrolledView. |
|
1532 | 930 |
aWidget tabMeansNextField:true. |
931 |
||
932 |
"Modified: / 13.11.2001 / 12:21:49 / cg" |
|
1522 | 933 |
! |
934 |
||
1525 | 935 |
messageAnswerWidgetCreated: aWidget |
936 |
"Store the widget as an instance variable. Return the receiver" |
|
1522 | 937 |
|
1525 | 938 |
messageAnswerEditor := aWidget scrolledView. |
1532 | 939 |
aWidget tabMeansNextField:true. |
940 |
||
941 |
"Modified: / 13.11.2001 / 12:24:55 / cg" |
|
1522 | 942 |
! |
943 |
||
1525 | 944 |
openHTMLDocumentation |
945 |
HTMLDocumentView openFullOnDocumentationFile:'tools/misc/TOP.html#METHODFINDER' |
|
1522 | 946 |
! |
947 |
||
948 |
receiverWidgetCreated: aWidget |
|
1525 | 949 |
"Store the widget as an instance variable. Return the receiver" |
1522 | 950 |
|
951 |
receiverEditor := aWidget scrolledView. |
|
1532 | 952 |
aWidget tabMeansNextField:true. |
953 |
||
954 |
"Modified: / 13.11.2001 / 12:24:49 / cg" |
|
955 |
! |
|
956 |
||
957 |
sourceCodeWidgetCreated: aWidget |
|
958 |
aWidget acceptAction:nil. |
|
959 |
aWidget readOnly:true |
|
960 |
||
961 |
"Created: / 13.11.2001 / 12:50:27 / cg" |
|
962 |
"Modified: / 13.11.2001 / 12:51:23 / cg" |
|
1522 | 963 |
! ! |
964 |
||
965 |
!MethodFinderWindow methodsFor:'controlInput'! |
|
966 |
||
967 |
cleanInputs: aDirtyString |
|
1525 | 968 |
"Find and remove common mistakes made by the user. Return the |
969 |
'aStringToBeCleaned' variable" |
|
1522 | 970 |
| aStringToBeCleaned rs position| |
971 |
||
972 |
aStringToBeCleaned:=aDirtyString. |
|
973 |
||
974 |
(aStringToBeCleaned endsWith:(Character cr)) ifTrue:[ |
|
975 |
aStringToBeCleaned:=aStringToBeCleaned copyFrom:1 to: (aStringToBeCleaned size -1).]. |
|
976 |
aStringToBeCleaned:= aStringToBeCleaned withoutSeparators. |
|
977 |
||
978 |
||
979 |
rs:=ReadStream on: aStringToBeCleaned. |
|
980 |
[rs upToAll: '#true'. rs atEnd] whileFalse: [ |
|
981 |
position:= rs position. |
|
982 |
aStringToBeCleaned:=aStringToBeCleaned copyReplaceFrom: position to: position with: ''. "remove #" |
|
983 |
rs:=ReadStream on: aStringToBeCleaned. |
|
984 |
]. |
|
985 |
||
986 |
rs:=ReadStream on: aStringToBeCleaned. |
|
987 |
[rs upToAll: '#false'. rs atEnd] whileFalse: [ |
|
988 |
position:= rs position. |
|
989 |
aStringToBeCleaned:=aStringToBeCleaned copyReplaceFrom: position to: position with: ''. "remove #" |
|
990 |
rs:=ReadStream on: aStringToBeCleaned. |
|
991 |
rs:=ReadStream on: aStringToBeCleaned. ]. |
|
992 |
||
993 |
[rs upToAll: '#nil'. rs atEnd] whileFalse: [ |
|
994 |
position:= rs position. |
|
995 |
aStringToBeCleaned:=aStringToBeCleaned copyReplaceFrom: position to: position with: ''. "remove #" |
|
996 |
rs:=ReadStream on: aStringToBeCleaned. ]. |
|
997 |
^aStringToBeCleaned |
|
998 |
! |
|
999 |
||
1525 | 1000 |
markMatchingClasses: aSelector classesWithSelector:anOrderedCollection |
1001 |
" Matches the class of the receiver with all the elements in anOrderedCollection |
|
1002 |
(which are classes with selectors). If a match is found it is marked with an asterisk. |
|
1003 |
The classes are then sorted so the the asterisk appears first. Return the |
|
1004 |
markedClassList." |
|
1522 | 1005 |
|
2165 | 1006 |
| marker recClass unmarkedClassList markedClassList| |
1522 | 1007 |
|
1532 | 1008 |
marker := self class markerForImplementingClass. |
1009 |
||
1010 |
recClass := receiver value class. |
|
1525 | 1011 |
unmarkedClassList:=anOrderedCollection copy. |
1012 |
unmarkedClassList do: |
|
1013 |
[:classAndMethod | | class | |
|
1014 |
class:=Compiler evaluate: |
|
1015 |
((ReadStream on: classAndMethod) upToAll: aSelector). |
|
1532 | 1016 |
"/ (recClass == class) |
1017 |
(recClass whichClassImplements:aSelector) == class |
|
1018 |
ifTrue: |
|
1019 |
["/ unmarkedClassList add: marker, classAndMethod. |
|
1020 |
unmarkedClassList add: classAndMethod allBold. |
|
1021 |
unmarkedClassList remove: classAndMethod. |
|
1022 |
]. |
|
1023 |
]. |
|
1522 | 1024 |
|
1025 |
unmarkedClassList sort:[:a :b | |rawA rawB| |
|
1532 | 1026 |
rawA := a string. |
1027 |
(rawA startsWith:marker) ifTrue:[rawA := rawA copyFrom:marker size+1]. |
|
1028 |
rawB := b string. |
|
1029 |
(rawB startsWith:marker) ifTrue:[rawB := rawB copyFrom:marker size+1]. |
|
1030 |
rawA < rawB. ]. |
|
1525 | 1031 |
markedClassList:= unmarkedClassList. |
1032 |
||
1033 |
^markedClassList |
|
1532 | 1034 |
|
1035 |
"Modified: / 13.11.2001 / 12:16:05 / cg" |
|
1522 | 1036 |
! |
1037 |
||
1038 |
mergReciever: aReceiver WithArgument: arguments |
|
1039 |
||
1525 | 1040 |
"Puts the receiver and arguments into an array so it can be of a suitable input for the |
1041 |
MethodFinder. Return an array." |
|
1042 |
||
1522 | 1043 |
| tempReceiver tempArguments receiverWithArgument| |
1044 |
||
1045 |
tempReceiver:= aReceiver. |
|
1046 |
tempArguments := arguments. |
|
1047 |
||
1048 |
(tempArguments isEmpty or:[(tempArguments) isNil]) |
|
1049 |
ifTrue:[ receiverWithArgument:=Array new:1."no argument" |
|
1050 |
receiverWithArgument at:1 put: tempReceiver. |
|
1051 |
] |
|
1052 |
ifFalse:[ |
|
1053 |
(tempArguments size = 1) |
|
1054 |
ifTrue:[ receiverWithArgument:=Array new:2. |
|
1055 |
receiverWithArgument at:1 put: tempReceiver. |
|
1056 |
receiverWithArgument at:2 put: (tempArguments at:1) |
|
1057 |
]. "a receiver with an argument" |
|
1058 |
||
1059 |
(tempArguments size = 2) |
|
1060 |
ifTrue:[ receiverWithArgument:=Array new:3. |
|
1061 |
receiverWithArgument at:1 put: tempReceiver. |
|
1062 |
(receiverWithArgument at:2 put: (tempArguments at:1)). |
|
1063 |
(receiverWithArgument at:3 put: (tempArguments at:2)) |
|
1064 |
]. "a receiver with an argument" |
|
1065 |
(tempArguments size = 3) |
|
1066 |
ifTrue:[ receiverWithArgument:=Array new:4. |
|
1067 |
receiverWithArgument at:1 put: tempReceiver. |
|
1068 |
(receiverWithArgument at:2 put: (tempArguments at:1)). |
|
1069 |
(receiverWithArgument at:3 put: (tempArguments at:2)). |
|
1070 |
(receiverWithArgument at:4 put: (tempArguments at:3)). |
|
1071 |
||
1072 |
]. "a receiver with an argument" |
|
1073 |
||
1074 |
]. |
|
1075 |
^receiverWithArgument |
|
1076 |
! ! |
|
1077 |
||
1532 | 1078 |
!MethodFinderWindow methodsFor:'misc'! |
1079 |
||
1080 |
aboutThisApplicationText |
|
1081 |
|msg| |
|
1082 |
||
1083 |
msg := super aboutThisApplicationText. |
|
2412 | 1084 |
msg := msg , '\\Ported from Squeak to ST/X by James Hayes (james@exept.de). |
1085 |
Original written by Ted Kaehler, Scott Wallace and Dan Ingalls.'. |
|
1532 | 1086 |
^msg withCRs. |
1087 |
||
1088 |
"Modified: / 13.11.2001 / 12:56:44 / cg" |
|
1089 |
! ! |
|
1090 |
||
1522 | 1091 |
!MethodFinderWindow class methodsFor:'documentation'! |
1092 |
||
1093 |
version |
|
1094 |
^ '$Header$' |
|
2730 | 1095 |
! |
1096 |
||
1097 |
version_CVS |
|
1098 |
^ '$Header$' |
|
1522 | 1099 |
! ! |