MethodFinderWindow.st
author Claus Gittinger <cg@exept.de>
Wed, 29 Jul 2009 20:02:02 +0200
changeset 2570 4e663bc64364
parent 2459 dc2cc94d9444
child 2730 abcb0402d5ba
permissions -rw-r--r--
changed #requestPackage
james@1522
     1
"{ Package: 'stx:libtool2' }"
james@1522
     2
james@1522
     3
ApplicationModel subclass:#MethodFinderWindow
james@1522
     4
	instanceVariableNames:'argumentsEditor messageAnswerEditor receiverEditor receiver
james@1522
     5
		resultSelectors arg2BoxVisible arg1BoxVisible arg4BoxVisible
james@1522
     6
		arg3BoxVisible argCountHolder argCountList argument1Editor
james@1522
     7
		argument2Editor argument3Editor argument4Editor resultSelected
cg@1532
     8
		lookAtResultEditor codeHolder'
james@1522
     9
	classVariableNames:''
james@1522
    10
	poolDictionaries:''
cg@1538
    11
	category:'Interface-MethodFinder'
james@1522
    12
!
james@1522
    13
cg@1530
    14
!MethodFinderWindow class methodsFor:'documentation'!
cg@1530
    15
cg@1530
    16
documentation
cg@1530
    17
"
cg@1531
    18
  [author:]
cg@1531
    19
    ported from Squeak and GUI enhanced by James Hayes james@exept.de
cg@1530
    20
"
cg@1530
    21
! !
james@1522
    22
cg@1532
    23
!MethodFinderWindow class methodsFor:'constants'!
cg@1532
    24
cg@1532
    25
markerForImplementingClass
cg@1532
    26
    ^ '=> '.
cg@1532
    27
    ^ '*'
cg@1532
    28
cg@1532
    29
    "Created: / 13.11.2001 / 12:09:52 / cg"
cg@1532
    30
    "Modified: / 13.11.2001 / 12:11:57 / cg"
cg@1532
    31
! !
cg@1532
    32
james@1522
    33
!MethodFinderWindow class methodsFor:'interface specs'!
james@1522
    34
james@1522
    35
windowSpec
james@1522
    36
    "This resource specification was automatically generated
james@1522
    37
     by the UIPainter of ST/X."
james@1522
    38
james@1522
    39
    "Do not manually edit this!! If it is corrupted,
james@1522
    40
     the UIPainter may not be able to read the specification."
james@1522
    41
james@1522
    42
    "
james@1522
    43
     UIPainter new openOnClass:MethodFinderWindow andSelector:#windowSpec
james@1522
    44
     MethodFinderWindow new openInterface:#windowSpec
james@1522
    45
     MethodFinderWindow open
james@1522
    46
    "
james@1522
    47
james@1522
    48
    <resource: #canvas>
james@1522
    49
james@1522
    50
    ^ 
james@1522
    51
     #(#FullSpec
james@1522
    52
        #name: #windowSpec
james@1522
    53
        #window: 
james@1522
    54
       #(#WindowSpec
james@1522
    55
          #label: 'MethodFinder'
james@1522
    56
          #name: 'MethodFinder'
james@1525
    57
          #min: #(#Point nil nil)
james@1525
    58
          #max: #(#Point nil nil)
cg@1530
    59
          #bounds: #(#Rectangle 13 23 563 423)
james@1525
    60
          #menu: #menu
james@1525
    61
          #forceRecursiveBackground: false
james@1522
    62
        )
james@1522
    63
        #component: 
james@1522
    64
       #(#SpecCollection
james@1522
    65
          #collection: #(
cg@1532
    66
           #(#VariableHorizontalPanelSpec
cg@1532
    67
              #name: 'VariableHorizontalPanel1'
cg@1530
    68
              #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
cg@1532
    69
              #snapMode: #both
james@1522
    70
              #component: 
james@1522
    71
             #(#SpecCollection
james@1522
    72
                #collection: #(
cg@1530
    73
                 #(#ViewSpec
cg@1532
    74
                    #name: 'Box6'
cg@1532
    75
                    #level: 1
james@1522
    76
                    #component: 
james@1522
    77
                   #(#SpecCollection
james@1522
    78
                      #collection: #(
cg@1532
    79
                       #(#SequenceViewSpec
cg@1532
    80
                          #name: 'List1'
cg@1532
    81
                          #layout: #(#LayoutFrame 0 0 0 0.5 0 1 0 1)
cg@1532
    82
                          #hasHorizontalScrollBar: true
cg@1532
    83
                          #hasVerticalScrollBar: true
cg@1532
    84
                          #autoHideScrollBars: true
cg@1532
    85
                          #valueChangeSelector: #updateImplementorsOf:
cg@1532
    86
                          #useIndex: true
cg@1532
    87
                          #sequenceList: #resultHolder
james@1525
    88
                        )
cg@1532
    89
                       #(#ViewSpec
cg@1532
    90
                          #name: 'Box4'
cg@1532
    91
                          #layout: #(#LayoutFrame 0 0 0 0 0 1 -25 0.5)
james@1522
    92
                          #component: 
james@1522
    93
                         #(#SpecCollection
james@1522
    94
                            #collection: #(
cg@1532
    95
                             #(#LabelSpec
cg@1532
    96
                                #label: 'Receiver'
cg@1532
    97
                                #name: 'ReceiverLabel'
cg@1532
    98
                                #layout: #(#LayoutFrame -4 0.0162791 0 0 -4 0.293023 24 0)
cg@1532
    99
                                #translateLabel: true
cg@1532
   100
                                #adjust: #center
cg@1530
   101
                              )
cg@1532
   102
                             #(#ComboListSpec
cg@1532
   103
                                #name: 'allowedArgments'
cg@1532
   104
                                #layout: #(#LayoutFrame 0 0.339535 1 0 0 0.653488 23 0)
cg@1532
   105
                                #model: #argCountHolder
cg@1532
   106
                                #comboList: #argCountList
cg@1532
   107
                                #useIndex: true
cg@1532
   108
                              )
cg@1532
   109
                             #(#LabelSpec
cg@1532
   110
                                #label: 'Answer'
cg@1532
   111
                                #name: 'MessageAnswerLabel'
cg@1532
   112
                                #layout: #(#LayoutFrame 0 0.6693 0 0 0 0.99023 24 0)
cg@1532
   113
                                #translateLabel: true
cg@1532
   114
                                #adjust: #center
cg@1532
   115
                              )
cg@1532
   116
                             #(#HorizontalPanelViewSpec
cg@1532
   117
                                #name: 'HorizontalPanel1'
cg@1532
   118
                                #layout: #(#LayoutFrame 0 0 25 0 0 1 0 1)
cg@1530
   119
                                #horizontalLayout: #fit
