Tools__SearchDialog.st
branchjv
changeset 15586 32d82f6734e6
parent 15566 184cea584be5
parent 15585 7e78350c918a
child 15989 f5bcfbde2c3d
--- a/Tools__SearchDialog.st	Tue Apr 21 11:19:42 2015 +0100
+++ b/Tools__SearchDialog.st	Wed Apr 22 06:47:55 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 $'
 ! !