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