cg@1530
   120
                                #verticalLayout: #fit
cg@1530
   121
                                #horizontalSpace: 3
cg@1530
   122
                                #verticalSpace: 3
james@1525
   123
                                #component: 
james@1525
   124
                               #(#SpecCollection
james@1525
   125
                                  #collection: #(
cg@1532
   126
                                   #(#WorkspaceSpec
cg@1532
   127
                                      #name: 'ReceiverEditor'
cg@1532
   128
                                      #tabable: true
cg@1532
   129
                                      #hasHorizontalScrollBar: true
cg@1532
   130
                                      #hasVerticalScrollBar: true
cg@1532
   131
                                      #miniScrollerHorizontal: true
cg@1532
   132
                                      #miniScrollerVertical: true
cg@1532
   133
                                      #autoHideScrollBars: true
cg@1532
   134
                                      #extent: #(#Point 87 149)
cg@1532
   135
                                      #postBuildCallback: #receiverWidgetCreated:
cg@1532
   136
                                    )
cg@1532
   137
                                   #(#VerticalPanelViewSpec
cg@1532
   138
                                      #name: 'VerticalPanel1'
cg@1532
   139
                                      #horizontalLayout: #fit
cg@1532
   140
                                      #verticalLayout: #fit
cg@1532
   141
                                      #horizontalSpace: 3
cg@1532
   142
                                      #verticalSpace: 3
cg@1530
   143
                                      #component: 
cg@1530
   144
                                     #(#SpecCollection
cg@1530
   145
                                        #collection: #(
cg@1532
   146
                                         #(#ViewSpec
cg@1532
   147
                                            #name: 'Box1'
cg@1532
   148
                                            #visibilityChannel: #arg1BoxVisible
cg@1532
   149
                                            #component: 
cg@1532
   150
                                           #(#SpecCollection
cg@1532
   151
                                              #collection: #(
cg@1532
   152
                                               #(#WorkspaceSpec
cg@1532
   153
                                                  #name: 'Arg1Editor'
cg@1532
   154
                                                  #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
cg@1532
   155
                                                  #tabable: true
cg@1532
   156
                                                  #hasHorizontalScrollBar: true
cg@1532
   157
                                                  #hasVerticalScrollBar: true
cg@1532
   158
                                                  #miniScrollerHorizontal: true
cg@1532
   159
                                                  #miniScrollerVertical: true
cg@1532
   160
                                                  #autoHideScrollBars: true
cg@1532
   161
                                                  #postBuildCallback: #argument1WidgetCreated:
cg@1532
   162
                                                )
cg@1532
   163
                                               )
cg@1532
   164
                                             
cg@1532
   165
                                            )
cg@1532
   166
                                            #extent: #(#Point 87 48)
cg@1532
   167
                                          )
cg@1532
   168
                                         #(#ViewSpec
cg@1532
   169
                                            #name: 'Box2'
cg@1532
   170
                                            #visibilityChannel: #arg2BoxVisible
cg@1532
   171
                                            #component: 
cg@1532
   172
                                           #(#SpecCollection
cg@1532
   173
                                              #collection: #(
cg@1532
   174
                                               #(#WorkspaceSpec
cg@1532
   175
                                                  #name: 'TextEditor5'
cg@1532
   176
                                                  #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
cg@1532
   177
                                                  #tabable: true
cg@1532
   178
                                                  #hasHorizontalScrollBar: true
cg@1532
   179
                                                  #hasVerticalScrollBar: true
cg@1532
   180
                                                  #miniScrollerHorizontal: true
cg@1532
   181
                                                  #miniScrollerVertical: true
cg@1532
   182
                                                  #autoHideScrollBars: true
cg@1532
   183
                                                  #postBuildCallback: #argument2WidgetCreated:
cg@1532
   184
                                                )
cg@1532
   185
                                               )
cg@1532
   186
                                             
cg@1532
   187
                                            )
cg@1532
   188
                                            #extent: #(#Point 87 47)
cg@1532
   189
                                          )
cg@1532
   190
                                         #(#ViewSpec
cg@1532
   191
                                            #name: 'Box3'
cg@1532
   192
                                            #visibilityChannel: #arg3BoxVisible
cg@1532
   193
                                            #component: 
cg@1532
   194
                                           #(#SpecCollection
cg@1532
   195
                                              #collection: #(
cg@1532
   196
                                               #(#WorkspaceSpec
cg@1532
   197
                                                  #name: 'TextEditor6'
cg@1532
   198
                                                  #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
cg@1532
   199
                                                  #tabable: true
cg@1532
   200
                                                  #hasHorizontalScrollBar: true
cg@1532
   201
                                                  #hasVerticalScrollBar: true
cg@1532
   202
                                                  #miniScrollerHorizontal: true
cg@1532
   203
                                                  #miniScrollerVertical: true
cg@1532
   204
                                                  #autoHideScrollBars: true
cg@1532
   205
                                                  #postBuildCallback: #argument3WidgetCreated:
cg@1532
   206
                                                )
cg@1532
   207
                                               )
cg@1532
   208
                                             
cg@1532
   209
                                            )
cg@1532
   210
                                            #extent: #(#Point 87 48)
cg@1530
   211
                                          )
cg@1530
   212
                                         )
cg@1530
   213
                                       
cg@1530
   214
                                      )
cg@1532
   215
                                      #extent: #(#Point 87 149)
cg@1530
   216
                                    )
cg@1532
   217
                                   #(#WorkspaceSpec
cg@1532
   218
                                      #name: 'AnswerEditor'
cg@1532
   219
                                      #tabable: true
cg@1532
   220
                                      #hasHorizontalScrollBar: true
cg@1532
   221
                                      #hasVerticalScrollBar: true
cg@1532
   222
                                      #miniScrollerHorizontal: true
cg@1532
   223
                                      #miniScrollerVertical: true
cg@1532
   224
                                      #autoHideScrollBars: true
cg@1532
   225
                                      #extent: #(#Point 88 149)
cg@1532
   226
                                      #postBuildCallback: #messageAnswerWidgetCreated:
james@1525
   227
                                    )
james@1525
   228
                                   )
james@1525
   229
                                 
james@1525
   230
                                )
james@1525
   231
                              )
cg@1532
   232
                             )
cg@1532
   233
                           
cg@1532
   234
                          )
cg@1532
   235
                        )
cg@1532
   236
                       #(#ViewSpec
cg@1532
   237
                          #name: 'Box5'
cg@1532
   238
                          #layout: #(#LayoutFrame 53 0.224737 -23 0.5 0 1 0 0.5)
cg@1532
   239
                          #component: 
cg@1532
   240
                         #(#SpecCollection
cg@1532
   241
                            #collection: #(
