#UI_ENHANCEMENT by cg
authorClaus Gittinger <cg@exept.de>
Thu, 24 May 2018 21:01:44 +0200
changeset 18154 c4719a869809
parent 18153 de80965bf770
child 18155 17a51cbfc444
#UI_ENHANCEMENT by cg class: Tools::MethodRewriter autosearch in method-list-browser changed: #doSearchAction #showMethods:title: #withMethods:do:finallyDo:
Tools__MethodRewriter.st
--- a/Tools__MethodRewriter.st	Thu May 24 16:34:30 2018 +0200
+++ b/Tools__MethodRewriter.st	Thu May 24 21:01:44 2018 +0200
@@ -1249,7 +1249,7 @@
 !
 
 doSearchAction
-    |ruleName|
+    |ruleName searchPattern|
 
     ruleForRewriteOrNilForAdHoc notNil ifTrue:[
         ruleName := self selectedRule name.
@@ -1257,6 +1257,8 @@
         self
             doSearchRule: self selectedRule
             withResultDo:[:matchingMethods|
+                |brwsr searchStrings|
+                
                 matchingMethods isEmpty
                     ifTrue:[
                         Dialog warn:(resources 
@@ -1264,37 +1266,44 @@
                                         with:ruleName)
                     ]
                     ifFalse:[
-                        self
+                        brwsr := self
                             showMethods: matchingMethods asArray
                             title: (resources 
                                         string:'%1 Methods matching rule: "%2"'
                                         with:matchingMethods size
-                                        with:ruleName)
+                                        with:ruleName).
+                        searchStrings := self selectedRule rewriteRule searches collect:[:eachSearch | eachSearch searchString].
+                        brwsr autoSearchCodePatterns:searchStrings
+
                     ]
             ]
     ] ifFalse:[
-       self
-            doSearchPattern: self searchPattern
+        searchPattern := self searchPattern.      
+        self
+            doSearchPattern:searchPattern
             withResultDo:[:matchingMethods|
+                |brwsr|
+                
                 matchingMethods isEmpty
                     ifTrue:[
                         Dialog warn:(resources 
                                         string:'No methods found for search pattern "%1"'
-                                        with: self searchPattern)
+                                        with:searchPattern)
                     ]
                     ifFalse:[
-                        self
-                            showMethods: matchingMethods asArray
+                        brwsr := self
+                            showMethods:matchingMethods asArray
                             title:(resources 
                                     string:'%1 Methods matching "%2"'
                                     with:matchingMethods size
-                                    with: self searchPattern)
+                                    with:searchPattern).
+                        self halt. brwsr autoSearchCodePattern:searchPattern            
                     ]
             ]
     ]
 
     "Created: / 12-12-2007 / 11:14:25 / janfrog"
-    "Modified: / 24-05-2018 / 14:28:39 / Claus Gittinger"
+    "Modified: / 24-05-2018 / 20:44:46 / Claus Gittinger"
 !
 
 removeSeletedClassesAction
@@ -1813,13 +1822,13 @@
 showMethods: methods title: title
     "open a browser on matching methods"
     
-    SystemBrowser default
+    ^ SystemBrowser default
                 browseMethods:methods
                 title:title
                 sort:true
 
     "Created: / 21-07-2007 / 06:51:36 / janfrog"
-    "Modified: / 24-05-2018 / 14:34:16 / Claus Gittinger"
+    "Modified: / 24-05-2018 / 20:27:46 / Claus Gittinger"
 !
 
 withMethods: givenMethods do: methodBlock
@@ -1844,7 +1853,7 @@
 
             mclass := mth mclass.
             mclass isNil ifTrue:[
-                Transcript showCR:'method no longer valid in ',mth getMclass printString.
+                Transcript showCR:'previously found method is no longer valid in ',mth getMclass printString.
             ] ifFalse:[    
                 numMethods > 100 ifTrue:[
                     self info: mclass name.
@@ -1863,6 +1872,7 @@
     ]
 
     "Created: / 12-12-2007 / 10:32:16 / janfrog"
+    "Modified: / 24-05-2018 / 18:23:17 / Claus Gittinger"
 !
 
 withMethodsDo: methodBlock finallyDo: finallyBlock