class: Tools::SearchDialog
authorClaus Gittinger <cg@exept.de>
Tue, 21 Apr 2015 16:59:24 +0200
changeset 15585 7e78350c918a
parent 15580 deefdf789ee7
child 15586 32d82f6734e6
child 15587 75291f910f79
class: Tools::SearchDialog added: #addCheckBoxForCurrentPackageAndSubPackages changed: #getClassesAndMethodsFor: #setupToAskForMethodSearchTitle:forBrowser:searchWhat:searchArea:withCaseIgnore:withMatch:withMethodList:allowFind:allowBuffer:allowBrowser:withTextEntry: added option to search in package and sub-packages
Tools__SearchDialog.st
--- a/Tools__SearchDialog.st	Mon Apr 20 11:05:32 2015 +0200
+++ b/Tools__SearchDialog.st	Tue Apr 21 16:59:24 2015 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 2000 by eXept Software AG
 	      All Rights Reserved
@@ -494,7 +496,10 @@
 
         (currentPackage notNil 
             and:[ currentPackage ~= (browser nameListEntryForALL) ]) 
-                ifTrue:[ self addCheckBoxForCurrentPackage ]
+                ifTrue:[ 
+                    self addCheckBoxForCurrentPackage.
+                    self addCheckBoxForCurrentPackageAndSubPackages.
+                ]
                 ifFalse:[
                     (currentClass notNil) ifTrue:[ 
                         self addCheckBoxForClassesPackage:(currentClass package) 
@@ -694,6 +699,18 @@
     "Modified: / 10-10-2006 / 15:29:06 / cg"
 !
 
+addCheckBoxForCurrentPackageAndSubPackages
+    |b any|
+
+    b := RadioButton "CheckBox" label:(resources string:'Current package ("%1") and Subpackages' with:currentPackage).
+    self addCheckBox:b forSearchArea:#currentPackageAndSubPackages.
+    any := Smalltalk allProjectIDs contains:[:p | p startsWith:currentPackage,'/'].
+    any ifFalse:[
+        b disable
+    ].        
+    ^ b.
+!
+
 addCheckBoxForEverywhere
     |b|
 
@@ -1210,6 +1227,17 @@
         methods := nil.
         ^ self.
     ].
+    where == #currentPackageAndSubPackages ifTrue:[ 
+        classes := Smalltalk 
+                        allClassesForWhich:[:cls | 
+                            |pkg|
+
+                            pkg := cls package ? PackageId noProjectID.
+                            pkg = currentPackage or:[ pkg startsWith:(currentPackage,'/') ]
+                        ].
+        methods := nil.
+        ^ self.
+    ].
     where == #currentClassesPackage ifTrue:[ 
         classes := Smalltalk allClassesInPackage:currentClass package. 
         methods := nil.
@@ -1422,11 +1450,11 @@
 !SearchDialog class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__SearchDialog.st,v 1.87 2015-02-28 23:43:11 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__SearchDialog.st,v 1.88 2015-04-21 14:59:24 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__SearchDialog.st,v 1.87 2015-02-28 23:43:11 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__SearchDialog.st,v 1.88 2015-04-21 14:59:24 cg Exp $'
 ! !