cg@1532
   242
                             #(#ActionButtonSpec
cg@1532
   243
                                #label: 'Clear'
cg@1532
   244
                                #name: 'Button2'
cg@1532
   245
                                #layout: #(#LayoutFrame 0 0 0 0 -5 0.5 0 1)
cg@1532
   246
                                #translateLabel: true
cg@1532
   247
                                #model: #clear
cg@1532
   248
                              )
cg@1532
   249
                             #(#ActionButtonSpec
cg@1532
   250
                                #label: 'Search'
cg@1532
   251
                                #name: 'Button1'
cg@1532
   252
                                #layout: #(#LayoutFrame 5 0.5 0 0 0 1 0 1)
cg@1532
   253
                                #translateLabel: true
cg@1530
   254
                                #tabable: true
cg@1532
   255
                                #model: #search
james@1522
   256
                              )
james@1522
   257
                             )
james@1522
   258
                           
james@1522
   259
                          )
james@1522
   260
                        )
cg@1530
   261
                       )
cg@1530
   262
                     
cg@1530
   263
                    )
cg@1530
   264
                  )
cg@1532
   265
                 #(#VariableVerticalPanelSpec
cg@1532
   266
                    #name: 'VariableVerticalPanel1'
cg@1530
   267
                    #component: 
cg@1530
   268
                   #(#SpecCollection
cg@1530
   269
                      #collection: #(
cg@1532
   270
                       #(#SequenceViewSpec
cg@1532
   271
                          #name: 'List2'
cg@1532
   272
                          #model: #selectedClassOfResultHolder
cg@1532
   273
                          #menu: #implementorListMenu
cg@1532
   274
                          #hasHorizontalScrollBar: true
cg@1532
   275
                          #hasVerticalScrollBar: true
cg@1532
   276
                          #autoHideScrollBars: true
cg@1532
   277
                          #doubleClickSelector: #openBrowserOn:
cg@1532
   278
                          #valueChangeSelector: #selectedClassOfResultHolderChanged
cg@1532
   279
                          #useIndex: false
cg@1532
   280
                          #sequenceList: #classOfResultHolder
cg@1530
   281
                        )
cg@1532
   282
                       #(#CodeViewSpec
cg@1532
   283
                          #name: 'CodeView'
cg@1532
   284
                          #model: #codeHolder
cg@1532
   285
                          #hasHorizontalScrollBar: true
cg@1532
   286
                          #hasVerticalScrollBar: true
cg@1532
   287
                          #autoHideScrollBars: true
cg@1532
   288
                          #postBuildCallback: #sourceCodeWidgetCreated:
james@1522
   289
                        )
james@1522
   290
                       )
james@1522
   291
                     
james@1522
   292
                    )
cg@1532
   293
                    #handles: #(#Any 0.5 1.0)
james@1522
   294
                  )
james@1522
   295
                 )
james@1522
   296
               
james@1522
   297
              )
cg@1532
   298
              #handles: #(#Any 0.5 1.0)
james@1522
   299
            )
james@1522
   300
           )
james@1522
   301
         
james@1522
   302
        )
james@1522
   303
      )
cg@1530
   304
cg@1532
   305
    "Modified: / 13.11.2001 / 12:53:50 / cg"
james@1522
   306
! !
james@1522
   307
james@1525
   308
!MethodFinderWindow class methodsFor:'menu specs'!
james@1525
   309
cg@1529
   310
implementorListMenu
cg@1529
   311
    "This resource specification was automatically generated
cg@1529
   312
     by the MenuEditor of ST/X."
cg@1529
   313
cg@1529
   314
    "Do not manually edit this!! If it is corrupted,
cg@1529
   315
     the MenuEditor may not be able to read the specification."
cg@1529
   316
cg@1529
   317
    "
cg@1529
   318
     MenuEditor new openOnClass:MethodFinderWindow andSelector:#implementorListMenu
cg@1529
   319
     (Menu new fromLiteralArrayEncoding:(MethodFinderWindow implementorListMenu)) startUp
cg@1529
   320
    "
cg@1529
   321
cg@1529
   322
    <resource: #menu>
cg@1529
   323
cg@1529
   324
    ^ 
cg@1529
   325
     #(#Menu
cg@1529
   326
        #(
cg@1529
   327
         #(#MenuItem
cg@1529
   328
            #label: 'Browse'
cg@1529
   329
            #translateLabel: true
cg@1529
   330
            #value: #openBrowserOnSelectedItem
cg@1529
   331
          )
cg@1529
   332
         )
cg@1529
   333
        nil
cg@1529
   334
        nil
cg@1529
   335
      )
cg@1529
   336
!
cg@1529
   337
james@1525
   338
menu
james@1525
   339
    "This resource specification was automatically generated
james@1525
   340
     by the MenuEditor of ST/X."
james@1525
   341
james@1525
   342
    "Do not manually edit this!! If it is corrupted,
james@1525
   343
     the MenuEditor may not be able to read the specification."
james@1525
   344
james@1525
   345
    "
james@1525
   346
     MenuEditor new openOnClass:MethodFinderWindow andSelector:#menu
james@1525
   347
     (Menu new fromLiteralArrayEncoding:(MethodFinderWindow menu)) startUp
james@1525
   348
    "
james@1525
   349
james@1525
   350
    <resource: #menu>
james@1525
   351
james@1525
   352
    ^ 
james@1525
   353
     #(#Menu
james@1525
   354
        #(
james@1525
   355
         #(#MenuItem
james@1525
   356
            #label: '&File'
james@1525
   357
            #activeHelpKey: #file
james@1525
   358
            #submenu: 
james@1525
   359
           #(#Menu
james@1525
   360
              #(
james@1525
   361
               #(#MenuItem
james@1525
   362
                  #label: 'Exit'
james@1525
   363
                  #value: #closeRequest
james@1525
   364
                  #activeHelpKey: #fileExit
james@1525
   365
                )
james@1525
   366
               )
james@1525
   367
              nil
james@1525
   368
              nil
james@1525
   369
            )
james@1525
   370
          )
james@1525
   371
         #(#MenuItem
james@1525
   372
            #label: 'Help'
james@1525
   373
            #startGroup: #right
james@1525
   374
            #submenu: 
james@1525
   375
           #(#Menu
james@1525
   376
              #(
james@1525
   377
               #(#MenuItem
james@1525
   378
                  #label: 'Documentation'
james@1525
   379
                  #value: #openHTMLDocumentation
james@1525
   380
                  #activeHelpKey: #helpTutorial
james@1525
   381
                )
james@1525
   382
               #(#MenuItem
cg@1532
   383
                  #label: 'About MethodFinder...'
james@1525
   384
                  #value: #openAboutThisApplication
james@1525
   385
                  #activeHelpKey: #aboutThisAppliaction
