MethodFinderWindow.st
changeset 3289 2902c1233b4e
parent 3215 4c69b031fb70
child 3290 19e31edb0dd6
equal deleted inserted replaced
3288:4edb3ebfe446 3289:2902c1233b4e
    56     "
    56     "
    57 
    57 
    58     <resource: #canvas>
    58     <resource: #canvas>
    59 
    59 
    60     ^ 
    60     ^ 
    61      #(FullSpec
    61     #(FullSpec
    62         name: windowSpec
    62        name: windowSpec
    63         window: 
    63        window: 
    64        (WindowSpec
    64       (WindowSpec
    65           label: 'MethodFinder'
    65          label: 'MethodFinder'
    66           name: 'MethodFinder'
    66          name: 'MethodFinder'
    67           bounds: (Rectangle 0 0 798 595)
    67          bounds: (Rectangle 0 0 920 690)
    68           menu: menu
    68          menu: menu
    69           icon: defaultIcon
    69          icon: defaultIcon
    70         )
    70        )
    71         component: 
    71        component: 
    72        (SpecCollection
    72       (SpecCollection
    73           collection: (
    73          collection: (
    74            (VariableHorizontalPanelSpec
    74           (VariableHorizontalPanelSpec
    75               name: 'VariableHorizontalPanel1'
    75              name: 'VariableHorizontalPanel1'
    76               layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
    76              layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
    77               snapMode: both
    77              snapMode: both
    78               component: 
    78              component: 
    79              (SpecCollection
    79             (SpecCollection
    80                 collection: (
    80                collection: (
    81                  (ViewSpec
    81                 (ViewSpec
    82                     name: 'LeftBox'
    82                    name: 'LeftBox'
    83                     level: 1
    83                    level: 1
    84                     component: 
    84                    component: 
    85                    (SpecCollection
    85                   (SpecCollection
    86                       collection: (
    86                      collection: (
    87                        (ViewSpec
    87                       (ViewSpec
    88                           name: 'ReceiverArgBox'
    88                          name: 'ReceiverArgBox'
    89                           layout: (LayoutFrame 0 0 0 0 0 1 -100 0.5)
    89                          layout: (LayoutFrame 0 0 0 0 0 1 -100 0.5)
    90                           component: 
    90                          component: 
    91                          (SpecCollection
    91                         (SpecCollection
    92                             collection: (
    92                            collection: (
    93                              (LabelSpec
    93                             (LabelSpec
    94                                 label: 'Receiver'
    94                                label: 'Receiver'
    95                                 name: 'ReceiverLabel'
    95                                name: 'ReceiverLabel'
    96                                 layout: (LayoutFrame 0 0 0 0 0 0.34 24 0)
    96                                layout: (LayoutFrame 0 0 0 0 0 0.34000000000000002 28 0)
    97                                 translateLabel: true
    97                                translateLabel: true
    98                               )
    98                              )
    99                              (ComboListSpec
    99                             (ComboListSpec
   100                                 name: 'allowedArgments'
   100                                name: 'allowedArgments'
   101                                 layout: (LayoutFrame 0 0.34 1 0 0 0.64 23 0)
   101                                layout: (LayoutFrame 0 0.34000000000000002 1 0 0 0.64000000000000012 28 0)
   102                                 model: argCountHolder
   102                                model: argCountHolder
   103                                 comboList: argCountList
   103                                comboList: argCountList
   104                                 useIndex: true
   104                                useIndex: true
   105                               )
   105                              )
   106                              (LabelSpec
   106                             (LabelSpec
   107                                 label: 'Answer'
   107                                label: 'Answer'
   108                                 name: 'MessageAnswerLabel'
   108                                name: 'MessageAnswerLabel'
   109                                 layout: (LayoutFrame 0 0.64 0 0 0 1 24 0)
   109                                layout: (LayoutFrame 0 0.64000000000000012 0 0 0 1 28 0)
   110                                 translateLabel: true
   110                                translateLabel: true
   111                               )
   111                              )
   112                              (HorizontalPanelViewSpec
   112                             (HorizontalPanelViewSpec
   113                                 name: 'HorizontalPanel1'
   113                                name: 'HorizontalPanel1'
   114                                 layout: (LayoutFrame 0 0 25 0 0 1 0 1)
   114                                layout: (LayoutFrame 0 0 30 0 0 1 0 1)
   115                                 horizontalLayout: fit
   115                                horizontalLayout: fit
   116                                 verticalLayout: fit
   116                                verticalLayout: fit
   117                                 horizontalSpace: 3
   117                                horizontalSpace: 3
   118                                 verticalSpace: 3
   118                                verticalSpace: 3
   119                                 component: 
   119                                component: 
   120                                (SpecCollection
   120                               (SpecCollection
   121                                   collection: (
   121                                  collection: (
   122                                    (WorkspaceSpec
   122                                   (WorkspaceSpec
   123                                       name: 'ReceiverEditor'
   123                                      name: 'ReceiverEditor'
   124                                       tabable: true
   124                                      tabable: true
   125                                       hasHorizontalScrollBar: true
   125                                      hasHorizontalScrollBar: true
   126                                       hasVerticalScrollBar: true
   126                                      hasVerticalScrollBar: true
   127                                       miniScrollerHorizontal: true
   127                                      miniScrollerHorizontal: true
   128                                       miniScrollerVertical: true
   128                                      miniScrollerVertical: true
   129                                       autoHideScrollBars: true
   129                                      autoHideScrollBars: true
   130                                       hasKeyboardFocusInitially: false
   130                                      hasKeyboardFocusInitially: false
   131                                       extent: (Point 113 172)
   131                                      extent: (Point 110 214)
   132                                       postBuildCallback: receiverWidgetCreated:
   132                                      postBuildCallback: receiverWidgetCreated:
   133                                     )
   133                                    )
   134                                    (VerticalPanelViewSpec
   134                                   (VerticalPanelViewSpec
   135                                       name: 'VerticalPanel1'
   135                                      name: 'VerticalPanel1'
   136                                       horizontalLayout: fit
   136                                      horizontalLayout: fit
   137                                       verticalLayout: fit
   137                                      verticalLayout: fit
   138                                       horizontalSpace: 3
   138                                      horizontalSpace: 3
   139                                       verticalSpace: 3
   139                                      verticalSpace: 3
   140                                       component: 
   140                                      component: 
   141                                      (SpecCollection
   141                                     (SpecCollection
   142                                         collection: (
   142                                        collection: (
   143                                          (ViewSpec
   143                                         (ViewSpec
   144                                             name: 'Box1'
   144                                            name: 'Box1'
   145                                             visibilityChannel: arg1BoxVisible
   145                                            visibilityChannel: arg1BoxVisible
   146                                             component: 
   146                                            component: 
   147                                            (SpecCollection
   147                                           (SpecCollection
   148                                               collection: (
   148                                              collection: (
   149                                                (WorkspaceSpec
   149                                               (WorkspaceSpec
   150                                                   name: 'Arg1Editor'
   150                                                  name: 'Arg1Editor'
   151                                                   layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
   151                                                  layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
   152                                                   tabable: true
   152                                                  tabable: true
   153                                                   hasHorizontalScrollBar: true
   153                                                  hasHorizontalScrollBar: true
   154                                                   hasVerticalScrollBar: true
   154                                                  hasVerticalScrollBar: true
   155                                                   miniScrollerHorizontal: true
   155                                                  miniScrollerHorizontal: true
   156                                                   miniScrollerVertical: true
   156                                                  miniScrollerVertical: true
   157                                                   autoHideScrollBars: true
   157                                                  autoHideScrollBars: true
   158                                                   hasKeyboardFocusInitially: false
   158                                                  hasKeyboardFocusInitially: false
   159                                                   postBuildCallback: argument1WidgetCreated:
   159                                                  postBuildCallback: argument1WidgetCreated:
   160                                                 )
       
   161                                                )
   160                                                )
   162                                              
   161                                               )
   163                                             )
   162                                             
   164                                             extent: (Point 114 55)
   163                                            )
   165                                           )
   164                                            extent: (Point 110 69)
   166                                          (ViewSpec
   165                                          )
   167                                             name: 'Box2'
   166                                         (ViewSpec
   168                                             visibilityChannel: arg2BoxVisible
   167                                            name: 'Box2'
   169                                             component: 
   168                                            visibilityChannel: arg2BoxVisible
   170                                            (SpecCollection
   169                                            component: 
   171                                               collection: (
   170                                           (SpecCollection
   172                                                (WorkspaceSpec
   171                                              collection: (
   173                                                   name: 'TextEditor5'
   172                                               (WorkspaceSpec
   174                                                   layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
   173                                                  name: 'TextEditor5'
   175                                                   tabable: true
   174                                                  layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
   176                                                   hasHorizontalScrollBar: true
   175                                                  tabable: true
   177                                                   hasVerticalScrollBar: true
   176                                                  hasHorizontalScrollBar: true
   178                                                   miniScrollerHorizontal: true
   177                                                  hasVerticalScrollBar: true
   179                                                   miniScrollerVertical: true
   178                                                  miniScrollerHorizontal: true
   180                                                   autoHideScrollBars: true
   179                                                  miniScrollerVertical: true
   181                                                   hasKeyboardFocusInitially: false
   180                                                  autoHideScrollBars: true
   182                                                   postBuildCallback: argument2WidgetCreated:
   181                                                  hasKeyboardFocusInitially: false
   183                                                 )
   182                                                  postBuildCallback: argument2WidgetCreated:
   184                                                )
   183                                                )
   185                                              
   184                                               )
   186                                             )
   185                                             
   187                                             extent: (Point 114 56)
   186                                            )
   188                                           )
   187                                            extent: (Point 110 70)
   189                                          (ViewSpec
   188                                          )
   190                                             name: 'Box3'
   189                                         (ViewSpec
   191                                             visibilityChannel: arg3BoxVisible
   190                                            name: 'Box3'
   192                                             component: 
   191                                            visibilityChannel: arg3BoxVisible
   193                                            (SpecCollection
   192                                            component: 
   194                                               collection: (
   193                                           (SpecCollection
   195                                                (WorkspaceSpec
   194                                              collection: (
   196                                                   name: 'TextEditor6'
   195                                               (WorkspaceSpec
   197                                                   layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
   196                                                  name: 'TextEditor6'
   198                                                   tabable: true
   197                                                  layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
   199                                                   hasHorizontalScrollBar: true
   198                                                  tabable: true
   200                                                   hasVerticalScrollBar: true
   199                                                  hasHorizontalScrollBar: true
   201                                                   miniScrollerHorizontal: true
   200                                                  hasVerticalScrollBar: true
   202                                                   miniScrollerVertical: true
   201                                                  miniScrollerHorizontal: true
   203                                                   autoHideScrollBars: true
   202                                                  miniScrollerVertical: true
   204                                                   hasKeyboardFocusInitially: false
   203                                                  autoHideScrollBars: true
   205                                                   postBuildCallback: argument3WidgetCreated:
   204                                                  hasKeyboardFocusInitially: false
   206                                                 )
   205                                                  postBuildCallback: argument3WidgetCreated:
   207                                                )
   206                                                )
   208                                              
   207                                               )
   209                                             )
   208                                             
   210                                             extent: (Point 114 55)
   209                                            )
   211                                           )
   210                                            extent: (Point 110 69)
   212                                          )
   211                                          )
   213                                        
   212                                         )
   214                                       )
   213                                       
   215                                       extent: (Point 114 172)
   214                                      )
   216                                     )
   215                                      extent: (Point 110 214)
   217                                    (WorkspaceSpec
       
   218                                       name: 'AnswerEditor'
       
   219                                       tabable: true
       
   220                                       hasHorizontalScrollBar: true
       
   221                                       hasVerticalScrollBar: true
       
   222                                       miniScrollerHorizontal: true
       
   223                                       miniScrollerVertical: true
       
   224                                       autoHideScrollBars: true
       
   225                                       hasKeyboardFocusInitially: false
       
   226                                       extent: (Point 114 172)
       
   227                                       postBuildCallback: messageAnswerWidgetCreated:
       
   228                                     )
       
   229                                    )
   216                                    )
   230                                  
   217                                   (WorkspaceSpec
   231                                 )
   218                                      name: 'AnswerEditor'
   232                               )
   219                                      tabable: true
       
   220                                      hasHorizontalScrollBar: true
       
   221                                      hasVerticalScrollBar: true
       
   222                                      miniScrollerHorizontal: true
       
   223                                      miniScrollerVertical: true
       
   224                                      autoHideScrollBars: true
       
   225                                      hasKeyboardFocusInitially: false
       
   226                                      extent: (Point 110 214)
       
   227                                      postBuildCallback: messageAnswerWidgetCreated:
       
   228                                    )
       
   229                                   )
       
   230                                 
       
   231                                )
   233                              )
   232                              )
   234                            
   233                             )
   235                           )
   234                           
   236                         )
   235                          )
   237                        (ViewSpec
   236                        )
   238                           name: 'ReceiverArgBoxActionBox'
   237                       (ViewSpec
   239                           layout: (LayoutFrame 0 0 -98 0.5 0 1 -75 0.5)
   238                          name: 'ReceiverArgBoxActionBox'
   240                           component: 
   239                          layout: (LayoutFrame 0 0 -98 0.5 0 1 -75 0.5)
   241                          (SpecCollection
   240                          component: 
   242                             collection: (
   241                         (SpecCollection
   243                              (ActionButtonSpec
   242                            collection: (
   244                                 label: 'Clear'
   243                             (ActionButtonSpec
   245                                 name: 'Button2'
   244                                label: 'Clear'
   246                                 layout: (LayoutFrame 5 0 0 0 -5 0.5 0 1)
   245                                name: 'Button2'
   247                                 translateLabel: true
   246                                layout: (LayoutFrame 5 0 0 0 -5 0.5 0 1)
   248                                 model: clear
   247                                translateLabel: true
   249                               )
   248                                model: clear
   250                              (ActionButtonSpec
       
   251                                 label: 'Search'
       
   252                                 name: 'Button1'
       
   253                                 layout: (LayoutFrame 5 0.5 0 0 -5 1 0 1)
       
   254                                 translateLabel: true
       
   255                                 tabable: true
       
   256                                 model: search
       
   257                               )
       
   258                              )
   249                              )
   259                            
   250                             (ActionButtonSpec
   260                           )
   251                                label: 'Search'
   261                         )
   252                                name: 'Button1'
   262                        (ViewSpec
   253                                layout: (LayoutFrame 5 0.5 0 0 -5 1 0 1)
   263                           name: 'MatchActionBox'
   254                                translateLabel: true
   264                           layout: (LayoutFrame 0 0 -70 0.5 0 1 -20 0.5)
   255                                tabable: true
   265                           component: 
   256                                model: search
   266                          (SpecCollection
       
   267                             collection: (
       
   268                              (LabelSpec
       
   269                                 label: 'Selector Pattern:'
       
   270                                 name: 'Label1'
       
   271                                 layout: (LayoutFrame 0 0 0 0 0 0.5 25 0)
       
   272                                 translateLabel: true
       
   273                                 adjust: left
       
   274                               )
       
   275                              (InputFieldSpec
       
   276                                 name: 'EntryField1'
       
   277                                 layout: (LayoutFrame 0 0 -25 1 0 0.5 -5 1)
       
   278                                 model: selectorPattern
       
   279                                 immediateAccept: true
       
   280                                 acceptOnReturn: true
       
   281                                 acceptOnTab: true
       
   282                                 acceptOnPointerLeave: true
       
   283                               )
       
   284                              (ActionButtonSpec
       
   285                                 label: 'Search'
       
   286                                 name: 'Button4'
       
   287                                 layout: (LayoutFrame 5 0.5 -25 1 -5 1 0 1)
       
   288                                 translateLabel: true
       
   289                                 tabable: true
       
   290                                 model: searchPatternMatchesInBackground
       
   291                               )
       
   292                              )
   257                              )
   293                            
   258                             )
   294                           )
   259                           
   295                         )
   260                          )
   296                        (SequenceViewSpec
       
   297                           name: 'ResultList'
       
   298                           layout: (LayoutFrame 0 0 -15 0.5 0 1 0 1)
       
   299                           model: selectedImplementorsHolder
       
   300                           menu: resultListMenu
       
   301                           hasHorizontalScrollBar: true
       
   302                           hasVerticalScrollBar: true
       
   303                           autoHideScrollBars: true
       
   304                           valueChangeSelector: updateImplementorsOf:
       
   305                           useIndex: true
       
   306                           sequenceList: resultHolder
       
   307                         )
       
   308                        )
   261                        )
   309                      
   262                       (ViewSpec
   310                     )
   263                          name: 'MatchActionBox'
   311                   )
   264                          layout: (LayoutFrame 0 0 -70 0.5 0 1 -20 0.5)
   312                  (VariableVerticalPanelSpec
   265                          component: 
   313                     name: 'VariableVerticalPanel1'
   266                         (SpecCollection
   314                     component: 
   267                            collection: (
   315                    (SpecCollection
   268                             (LabelSpec
   316                       collection: (
   269                                label: 'Selector Pattern:'
   317                        (SequenceViewSpec
   270                                name: 'Label1'
   318                           name: 'List2'
   271                                layout: (LayoutFrame 0 0 0 0 0 0.5 25 0)
   319                           model: selectedClassOfResultHolder
   272                                translateLabel: true
   320                           menu: implementorListMenu
   273                                adjust: left
   321                           hasHorizontalScrollBar: true
   274                              )
   322                           hasVerticalScrollBar: true
   275                             (InputFieldSpec
   323                           autoHideScrollBars: true
   276                                name: 'EntryField1'
   324                           doubleClickSelector: openBrowserOn:
   277                                layout: (LayoutFrame 0 0 -25 1 0 0.5 0 1)
   325                           valueChangeSelector: selectedClassOfResultHolderChanged
   278                                model: selectorPattern
   326                           useIndex: false
   279                                immediateAccept: true
   327                           sequenceList: classOfResultHolder
   280                                acceptOnReturn: true
   328                         )
   281                                acceptOnTab: true
   329                        (CodeViewSpec
   282                                acceptOnPointerLeave: true
   330                           name: 'CodeView'
   283                              )
   331                           model: codeHolder
   284                             (ActionButtonSpec
   332                           hasHorizontalScrollBar: true
   285                                label: 'Search'
   333                           hasVerticalScrollBar: true
   286                                name: 'Button4'
   334                           autoHideScrollBars: true
   287                                layout: (LayoutFrame 5 0.5 -25 1 -5 1 0 1)
   335                           hasKeyboardFocusInitially: false
   288                                translateLabel: true
   336                           postBuildCallback: sourceCodeWidgetCreated:
   289                                tabable: true
   337                         )
   290                                model: searchPatternMatchesInBackground
       
   291                              )
       
   292                             )
       
   293                           
       
   294                          )
   338                        )
   295                        )
   339                      
   296                       (SequenceViewSpec
   340                     )
   297                          name: 'ResultList'
   341                     handles: (Any 0.5 1.0)
   298                          layout: (LayoutFrame 0 0 -15 0.5 0 1 0 1)
   342                   )
   299                          model: selectedImplementorsHolder
       
   300                          menu: resultListMenu
       
   301                          hasHorizontalScrollBar: true
       
   302                          hasVerticalScrollBar: true
       
   303                          autoHideScrollBars: true
       
   304                          valueChangeSelector: updateImplementorsOf:
       
   305                          useIndex: true
       
   306                          sequenceList: resultHolder
       
   307                        )
       
   308                       )
       
   309                     
       
   310                    )
   343                  )
   311                  )
   344                
   312                 (VariableVerticalPanelSpec
   345               )
   313                    name: 'VariableVerticalPanel1'
   346               handles: (Any 0.443786982248521 1.0)
   314                    component: 
   347             )
   315                   (SpecCollection
       
   316                      collection: (
       
   317                       (SequenceViewSpec
       
   318                          name: 'List2'
       
   319                          model: selectedClassOfResultHolder
       
   320                          menu: implementorListMenu
       
   321                          hasHorizontalScrollBar: true
       
   322                          hasVerticalScrollBar: true
       
   323                          autoHideScrollBars: true
       
   324                          doubleClickSelector: openBrowserOn:
       
   325                          valueChangeSelector: selectedClassOfResultHolderChanged
       
   326                          useIndex: false
       
   327                          sequenceList: classOfResultHolder
       
   328                        )
       
   329                       (CodeViewSpec
       
   330                          name: 'CodeView'
       
   331                          model: codeHolder
       
   332                          hasHorizontalScrollBar: true
       
   333                          hasVerticalScrollBar: true
       
   334                          autoHideScrollBars: true
       
   335                          hasKeyboardFocusInitially: false
       
   336                          postBuildCallback: sourceCodeWidgetCreated:
       
   337                        )
       
   338                       )
       
   339                     
       
   340                    )
       
   341                    handles: (Any 0.5 1.0)
       
   342                  )
       
   343                 )
       
   344               
       
   345              )
       
   346              handles: (Any 0.37391304347826088 1.0)
   348            )
   347            )
   349          
   348           )
   350         )
   349         
   351       )
   350        )
   352 
   351      )
   353     "Modified: / 21-09-2012 / 11:09:44 / cg"
       
   354 ! !
   352 ! !
   355 
   353 
   356 !MethodFinderWindow class methodsFor:'menu specs'!
   354 !MethodFinderWindow class methodsFor:'menu specs'!
   357 
   355 
   358 implementorListMenu
   356 implementorListMenu
   478       )
   476       )
   479 
   477 
   480     "Created: / 21-09-2012 / 11:05:15 / cg"
   478     "Created: / 21-09-2012 / 11:05:15 / cg"
   481 ! !
   479 ! !
   482 
   480 
       
   481 !MethodFinderWindow class methodsFor:'startup'!
       
   482 
       
   483 openOnSelectorPattern:selector
       
   484     |app|
       
   485 
       
   486     app := self new.
       
   487     app allButOpen.
       
   488     app selectorPattern value:selector.
       
   489     app openWindow.
       
   490     ^ app
       
   491 
       
   492     "
       
   493      self openOnSelectorPattern:'asLowercase'
       
   494     "
       
   495 ! !
       
   496 
   483 !MethodFinderWindow methodsFor:'accessing'!
   497 !MethodFinderWindow methodsFor:'accessing'!
   484 
   498 
   485 receiver
   499 receiver
   486     "Return a copy of the value of the instance variable 'receiver' "
   500     "Return a copy of the value of the instance variable 'receiver' "
   487 
   501 
  1014 
  1028 
  1015     |holder|
  1029     |holder|
  1016     (holder := builder bindingAt:#resultHolder) isNil ifTrue:[
  1030     (holder := builder bindingAt:#resultHolder) isNil ifTrue:[
  1017         holder := ValueHolder new.
  1031         holder := ValueHolder new.
  1018         builder aspectAt:#resultHolder put:holder.
  1032         builder aspectAt:#resultHolder put:holder.
  1019         holder value:self resultInfoText.
  1033         holder value:(self resultInfoText collect:[:l | l withColor:Color darkGrey]).
  1020     ].
  1034     ].
  1021     ^ holder.
  1035     ^ holder.
  1022 
  1036 
  1023     "Modified: / 01-06-2012 / 13:06:02 / cg"
  1037     "Modified: / 01-06-2012 / 13:06:02 / cg"
  1024 !
  1038 !
  1027     ^  {
  1041     ^  {
  1028           'Please enter combination of' .
  1042           'Please enter combination of' .
  1029           '    ',('receiver, arg and result' allBold) .
  1043           '    ',('receiver, arg and result' allBold) .
  1030           'or a'.
  1044           'or a'.
  1031           '    ',('selector search pattern' allBold) .
  1045           '    ',('selector search pattern' allBold) .
  1032           'into the above fields, then click on either ',('"search"' allBold),'-button.'
  1046           'into the above fields.' .
       
  1047           'Then click on either ',('"search"' allBold),'-button.'
  1033        }
  1048        }
  1034 !
  1049 !
  1035 
  1050 
  1036 selectedClassOfResultHolder
  1051 selectedClassOfResultHolder
  1037     "valueHolder which contains the index of the selected result class (right list)"
  1052     "valueHolder which contains the index of the selected result class (right list)"