MethodFinderWindow.st
changeset 3769 0a821dfa2cca
parent 3768 efaa34ed7534
child 3770 3f324e812f60
equal deleted inserted replaced
3768:efaa34ed7534 3769:0a821dfa2cca
     1 "{ Encoding: utf8 }"
       
     2 
       
     3 "
     1 "
     4  Copyright (C) Original Authors (Kaehler, Scott Wallace and Dan Ingalls)
     2  Copyright (C) Original Authors (Kaehler, Scott Wallace and Dan Ingalls)
     5  Copyright (C) 2001 eXept Software AG
     3  Copyright (C) 2001 eXept Software AG
     6 
     4 
     7  Permission is hereby granted, free of charge, to any 
     5  Permission is hereby granted, free of charge, to any 
  1197 search2Levels
  1195 search2Levels
  1198     "Do an exhaustive search.
  1196     "Do an exhaustive search.
  1199      Given the original message,
  1197      Given the original message,
  1200      try applying all unary messages first to the receiver,
  1198      try applying all unary messages first to the receiver,
  1201      then to each argument.
  1199      then to each argument.
  1202      This takes O(N²) time - so be prepared"
  1200      This takes O(N²) time - so be prepared"
  1203 
  1201 
  1204     |tempReceiver tempAnswer tempArguments anArray resultArray receiverWithArgument mf|
  1202     |tempReceiver tempAnswer tempArguments anArray resultArray receiverWithArgument mf|
  1205 
  1203 
  1206     tempArguments := self argumentEditorsContents.
  1204     tempArguments := self argumentEditorsContents.
  1207     tempReceiver := self receiverEditorContents.
  1205     tempReceiver := self receiverEditorContents.
  1274             list isEmptyOrNil ifTrue:[
  1272             list isEmptyOrNil ifTrue:[
  1275                 match := pattern,'*'.
  1273                 match := pattern,'*'.
  1276                 list := SystemBrowser findImplementorsMatching:match in:Smalltalk allClasses ignoreCase:true.
  1274                 list := SystemBrowser findImplementorsMatching:match in:Smalltalk allClasses ignoreCase:true.
  1277             ].
  1275             ].
  1278         ] ifTrue:[
  1276         ] ifTrue:[
  1279             "/ match := '*',pattern,'*'.
       
  1280             match := pattern.
  1277             match := pattern.
  1281             list := SystemBrowser findImplementorsMatching:match in:Smalltalk allClasses ignoreCase:true.
  1278             list := SystemBrowser findImplementorsMatching:match in:Smalltalk allClasses ignoreCase:true.
  1282         ].
  1279         ].
  1283     ].
  1280     ].
  1284 
  1281 
  1402     self resultHolder value:resultList.
  1399     self resultHolder value:resultList.
  1403 
  1400 
  1404     searchPattern := self selectorPatternHolder value.
  1401     searchPattern := self selectorPatternHolder value.
  1405     "/ is the search pattern in the list (i.e. a perfect match)?
  1402     "/ is the search pattern in the list (i.e. a perfect match)?
  1406     "/ Then select it.
  1403     "/ Then select it.
  1407     idx := resultList 
  1404     idx := resultSelectors indexOf:searchPattern.
  1408             findFirst:[:bd | 
       
  1409                 (bd nameOrDefault sameAs:searchPattern)
       
  1410                 or:[ bd tags contains:[:tag | tag sameAs:searchPattern]]]. 
       
  1411     idx ~~ 0 ifTrue:[
  1405     idx ~~ 0 ifTrue:[
  1412         self selectedImplementorsHolder setValue:idx; changed
  1406         self selectedImplementorsHolder setValue:idx; changed
  1413     ].    
  1407     ].    
  1414 ! !
  1408 ! !
  1415 
  1409