james@1525
   386
                )
james@1525
   387
               )
james@1525
   388
              nil
james@1525
   389
              nil
james@1525
   390
            )
james@1525
   391
          )
james@1525
   392
         )
james@1525
   393
        nil
james@1525
   394
        nil
james@1525
   395
      )
cg@1532
   396
cg@1532
   397
    "Modified: / 13.11.2001 / 12:36:39 / cg"
james@1525
   398
! !
james@1525
   399
james@1522
   400
!MethodFinderWindow methodsFor:'accessing'!
james@1522
   401
james@1522
   402
receiver
james@1525
   403
    "Return a copy of the value of the instance variable 'receiver' "
james@1522
   404
james@1522
   405
    ^ receiver copy
james@1522
   406
! !
james@1522
   407
james@1522
   408
!MethodFinderWindow methodsFor:'actions'!
james@1522
   409
james@1522
   410
argumentEditorsContents
james@1525
   411
james@1525
   412
"Determine how many text editors of the arguments are used and store the result
james@1525
   413
as argCounter. The result being the minimum between how many editors have
james@1525
   414
expressions in and how many are displayed.
james@1525
   415
james@1525
   416
Add each argument string (key)and the evaluated version (value) to an Ordered Dictionary
james@1525
   417
from each of the text editors.
james@1525
   418
james@1525
   419
Return the OrderedDictionary with the expressions from all the text editors. "
james@1525
   420
sr@2165
   421
     | tempArguments argCounter tempArgument1Editor tempArgument2Editor tempArgument3Editor
james@1522
   422
associationKey associationValue|
james@1522
   423
james@1522
   424
argCounter:=0.
james@1522
   425
james@1522
   426
tempArgument1Editor:= (self cleanInputs: argument1Editor contents).
james@1522
   427
tempArgument2Editor:=  (self cleanInputs: argument2Editor contents).
james@1522
   428
tempArgument3Editor:= (self cleanInputs: argument3Editor contents).
james@1522
   429
james@1522
   430
tempArgument1Editor = '' ifFalse:[argCounter:=argCounter +1].
james@1522
   431
tempArgument2Editor = '' ifFalse:[argCounter:=argCounter +1].
james@1522
   432
tempArgument3Editor = '' ifFalse:[argCounter:=argCounter +1].
james@1522
   433
james@1522
   434
james@1522
   435
argCounter:= (argCounter min: (self argCountHolder value -1)).
james@1522
   436
tempArguments:= OrderedDictionary new:argCounter. 
james@1522
   437
james@1522
   438
(argCounter value >= 1) 
james@1522
   439
                ifTrue:[associationValue:= (Compiler evaluate: tempArgument1Editor).
james@1522
   440
                        ((self isExpression:tempArgument1Editor) or:[ associationValue isNil]) ifTrue:[                  "looks if an expression is typed in"
james@1522
   441
                                        associationKey:=associationValue printString]
james@1522
   442
                                                          ifFalse:[
james@1522
   443
                                        associationKey:=tempArgument1Editor].
james@1522
   444
james@1522
   445
                        tempArguments add: associationKey-> associationValue.
james@1522
   446
                        ].
james@1522
   447
(argCounter value >= 2) 
james@1522
   448
                ifTrue:[ associationValue:= (Compiler evaluate: tempArgument2Editor).
james@1522
   449
                        (((self isExpression:tempArgument2Editor) or:[ associationValue isNil])) ifTrue:[                  "looks if an expression is typed in"
james@1522
   450
                                        associationKey:=associationValue printString]
james@1522
   451
                                                          ifFalse:[
james@1522
   452
                                        associationKey:=tempArgument2Editor].
james@1522
   453
james@1522
   454
                        tempArguments add: associationKey-> associationValue].
james@1522
   455
james@1522
   456
(argCounter value >= 3)
james@1522
   457
                ifTrue:[ associationValue:= (Compiler evaluate: tempArgument3Editor).
james@1522
   458
                        ((self isExpression:tempArgument3Editor) or:[ associationValue isNil]) ifTrue:[                  "looks if an expression is typed in"
james@1522
   459
                                        associationKey:=associationValue printString]
james@1522
   460
                                                          ifFalse:[
james@1522
   461
                                        associationKey:=tempArgument3Editor].
james@1522
   462
james@1522
   463
                        tempArguments add: associationKey-> associationValue].
james@1522
   464
james@1522
   465
james@1522
   466
^tempArguments
james@1522
   467
!
james@1522
   468
james@1522
   469
clear
james@1525
   470
    "Reset the contents of all the outputs. Return the receiver."
james@1522
   471
james@1522
   472
    receiverEditor contents:nil.
james@1522
   473
    argument1Editor contents:nil.
james@1522
   474
    argument2Editor contents:nil.
james@1522
   475
    argument3Editor contents:nil.
james@1522
   476
    messageAnswerEditor contents:nil.
james@1522
   477
    self resultHolder value:nil.
james@1525
   478
    self classOfResultHolder value: nil.
james@1522
   479
!
james@1522
   480
cg@1532
   481
extractClassAndSelectorFrom:anArgument 
cg@1532
   482
    "Opens browser on theArgument of a specific class. anArgument being a string with the
cg@1532
   483
       Class and the selector upon which the browser is to be opened. Return the receiver."
cg@1532
   484
cg@1532
   485
    |aClass aSelector x theArgument marker|
cg@1532
   486
cg@1532
   487
    anArgument isNil ifTrue:[
cg@1532
   488
        ^ nil
cg@1532
   489
    ].
cg@1532
   490
    marker := self class markerForImplementingClass.
cg@1532
   491
cg@1532
   492
    theArgument := anArgument string.
cg@1532
   493
    (theArgument startsWith:marker) ifTrue:[
cg@1532
   494
        theArgument := theArgument copyFrom:marker size+1
cg@1532
   495
    ].
cg@1532
   496
    aClass := theArgument copyUpTo:(Character space).
cg@1532
   497
    x := aClass size + 2.
cg@1532
   498
    aSelector := theArgument copyFrom:x.
cg@1532
   499
    aClass := Smalltalk classNamed:aClass.
cg@1532
   500
    ^ aClass -> aSelector asSymbol
cg@1532
   501
cg@1532
   502
"
cg@1532
   503
MethodFinderWindow new extractClassAndSelectorFrom: '*SmallInteger +'
cg@1532
   504
MethodFinderWindow new extractClassAndSelectorFrom: 'String ,'       
cg@1532
   505
MethodFinderWindow new extractClassAndSelectorFrom: 'Number detentBy:atMultiplesOf:snap:' 
cg@1532
   506
cg@1532
   507
cg@1532
   508
"
cg@1532
   509
cg@1532
   510
    "Modified: / 13.11.2001 / 12:45:43 / cg"
cg@1532
   511
!
cg@1532
   512
james@1522
   513
isExpression: aString
james@1525
   514
      "Return true or false depending on if the subString includes certain characters"
james@1522
   515
(aString includesSubString:': ') ifTrue:[^true].
james@1522
   516
(aString includesSubString:'+') ifTrue:[^true].
james@1522
   517
(aString includesSubString:'-') ifTrue:[^true].
james@1522
   518
(aString includesSubString:'*') ifTrue:[^true].
james@1522
   519
(aString includesSubString:'/') ifTrue:[^true].
james@1522
   520
(aString includesSubString:'>') ifTrue:[^true].
james@1522
   521
(aString includesSubString:'<') ifTrue:[^true].
james@1522
   522
(aString includesSubString:' new') ifTrue:[^true].
james@1522
   523
(aString includesSubString:'[') &  (aString includesSubString:']') & (aString includesSubString:'.')
james@1522
   524
                                ifTrue:[^false].
james@1522
   525
(aString includesSubString:'.') ifTrue:[^true].
james@1522
   526
james@1522
   527
 ^false
james@1522
   528
!
james@1522
   529
james@1522
   530
messageAnswerEditorContents
james@1525
   531
   "Return a cleaned up version of message answer taken from the messageAnswerEditor
james@1525
   532
    as an association. The association has cleanedAnswerString as a key and the 
james@1525
   533
    compiledAnswer as value."
james@1522
   534
james@1522
   535
    |   aCleanedAnswerString   compiledAnswer  |
james@1522
   536
james@1522
   537
aCleanedAnswerString:=self cleanInputs: (messageAnswerEditor contents). 
james@1522
   538
compiledAnswer:=Compiler evaluate: aCleanedAnswerString.
james@1522
   539
((self isExpression:aCleanedAnswerString) or:[compiledAnswer isNil]) ifTrue:[
james@1522
   540
                        aCleanedAnswerString:=compiledAnswer printString].
james@1522
   541
james@1522
   542
^aCleanedAnswerString->compiledAnswer.
james@1522
   543
!
james@1522
   544
james@1522
   545
openBrowserOn:anArgument 
james@1522
   546
    "Opens browser on theArgument of a specific class. anArgument being a string with the
james@1525
   547
       Class and the selector upon which the browser is to be opened. Return the receiver."
james@1522
   548
cg@1532
   549
    |classAndSelector|
james@1522
   550
cg@1532
   551
    classAndSelector := self extractClassAndSelectorFrom:anArgument.
cg@1532
   552
    classAndSelector isNil ifTrue:[
james@1525
   553
        ^ self
james@1522
   554
    ].
cg@2459
   555
    UserPreferences current systemBrowserClass
cg@2459
   556
        openInClass:classAndSelector key 
cg@2459
   557
        selector:classAndSelector value   
james@1525
   558
james@1525
   559
"
james@1525
   560
MethodFinderWindow new openBrowserOn: '*SmallInteger +'
james@1525
   561
MethodFinderWindow new openBrowserOn: 'String ,'
james@1525
   562
MethodFinderWindow new openBrowserOn: 'Number detentBy:atMultiplesOf:snap:' 
james@1525
   563
james@1525
   564
james@1525
   565
"
cg@1532
   566
cg@1532
   567
    "Modified: / 13.11.2001 / 12:46:17 / cg"
james@1522
   568
!
james@1522
   569
cg@1529
   570
openBrowserOnSelectedItem 
cg@1529
   571
    |sel|
cg@1529
   572
cg@1529
   573
    sel := self selectedClassOfResultHolder value.
cg@1529
   574
    self openBrowserOn:sel
cg@1532
   575
cg@1532
   576
    "Modified: / 13.11.2001 / 12:47:39 / cg"
cg@1529
   577
!
cg@1529
   578
james@1522
   579
receiverEditorContents
james@1525
   580
   "Return a cleaned up version of receiver taken from the receiverEditor
james@1525
   581
    as an association. The association has aCleanedRecieverString as a key and the 
james@1525
   582
    compiledReceiver as value."
james@1525
   583
james@1522
   584
    |   aCleanedRecieverString   compiledReceiver  |
james@1522
   585
james@1522
   586
aCleanedRecieverString:=self cleanInputs: (receiverEditor contents). 
james@1522
   587
james@1522
   588
compiledReceiver:=Compiler evaluate: aCleanedRecieverString.
james@1522
   589
james@1522
   590
((self isExpression:aCleanedRecieverString) or:[compiledReceiver isNil]) ifTrue:[
james@1522
   591
                        aCleanedRecieverString:=compiledReceiver printString].
james@1522
   592
^aCleanedRecieverString->compiledReceiver.
james@1522
   593
!
james@1522
   594
james@1522
   595
search
james@1525
   596
"Do a search based on the input in the various text editors. Return the receiver."
james@1522
   597
| tempReceiver tempAnswer tempArguments anArray resultArray receiverWithArgument mf|
cg@1534
   598
cg@1534
   599
self resultHolder value: nil.                "reset the result list"
james@1522
   600
self classOfResultHolder value: nil.        "reset the implementorOf list"
cg@1534
   601
self codeHolder value: nil.                  "reset the source"
james@1522
   602
james@1522
   603
tempArguments:=self argumentEditorsContents.
james@1522
   604
tempReceiver :=self receiverEditorContents .  
james@1522
   605
tempAnswer:= self messageAnswerEditorContents.   
james@1522
   606
james@1522
   607
"self cleanInputRec:tempReceiver arg:tempArguments ans:tempAnswer."
james@1522
   608
james@1522
   609
james@1522
   610
anArray:=Array new:2.  "creates an array which is to be used as input for the method finder."
james@1522
   611
james@1522
   612
receiverWithArgument:=self mergReciever: (tempReceiver value) WithArgument: (tempArguments values).
james@1522
   613
james@1522
   614
anArray at:1 put:receiverWithArgument;
james@1522
   615
        at:2 put: tempAnswer value.             
james@1522
   616
james@1522
   617
"an array now holds the following array #(#(receiver argument) answer) or #(#(reciever) answer). which should
james@1522
   618
be suitable input for the method finder."
cg@1534
   619
self withCursor:Cursor execute do:[
cg@1534
   620
    mf:= MethodFinder new.
cg@1534
   621
    resultArray:= mf load: anArray; findMessage. 
cg@1534
   622
].
james@1522
   623
james@1522
   624
((resultArray at:  1 )includesSubString: 'no single') ifTrue:[
james@1522
   625
                                self warn: (resultArray at:  1 ).
james@1522
   626
                                ^self
james@1522
   627
                                                              ].  
james@1522
   628
"the following then replaces data1 and data2 created by the method finder to the appropriate arguments"
james@1522
   629
resultArray keysAndValuesDo:[:key :value |   | newValue | 
james@1522
   630
      newValue:= value replString: 'data1' withString:(tempReceiver key).
james@1522
   631
(tempArguments size) >= 1 ifTrue:[
james@1522
   632
      newValue:= newValue replString: 'data2' withString:(tempArguments keyAt:1)].
james@1522
   633
james@1522
   634
(tempArguments size) > 1 ifTrue:[
james@1522
   635
      newValue:= newValue replString: 'data3' withString:(tempArguments keyAt:2).].
james@1522
   636
james@1522
   637
(tempArguments size) > 2 ifTrue:[
james@1522
   638
      newValue:= newValue replString: 'data4' withString:(tempArguments keyAt:3).].
james@1522
   639
cg@1532
   640
(tempArguments size) > 3 ifTrue:[ self halt. ].
cg@1532
   641
james@1522
   642
james@1522
   643
                        "    newValue:= value replString: 'data3' withString:(self messageAnswer key). " 
james@1522
   644
james@1522
   645
      newValue:=newValue, ' --> ', (tempAnswer key).
cg@1532
   646
      newValue replaceAll:Character cr with:Character space.
james@1522
   647
james@1522
   648
      resultArray at: key put: newValue.
james@1522
   649
james@1522
   650
              ].
james@1522
   651
james@1522
   652
self resultHolder value: resultArray.
james@1522
   653
resultSelectors:= mf selectors.   "used to find implementors so we do not have to "
james@1522
   654
receiver:=tempReceiver            "search the string for the selector found. Stored as an ordered collection"
cg@1532
   655
cg@1534
   656
    "Modified: / 13.11.2001 / 18:52:35 / cg"
cg@1532
   657
!
cg@1532
   658
cg@1532
   659
selectedClassOfResultHolderChanged
cg@1532
   660
    |sel classAndSelector mthd|
cg@1532
   661
cg@1532
   662
    sel := self selectedClassOfResultHolder value.
cg@1532
   663
cg@1532
   664
    classAndSelector := self extractClassAndSelectorFrom:sel.
cg@1532
   665
    classAndSelector isNil ifTrue:[
cg@1532
   666
        ^ self
cg@1532
   667
    ].
cg@1532
   668
    mthd := classAndSelector key >> classAndSelector value.   
cg@1532
   669
    mthd notNil ifTrue:[
cg@1532
   670
        self withWaitCursorDo:[
cg@1532
   671
            self codeHolder value:mthd source
cg@1532
   672
        ]
cg@1532
   673
    ] ifFalse:[
cg@1532
   674
        self codeHolder value:nil
cg@1532
   675
    ].
cg@1532
   676
cg@1532
   677
    "Created: / 13.11.2001 / 12:43:43 / cg"
cg@1532
   678
    "Modified: / 13.11.2001 / 12:48:56 / cg"
james@1522
   679
!
james@1522
   680
james@1522
   681
updateImplementorsOf:anInteger 
james@1525
   682
    "Request the implementors of the selected argument provided by aNumber.
james@1525
   683
     Return the receiver. "
james@1522
   684
      |methods classList aNumber|
james@1522
   685
james@1525
   686
james@1522
   687
       (anInteger isNil) ifTrue:[^self].
james@1522
   688
      anInteger isNil ifTrue:[aNumber:=1]
james@1522
   689
                      ifFalse:[aNumber:=anInteger].  
james@1525
   690
      methods:=SystemBrowser findImplementorsOf: (resultSelectors at:aNumber) in:Smalltalk allClasses ignoreCase:false.
james@1525
   691
      classList:=methods asOrderedCollection collect:[:m | m mclass name , ' ' , m selector].
james@1522
   692
james@1522
   693
      classList:=(self markMatchingClasses:(resultSelectors at:aNumber) classesWithSelector:classList).
james@1522
   694
james@1522
   695
    self classOfResultHolder value: classList.
cg@1532
   696
    self selectedClassOfResultHolder value:nil.
cg@1532
   697
cg@1532
   698
    "Modified: / 13.11.2001 / 12:07:31 / cg"
james@1522
   699
! !
james@1522
   700
james@1522
   701
!MethodFinderWindow methodsFor:'aspects'!
james@1522
   702
james@1522
   703
arg1BoxVisible
james@1525
   704
"Determines if the box should be visble or not. Return true or false"
james@1522
   705
    arg1BoxVisible isNil ifTrue:[
james@1522
   706
        arg1BoxVisible := BlockValue
james@1522
   707
                              with:[:vh | vh value >= 2 ]
james@1522
   708
                              argument:(self argCountHolder)
james@1522
   709
    ].
james@1522
   710
    ^ arg1BoxVisible.
james@1522
   711
!
james@1522
   712
james@1522
   713
arg2BoxVisible
james@1525
   714
"Determines if the box should be visble or not. Return true or false"
james@1522
   715
    arg2BoxVisible isNil ifTrue:[
james@1522
   716
        arg2BoxVisible := BlockValue
james@1522
   717
                              with:[:vh | vh value >= 3 ]
james@1522
   718
                              argument:(self argCountHolder)
james@1522
   719
    ].
james@1522
   720
    ^ arg2BoxVisible.
james@1522
   721
!
james@1522
   722
james@1522
   723
arg3BoxVisible
james@1525
   724
"Determines if the box should be visble or not. Return true or false"
james@1522
   725
    arg3BoxVisible isNil ifTrue:[
james@1522
   726
        arg3BoxVisible := BlockValue
james@1522
   727
                              with:[:vh | vh value >= 4 ]
james@1522
   728
                              argument:(self argCountHolder)
james@1522
   729
    ].
james@1522
   730
    ^ arg3BoxVisible.
james@1522
   731
!
james@1522
   732
james@1522
   733
arg4BoxVisible
james@1525
   734
"Determines if the box should be visble or not. Return true or false"
james@1522
   735
    arg4BoxVisible isNil ifTrue:[
james@1522
   736
        arg4BoxVisible := BlockValue
james@1522
   737
                              with:[:vh | vh value >= 5 ]
james@1522
   738
                              argument:(self argCountHolder)
james@1522
   739
    ].
james@1522
   740
    ^ arg4BoxVisible.
james@1522
   741
!
james@1522
   742
james@1522
   743
argCountHolder
james@1525
   744
"Return the value of argCounterHolder which is initialized at 2."
james@1522
   745
    argCountHolder isNil ifTrue:[
james@1522
   746
        argCountHolder := 2 asValue.
james@1522
   747
    ].     
james@1522
   748
    ^ argCountHolder.
james@1522
   749
!
james@1522
   750
james@1522
   751
argCountList
james@1525
   752
"Return the argCountList"
james@1522
   753
    argCountList isNil ifTrue:[
james@1522
   754
        argCountList := #('0 arguments' '1 argument' '2 arguments' '3 arguments') asValue  
james@1522
   755
    ].
james@1522
   756
    ^ argCountList.
james@1522
   757
!
james@1522
   758
james@1522
   759
classOfResultHolder
james@1525
   760
    "Return a valueHolder which contains a collection with the names of the 
james@1525
   761
     implementors of a specific message.   "
james@1522
   762
james@1522
   763
    |holder|
james@1522
   764
    (holder := builder bindingAt:#classOfResultHolder) isNil ifTrue:[
james@1525
   765
        holder := ValueHolder new.
james@1525
   766
        builder aspectAt:#classOfResultHolder put:holder
james@1522
   767
    ].
james@1522
   768
    ^ holder
james@1522
   769
!
james@1522
   770
cg@1532
   771
codeHolder
cg@1532
   772
    codeHolder isNil ifTrue:[
cg@1532
   773
        codeHolder := '' asValue.
cg@1532
   774
    ].
cg@1532
   775
    ^ codeHolder.
cg@1532
   776
cg@1532
   777
    "Created: / 13.11.2001 / 12:44:11 / cg"
cg@1532
   778
!
cg@1532
   779
james@1522
   780
resultHolder
james@1525
   781
    "Return a value holder which contains the results of a search as a collection."
james@1522
   782
james@1522
   783
    |holder|
james@1522
   784
    (holder := builder bindingAt:#resultHolder) isNil ifTrue:[
james@1525
   785
        holder := ValueHolder new.
james@1525
   786
        builder aspectAt:#resultHolder put:holder.
james@1522
   787
    ].
james@1522
   788
    ^ holder.
cg@1529
   789
!
cg@1529
   790
cg@1529
   791
selectedClassOfResultHolder
cg@1529
   792
    "Return a valueHolder which contains the index of the selected result class
cg@1529
   793
     (right list)"
cg@1529
   794
cg@1529
   795
    |holder|
cg@1529
   796
    (holder := builder bindingAt:#selectedClassOfResultHolder) isNil ifTrue:[
cg@1529
   797
        holder := ValueHolder new.
cg@1529
   798
        builder aspectAt:#selectedClassOfResultHolder put:holder
cg@1529
   799
    ].
cg@1529
   800
    ^ holder
james@1522
   801
! !
james@1522
   802
james@1522
   803
!MethodFinderWindow methodsFor:'callBacks'!
james@1522
   804
james@1522
   805
argument1WidgetCreated: aWidget
james@1525
   806
"Store the widget as an instance variable. Return the receiver"
james@1525
   807
james@1525
   808
james@1522
   809
        argument1Editor := aWidget scrolledView.
cg@1532
   810
        aWidget tabMeansNextField:true.
cg@1532
   811
cg@1532
   812
    "Modified: / 13.11.2001 / 12:21:41 / cg"
james@1522
   813
!
james@1522
   814
james@1522
   815
argument2WidgetCreated: aWidget
james@1525
   816
"Store the widget as an instance variable. Return the receiver"
james@1525
   817
james@1522
   818
james@1522
   819
        argument2Editor := aWidget scrolledView.
cg@1532
   820
        aWidget tabMeansNextField:true.
cg@1532
   821
cg@1532
   822
    "Modified: / 13.11.2001 / 12:21:45 / cg"
james@1522
   823
!
james@1522
   824
james@1522
   825
argument3WidgetCreated: aWidget
james@1525
   826
"Store the widget as an instance variable. Return the receiver"
james@1525
   827
james@1522
   828
james@1522
   829
        argument3Editor := aWidget scrolledView.
cg@1532
   830
        aWidget tabMeansNextField:true.
cg@1532
   831
cg@1532
   832
    "Modified: / 13.11.2001 / 12:21:49 / cg"
james@1522
   833
!
james@1522
   834
james@1525
   835
messageAnswerWidgetCreated: aWidget
james@1525
   836
"Store the widget as an instance variable. Return the receiver"
james@1522
   837
james@1525
   838
        messageAnswerEditor := aWidget scrolledView.
cg@1532
   839
        aWidget tabMeansNextField:true.
cg@1532
   840
cg@1532
   841
    "Modified: / 13.11.2001 / 12:24:55 / cg"
james@1522
   842
!
james@1522
   843
james@1525
   844
openHTMLDocumentation
james@1525
   845
    HTMLDocumentView openFullOnDocumentationFile:'tools/misc/TOP.html#METHODFINDER'
james@1522
   846
!
james@1522
   847
james@1522
   848
receiverWidgetCreated: aWidget
james@1525
   849
"Store the widget as an instance variable. Return the receiver"
james@1522
   850
james@1522
   851
        receiverEditor := aWidget scrolledView.
cg@1532
   852
        aWidget tabMeansNextField:true.
cg@1532
   853
cg@1532
   854
    "Modified: / 13.11.2001 / 12:24:49 / cg"
cg@1532
   855
!
cg@1532
   856
cg@1532
   857
sourceCodeWidgetCreated: aWidget
cg@1532
   858
        aWidget acceptAction:nil.
cg@1532
   859
        aWidget readOnly:true
cg@1532
   860
cg@1532
   861
    "Created: / 13.11.2001 / 12:50:27 / cg"
cg@1532
   862
    "Modified: / 13.11.2001 / 12:51:23 / cg"
james@1522
   863
! !
james@1522
   864
james@1522
   865
!MethodFinderWindow methodsFor:'controlInput'!
james@1522
   866
james@1522
   867
cleanInputs: aDirtyString
james@1525
   868
     "Find and remove common mistakes made by the user. Return the 
james@1525
   869
     'aStringToBeCleaned' variable"
james@1522
   870
       | aStringToBeCleaned rs position|
james@1522
   871
james@1522
   872
   aStringToBeCleaned:=aDirtyString.
james@1522
   873
james@1522
   874
(aStringToBeCleaned endsWith:(Character cr)) ifTrue:[
james@1522
   875
                        aStringToBeCleaned:=aStringToBeCleaned copyFrom:1 to: (aStringToBeCleaned size -1).].
james@1522
   876
aStringToBeCleaned:= aStringToBeCleaned withoutSeparators.
james@1522
   877
james@1522
   878
james@1522
   879
rs:=ReadStream on: aStringToBeCleaned.
james@1522
   880
[rs upToAll: '#true'.  rs atEnd] whileFalse: [
james@1522
   881
                        position:= rs position. 
james@1522
   882
                        aStringToBeCleaned:=aStringToBeCleaned copyReplaceFrom: position to: position with: ''. "remove #"
james@1522
   883
                        rs:=ReadStream on: aStringToBeCleaned.
james@1522
   884
                        ].
james@1522
   885
james@1522
   886
rs:=ReadStream on: aStringToBeCleaned.
james@1522
   887
[rs upToAll: '#false'.  rs atEnd] whileFalse: [
james@1522
   888
                        position:= rs position. 
james@1522
   889
                        aStringToBeCleaned:=aStringToBeCleaned copyReplaceFrom: position to: position with: ''. "remove #"
james@1522
   890
                        rs:=ReadStream on: aStringToBeCleaned.
james@1522
   891
                        rs:=ReadStream on: aStringToBeCleaned. ].
james@1522
   892
james@1522
   893
[rs upToAll: '#nil'.  rs atEnd] whileFalse: [
james@1522
   894
                        position:= rs position. 
james@1522
   895
                        aStringToBeCleaned:=aStringToBeCleaned copyReplaceFrom: position to: position with: ''. "remove #"
james@1522
   896
                        rs:=ReadStream on: aStringToBeCleaned.  ].
james@1522
   897
                   ^aStringToBeCleaned    
james@1522
   898
!
james@1522
   899
james@1525
   900
markMatchingClasses: aSelector  classesWithSelector:anOrderedCollection
james@1525
   901
   " Matches the class of the receiver with all the elements in anOrderedCollection
james@1525
   902
    (which are classes with selectors). If a match is found it is marked with an asterisk. 
james@1525
   903
    The classes are then sorted so the the asterisk appears first. Return the 
james@1525
   904
    markedClassList."
james@1522
   905
sr@2165
   906
        | marker recClass unmarkedClassList markedClassList|
james@1522
   907
cg@1532
   908
        marker := self class markerForImplementingClass.
cg@1532
   909
cg@1532
   910
        recClass := receiver value class.
james@1525
   911
        unmarkedClassList:=anOrderedCollection copy.
james@1525
   912
        unmarkedClassList do:
james@1525
   913
                [:classAndMethod | | class |
james@1525
   914
                class:=Compiler evaluate:
james@1525
   915
                                ((ReadStream on: classAndMethod) upToAll: aSelector).
cg@1532
   916
                "/ (recClass == class)
cg@1532
   917
                (recClass whichClassImplements:aSelector) == class
cg@1532
   918
                ifTrue:
cg@1532
   919
                        ["/ unmarkedClassList add: marker, classAndMethod.
cg@1532
   920
                        unmarkedClassList add: classAndMethod allBold.
cg@1532
   921
                        unmarkedClassList remove: classAndMethod.
cg@1532
   922
                        ].
cg@1532
   923
        ].
james@1522
   924
james@1522
   925
      unmarkedClassList sort:[:a :b | |rawA rawB|
cg@1532
   926
                    rawA := a string.
cg@1532
   927
                    (rawA startsWith:marker) ifTrue:[rawA := rawA copyFrom:marker size+1].
cg@1532
   928
                    rawB := b string.
cg@1532
   929
                    (rawB startsWith:marker) ifTrue:[rawB := rawB copyFrom:marker size+1].
cg@1532
   930
                    rawA < rawB.  ].
james@1525
   931
      markedClassList:= unmarkedClassList. 
james@1525
   932
james@1525
   933
         ^markedClassList
cg@1532
   934
cg@1532
   935
    "Modified: / 13.11.2001 / 12:16:05 / cg"
james@1522
   936
!
james@1522
   937
james@1522
   938
mergReciever: aReceiver WithArgument: arguments
james@1522
   939
james@1525
   940
"Puts the receiver and arguments into an array so it can be of a suitable input for the
james@1525
   941
 MethodFinder. Return an array."
james@1525
   942
james@1522
   943
| tempReceiver tempArguments receiverWithArgument|
james@1522
   944
james@1522
   945
  tempReceiver:= aReceiver.
james@1522
   946
 tempArguments :=  arguments.
james@1522
   947
james@1522
   948
(tempArguments isEmpty or:[(tempArguments) isNil])
james@1522
   949
                ifTrue:[  receiverWithArgument:=Array new:1."no argument"
james@1522
   950
                          receiverWithArgument at:1 put: tempReceiver.     
james@1522
   951
                        ]
james@1522
   952
                ifFalse:[
james@1522
   953
        (tempArguments size = 1)
james@1522
   954
                        ifTrue:[ receiverWithArgument:=Array new:2.
james@1522
   955
                                  receiverWithArgument at:1 put: tempReceiver.      
james@1522
   956
                                  receiverWithArgument at:2 put: (tempArguments at:1)
james@1522
   957
                                ].  "a receiver with an argument"
james@1522
   958
james@1522
   959
        (tempArguments size = 2)
james@1522
   960
                        ifTrue:[ receiverWithArgument:=Array new:3.
james@1522
   961
                                  receiverWithArgument at:1 put: tempReceiver.      
james@1522
   962
                                  (receiverWithArgument at:2 put: (tempArguments at:1)).
james@1522
   963
                                  (receiverWithArgument at:3 put: (tempArguments at:2))
james@1522
   964
                                ].  "a receiver with an argument"
james@1522
   965
        (tempArguments size = 3)
james@1522
   966
                        ifTrue:[ receiverWithArgument:=Array new:4.
james@1522
   967
                                  receiverWithArgument at:1 put: tempReceiver.      
james@1522
   968
                                  (receiverWithArgument at:2 put: (tempArguments at:1)).
james@1522
   969
                                  (receiverWithArgument at:3 put: (tempArguments at:2)).
james@1522
   970
                                  (receiverWithArgument at:4 put: (tempArguments at:3)).
james@1522
   971
james@1522
   972
                                ].  "a receiver with an argument"
james@1522
   973
james@1522
   974
                        ].
james@1522
   975
^receiverWithArgument
james@1522
   976
! !
james@1522
   977
cg@1532
   978
!MethodFinderWindow methodsFor:'misc'!
cg@1532
   979
cg@1532
   980
aboutThisApplicationText
cg@1532
   981
    |msg|
cg@1532
   982
cg@1532
   983
    msg := super aboutThisApplicationText.
cg@2412
   984
    msg := msg , '\\Ported from Squeak to ST/X by James Hayes (james@exept.de).
cg@2412
   985
Original written by Ted Kaehler, Scott Wallace and Dan Ingalls.'.
cg@1532
   986
    ^msg withCRs.
cg@1532
   987
cg@1532
   988
    "Modified: / 13.11.2001 / 12:56:44 / cg"
cg@1532
   989
! !
cg@1532
   990
james@1522
   991
!MethodFinderWindow class methodsFor:'documentation'!
james@1522
   992
james@1522
   993
version
james@1522
   994
    ^ '$Header$'
james@1522
   995
! !